From 8d2d557f2cda822fb32edcc9d1fdf3604e3dcfb7 Mon Sep 17 00:00:00 2001 From: Toshi MARUYAMA Date: Wed, 8 Jul 2020 17:30:28 +0000 Subject: [PATCH] add bulk_edit system test git-svn-id: http://svn.redmine.org/redmine/trunk@19866 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- test/system/issues_test.rb | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/test/system/issues_test.rb b/test/system/issues_test.rb index 2e9c86513..6f31376cb 100644 --- a/test/system/issues_test.rb +++ b/test/system/issues_test.rb @@ -337,6 +337,36 @@ class IssuesSystemTest < ApplicationSystemTestCase assert_equal 5, issue4.reload.status.id end + def test_bulk_edit + log_user('jsmith', 'jsmith') + visit '/issues' + issue1 = Issue.find(1) + issue4 = Issue.find(4) + assert_equal 1, issue1.reload.status.id + assert_equal 1, issue4.reload.status.id + assert page.has_css?('tr#issue-1') + assert page.has_css?('tr#issue-4') + find('tr#issue-1 input[type=checkbox]').click + find('tr#issue-4 input[type=checkbox]').click + find('tr#issue-1 td.updated_on').right_click + within('#context-menu') do + click_link 'Edit' + end + assert_current_path '/issues/bulk_edit', :ignore_query => true + submit_buttons = page.all('input[type=submit]') + assert_equal 1, submit_buttons.size + assert_equal 'Submit', submit_buttons[0].value + + page.find('#issue_status_id').select('Assigned') + assert_no_difference 'Issue.count' do + submit_buttons[0].click + end + assert_current_path '/issues', :ignore_query => true + assert page.has_css?('#flash_notice') + assert_equal 2, issue1.reload.status.id + assert_equal 2, issue4.reload.status.id + end + def test_issue_list_with_default_totalable_columns log_user('admin', 'admin') with_settings :issue_list_default_totals => ['estimated_hours'] do -- 2.39.5