##// END OF EJS Templates
Adds a test for creating an issue with watchers....
Jean-Philippe Lang -
r11110:bd52c23e7be9
parent child
Show More
@@ -56,6 +56,32 class Redmine::UiTest::IssuesTest < Redmine::UiTest::Base
56 assert_equal 'Value for field 2', issue.custom_field_value(CustomField.find_by_name('Searchable field'))
56 assert_equal 'Value for field 2', issue.custom_field_value(CustomField.find_by_name('Searchable field'))
57 end
57 end
58
58
59 def test_create_issue_with_watchers
60 User.generate!(:firstname => 'Some', :lastname => 'Watcher')
61
62 assert_difference 'Issue.count' do
63 log_user('jsmith', 'jsmith')
64 visit '/projects/ecookbook/issues/new'
65 fill_in 'Subject', :with => 'Issue with watchers'
66 # Add a project member as watcher
67 check 'Dave Lopper'
68 # Search for another user
69 click_link 'Search for watchers to add'
70 within('form#new-watcher-form') do
71 assert page.has_content?('Some One')
72 fill_in 'user_search', :with => 'watch'
73 sleep(2) # autocomplete delay
74 assert !page.has_content?('Some One')
75 check 'Some Watcher'
76 click_button 'Add'
77 end
78 find('input[name=commit]').click
79 end
80
81 issue = Issue.order('id desc').first
82 assert_equal ['Dave Lopper', 'Some Watcher'], issue.watcher_users.map(&:name).sort
83 end
84
59 def test_preview_issue_description
85 def test_preview_issue_description
60 log_user('jsmith', 'jsmith')
86 log_user('jsmith', 'jsmith')
61 visit new_issue_path(:project_id => 1)
87 visit new_issue_path(:project_id => 1)
General Comments 0
You need to be logged in to leave comments. Login now