From: Jean-Philippe Lang Date: Sun, 10 Feb 2013 10:31:38 +0000 (+0000) Subject: Adds a test for creating an issue with watchers. X-Git-Tag: 2.3.0~164 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=bd52c23e7be915b53b4fe0dbf8eb16183d3482c9;p=redmine.git Adds a test for creating an issue with watchers. git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11340 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- diff --git a/test/ui/issues_test.rb b/test/ui/issues_test.rb index 43f3536ac..97fd2fb79 100644 --- a/test/ui/issues_test.rb +++ b/test/ui/issues_test.rb @@ -56,6 +56,32 @@ class Redmine::UiTest::IssuesTest < Redmine::UiTest::Base assert_equal 'Value for field 2', issue.custom_field_value(CustomField.find_by_name('Searchable field')) end + def test_create_issue_with_watchers + User.generate!(:firstname => 'Some', :lastname => 'Watcher') + + assert_difference 'Issue.count' do + log_user('jsmith', 'jsmith') + visit '/projects/ecookbook/issues/new' + fill_in 'Subject', :with => 'Issue with watchers' + # Add a project member as watcher + check 'Dave Lopper' + # Search for another user + click_link 'Search for watchers to add' + within('form#new-watcher-form') do + assert page.has_content?('Some One') + fill_in 'user_search', :with => 'watch' + sleep(2) # autocomplete delay + assert !page.has_content?('Some One') + check 'Some Watcher' + click_button 'Add' + end + find('input[name=commit]').click + end + + issue = Issue.order('id desc').first + assert_equal ['Dave Lopper', 'Some Watcher'], issue.watcher_users.map(&:name).sort + end + def test_preview_issue_description log_user('jsmith', 'jsmith') visit new_issue_path(:project_id => 1)