summaryrefslogtreecommitdiffstats
path: root/test/ui
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2013-02-16 15:20:36 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2013-02-16 15:20:36 +0000
commit9dd8988638cf53af0ff7c102cb69ce2ff6e6c70f (patch)
tree9fcb2ad5a037458062e97e6806c3203e0a5e9799 /test/ui
parentd01fe87a673edea2fe96d298d7e6fabe606902ea (diff)
downloadredmine-9dd8988638cf53af0ff7c102cb69ce2ff6e6c70f.tar.gz
redmine-9dd8988638cf53af0ff7c102cb69ce2ff6e6c70f.zip
Make sure that fields filled before tracker change are preserved.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11410 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/ui')
-rw-r--r--test/ui/issues_test.rb36
1 files changed, 26 insertions, 10 deletions
diff --git a/test/ui/issues_test.rb b/test/ui/issues_test.rb
index 5a4f49dd5..3a628c9b6 100644
--- a/test/ui/issues_test.rb
+++ b/test/ui/issues_test.rb
@@ -57,11 +57,17 @@ class Redmine::UiTest::IssuesTest < Redmine::UiTest::Base
end
def test_create_issue_with_form_update
- field = IssueCustomField.create!(
+ field1 = IssueCustomField.create!(
:field_format => 'string',
- :name => 'Form update CF',
+ :name => 'Field1',
:is_for_all => true,
- :trackers => Tracker.find_all_by_name('Feature request')
+ :trackers => Tracker.find_all_by_id([1, 2])
+ )
+ field2 = IssueCustomField.create!(
+ :field_format => 'string',
+ :name => 'Field2',
+ :is_for_all => true,
+ :trackers => Tracker.find_all_by_id(2)
)
Role.non_member.add_permission! :add_issues
@@ -69,20 +75,30 @@ class Redmine::UiTest::IssuesTest < Redmine::UiTest::Base
log_user('someone', 'foo')
visit '/projects/ecookbook/issues/new'
- assert page.has_no_content?('Form update CF')
+ assert page.has_no_content?(field2.name)
+ assert page.has_content?(field1.name)
- fill_in 'Subject', :with => 'new test issue'
- # the custom field should show up when changing tracker
+ fill_in 'Subject', :with => 'New test issue'
+ fill_in 'Description', :with => 'New test issue description'
+ fill_in field1.name, :with => 'CF1 value'
+ select 'Low', :from => 'Priority'
+
+ # field2 should show up when changing tracker
select 'Feature request', :from => 'Tracker'
- assert page.has_content?('Form update CF')
+ assert page.has_content?(field2.name)
+ assert page.has_content?(field1.name)
- fill_in 'Form update', :with => 'CF value'
+ fill_in field2.name, :with => 'CF2 value'
assert_difference 'Issue.count' do
- find('input[name=commit]').click
+ page.first(:button, 'Create').click
end
issue = Issue.order('id desc').first
- assert_equal 'CF value', issue.custom_field_value(field)
+ assert_equal 'New test issue', issue.subject
+ assert_equal 'New test issue description', issue.description
+ assert_equal 'Low', issue.priority.name
+ assert_equal 'CF1 value', issue.custom_field_value(field1)
+ assert_equal 'CF2 value', issue.custom_field_value(field2)
end
def test_create_issue_with_watchers