summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarius Balteanu <marius.balteanu@zitec.com>2022-05-16 19:53:42 +0000
committerMarius Balteanu <marius.balteanu@zitec.com>2022-05-16 19:53:42 +0000
commitc3a08d99f5e2339aac159a46fc515108cc09d213 (patch)
treea3f7d2f3b423a7bf297f857157566b5a049838d5
parent5d830c892d0289c98443f4b03bc0d6ec36aade49 (diff)
downloadredmine-c3a08d99f5e2339aac159a46fc515108cc09d213.tar.gz
redmine-c3a08d99f5e2339aac159a46fc515108cc09d213.zip
Add test for #37053.
git-svn-id: https://svn.redmine.org/redmine/trunk@21579 e93f8b46-1217-0410-a6f0-8f06a7374b81
-rw-r--r--test/system/issues_test.rb20
1 files changed, 20 insertions, 0 deletions
diff --git a/test/system/issues_test.rb b/test/system/issues_test.rb
index 46a77ae51..c6a763eae 100644
--- a/test/system/issues_test.rb
+++ b/test/system/issues_test.rb
@@ -256,6 +256,26 @@ class IssuesSystemTest < ApplicationSystemTestCase
assert_equal 5, issue.reload.status.id
end
+ def test_update_issue_with_form_update_should_keep_newly_added_attachments
+ set_tmp_attachments_directory
+ log_user('jsmith', 'jsmith')
+
+ visit '/issues/2'
+ page.first(:link, 'Edit').click
+ attach_file 'attachments[dummy][file]', Rails.root.join('test/fixtures/files/testfile.txt')
+
+ assert page.has_css?('span#attachments_1')
+
+ page.find("#issue_status_id").select("Closed")
+
+ # check that attachment still exists on the page
+ assert page.has_css?('span#attachments_1')
+
+ click_on 'Submit'
+
+ assert_equal 1, Issue.find(2).attachments.count
+ end
+
test "removing issue shows confirm dialog" do
log_user('jsmith', 'jsmith')
visit '/issues/1'