From 2f19b1eaa74c13ecfafb719cd40bc28370d63991 Mon Sep 17 00:00:00 2001 From: Toshi MARUYAMA Date: Sat, 11 Jul 2020 01:21:58 +0000 Subject: [PATCH] add bulk copy issues system test git-svn-id: http://svn.redmine.org/redmine/trunk@19884 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- test/system/issues_test.rb | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/test/system/issues_test.rb b/test/system/issues_test.rb index a84e95963..590445eee 100644 --- a/test/system/issues_test.rb +++ b/test/system/issues_test.rb @@ -403,6 +403,33 @@ class IssuesSystemTest < ApplicationSystemTestCase assert_equal 4, issue4.status.id end + def test_bulk_copy + log_user('jsmith', 'jsmith') + visit '/issues' + 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 'Copy' + end + assert_current_path '/issues/bulk_edit', :ignore_query => true + submit_buttons = page.all('input[type=submit]') + assert_equal 'Copy', submit_buttons[0].value + + page.find('#issue_priority_id').select('Low') + assert_difference 'Issue.count', 2 do + submit_buttons[0].click + end + assert_current_path '/issues', :ignore_query => true + assert page.has_css?('#flash_notice') + + copies = Issue.order('id DESC').limit(2) + assert_equal 4, copies[0].priority.id + assert_equal 4, copies[1].priority.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