##// END OF EJS Templates
Submit the form after preview....
Jean-Philippe Lang -
r11118:eed4954f0a43
parent child
Show More
@@ -23,10 +23,9 class Redmine::UiTest::IssuesTest < Redmine::UiTest::Base
23 23 :enumerations, :custom_fields, :custom_values, :custom_fields_trackers,
24 24 :watchers
25 25
26 # create an issue
27 def test_add_issue
26 def test_create_issue
28 27 log_user('jsmith', 'jsmith')
29 visit new_issue_path(:project_id => 1)
28 visit '/projects/ecookbook/issues/new'
30 29 within('form#issue-form') do
31 30 select 'Bug', :from => 'Tracker'
32 31 select 'Low', :from => 'Priority'
@@ -60,21 +59,21 class Redmine::UiTest::IssuesTest < Redmine::UiTest::Base
60 59 def test_create_issue_with_watchers
61 60 User.generate!(:firstname => 'Some', :lastname => 'Watcher')
62 61
62 log_user('jsmith', 'jsmith')
63 visit '/projects/ecookbook/issues/new'
64 fill_in 'Subject', :with => 'Issue with watchers'
65 # Add a project member as watcher
66 check 'Dave Lopper'
67 # Search for another user
68 click_link 'Search for watchers to add'
69 within('form#new-watcher-form') do
70 assert page.has_content?('Some One')
71 fill_in 'user_search', :with => 'watch'
72 assert page.has_no_content?('Some One')
73 check 'Some Watcher'
74 click_button 'Add'
75 end
63 76 assert_difference 'Issue.count' do
64 log_user('jsmith', 'jsmith')
65 visit '/projects/ecookbook/issues/new'
66 fill_in 'Subject', :with => 'Issue with watchers'
67 # Add a project member as watcher
68 check 'Dave Lopper'
69 # Search for another user
70 click_link 'Search for watchers to add'
71 within('form#new-watcher-form') do
72 assert page.has_content?('Some One')
73 fill_in 'user_search', :with => 'watch'
74 assert page.has_no_content?('Some One')
75 check 'Some Watcher'
76 click_button 'Add'
77 end
78 77 find('input[name=commit]').click
79 78 end
80 79
@@ -82,18 +81,21 class Redmine::UiTest::IssuesTest < Redmine::UiTest::Base
82 81 assert_equal ['Dave Lopper', 'Some Watcher'], issue.watcher_users.map(&:name).sort
83 82 end
84 83
85 # TODO: `fill_in 'Description'` makes all visit calls inoperative
86 # and breaks all tests that run after that
87 84 def test_preview_issue_description
88 skip("Breaks the test suite")
89
90 85 log_user('jsmith', 'jsmith')
91 visit new_issue_path(:project_id => 1)
86 visit '/projects/ecookbook/issues/new'
92 87 within('form#issue-form') do
88 fill_in 'Subject', :with => 'new issue subject'
93 89 fill_in 'Description', :with => 'new issue description'
94 90 click_link 'Preview'
95 91 end
96 92 find 'div#preview fieldset', :visible => true, :text => 'new issue description'
93 assert_difference 'Issue.count' do
94 find('input[name=commit]').click
95 end
96
97 issue = Issue.order('id desc').first
98 assert_equal 'new issue description', issue.description
97 99 end
98 100
99 101 def test_watch_issue_via_context_menu
General Comments 0
You need to be logged in to leave comments. Login now