##// END OF EJS Templates
Make sure that fields filled before tracker change are preserved....
Jean-Philippe Lang -
r11180:9dd8988638cf
parent child
Show More
@@ -57,11 +57,17 class Redmine::UiTest::IssuesTest < Redmine::UiTest::Base
57 57 end
58 58
59 59 def test_create_issue_with_form_update
60 field = IssueCustomField.create!(
60 field1 = IssueCustomField.create!(
61 61 :field_format => 'string',
62 :name => 'Form update CF',
62 :name => 'Field1',
63 63 :is_for_all => true,
64 :trackers => Tracker.find_all_by_name('Feature request')
64 :trackers => Tracker.find_all_by_id([1, 2])
65 )
66 field2 = IssueCustomField.create!(
67 :field_format => 'string',
68 :name => 'Field2',
69 :is_for_all => true,
70 :trackers => Tracker.find_all_by_id(2)
65 71 )
66 72
67 73 Role.non_member.add_permission! :add_issues
@@ -69,20 +75,30 class Redmine::UiTest::IssuesTest < Redmine::UiTest::Base
69 75
70 76 log_user('someone', 'foo')
71 77 visit '/projects/ecookbook/issues/new'
72 assert page.has_no_content?('Form update CF')
78 assert page.has_no_content?(field2.name)
79 assert page.has_content?(field1.name)
73 80
74 fill_in 'Subject', :with => 'new test issue'
75 # the custom field should show up when changing tracker
81 fill_in 'Subject', :with => 'New test issue'
82 fill_in 'Description', :with => 'New test issue description'
83 fill_in field1.name, :with => 'CF1 value'
84 select 'Low', :from => 'Priority'
85
86 # field2 should show up when changing tracker
76 87 select 'Feature request', :from => 'Tracker'
77 assert page.has_content?('Form update CF')
88 assert page.has_content?(field2.name)
89 assert page.has_content?(field1.name)
78 90
79 fill_in 'Form update', :with => 'CF value'
91 fill_in field2.name, :with => 'CF2 value'
80 92 assert_difference 'Issue.count' do
81 find('input[name=commit]').click
93 page.first(:button, 'Create').click
82 94 end
83 95
84 96 issue = Issue.order('id desc').first
85 assert_equal 'CF value', issue.custom_field_value(field)
97 assert_equal 'New test issue', issue.subject
98 assert_equal 'New test issue description', issue.description
99 assert_equal 'Low', issue.priority.name
100 assert_equal 'CF1 value', issue.custom_field_value(field1)
101 assert_equal 'CF2 value', issue.custom_field_value(field2)
86 102 end
87 103
88 104 def test_create_issue_with_watchers
General Comments 0
You need to be logged in to leave comments. Login now