From: Jean-Philippe Lang Date: Sun, 10 Feb 2013 15:53:14 +0000 (+0000) Subject: Adds context menu tests and skip test_preview_issue_description that breaks the test... X-Git-Tag: 2.3.0~163 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=6d408b82618c7f85693a94e39c31bca2fae2c721;p=redmine.git Adds context menu tests and skip test_preview_issue_description that breaks the test suite. git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11341 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- diff --git a/test/ui/issues_test.rb b/test/ui/issues_test.rb index 97fd2fb79..0ea92bfc4 100644 --- a/test/ui/issues_test.rb +++ b/test/ui/issues_test.rb @@ -20,7 +20,8 @@ require File.expand_path('../base', __FILE__) class Redmine::UiTest::IssuesTest < Redmine::UiTest::Base fixtures :projects, :users, :roles, :members, :member_roles, :trackers, :projects_trackers, :enabled_modules, :issue_statuses, :issues, - :enumerations, :custom_fields, :custom_values, :custom_fields_trackers + :enumerations, :custom_fields, :custom_values, :custom_fields_trackers, + :watchers # create an issue def test_add_issue @@ -82,7 +83,11 @@ class Redmine::UiTest::IssuesTest < Redmine::UiTest::Base assert_equal ['Dave Lopper', 'Some Watcher'], issue.watcher_users.map(&:name).sort end + # TODO: `fill_in 'Description'` makes all visit calls inoperative + # and breaks all tests that run after that def test_preview_issue_description + skip("Breaks the test suite") + log_user('jsmith', 'jsmith') visit new_issue_path(:project_id => 1) within('form#issue-form') do @@ -91,4 +96,32 @@ class Redmine::UiTest::IssuesTest < Redmine::UiTest::Base end find 'div#preview fieldset', :visible => true, :text => 'new issue description' end + + def test_watch_issue_via_context_menu + log_user('jsmith', 'jsmith') + visit '/issues' + find('tr#issue-1 td.updated_on').click + page.execute_script "$('tr#issue-1 td.updated_on').trigger('contextmenu');" + assert_difference 'Watcher.count' do + within('#context-menu') do + click_link 'Watch' + end + end + assert Issue.find(1).watched_by?(User.find_by_login('jsmith')) + end + + def test_bulk_watch_issues_via_context_menu + assert_difference 'Watcher.count', 2 do + log_user('jsmith', 'jsmith') + visit '/issues' + find('tr#issue-1 input[type=checkbox]').click + find('tr#issue-4 input[type=checkbox]').click + page.execute_script "$('tr#issue-1 td.updated_on').trigger('contextmenu');" + within('#context-menu') do + click_link 'Watch' + end + end + assert Issue.find(1).watched_by?(User.find_by_login('jsmith')) + assert Issue.find(4).watched_by?(User.find_by_login('jsmith')) + end end