]> source.dussan.org Git - redmine.git/commitdiff
add bulk copy issues system test
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Sat, 11 Jul 2020 01:21:58 +0000 (01:21 +0000)
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Sat, 11 Jul 2020 01:21:58 +0000 (01:21 +0000)
git-svn-id: http://svn.redmine.org/redmine/trunk@19884 e93f8b46-1217-0410-a6f0-8f06a7374b81

test/system/issues_test.rb

index a84e95963b02c1bc191a40f0395b67f74a22e298..590445eee4c3ad7c4b8807e4fec75b4a4a5dfb6a 100644 (file)
@@ -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