@@ -133,65 +133,65 class IssuesHelperTest < ActionView::TestCase | |||||
133 | end |
|
133 | end | |
134 |
|
134 | |||
135 | should "show old and new values with a project attribute" do |
|
135 | should "show old and new values with a project attribute" do | |
136 |
detail = JournalDetail. |
|
136 | detail = JournalDetail.new(:property => 'attr', :prop_key => 'project_id', :old_value => 1, :value => 2) | |
137 | assert_match 'eCookbook', show_detail(detail, true) |
|
137 | assert_match 'eCookbook', show_detail(detail, true) | |
138 | assert_match 'OnlineStore', show_detail(detail, true) |
|
138 | assert_match 'OnlineStore', show_detail(detail, true) | |
139 | end |
|
139 | end | |
140 |
|
140 | |||
141 | should "show old and new values with a issue status attribute" do |
|
141 | should "show old and new values with a issue status attribute" do | |
142 |
detail = JournalDetail. |
|
142 | detail = JournalDetail.new(:property => 'attr', :prop_key => 'status_id', :old_value => 1, :value => 2) | |
143 | assert_match 'New', show_detail(detail, true) |
|
143 | assert_match 'New', show_detail(detail, true) | |
144 | assert_match 'Assigned', show_detail(detail, true) |
|
144 | assert_match 'Assigned', show_detail(detail, true) | |
145 | end |
|
145 | end | |
146 |
|
146 | |||
147 | should "show old and new values with a tracker attribute" do |
|
147 | should "show old and new values with a tracker attribute" do | |
148 |
detail = JournalDetail. |
|
148 | detail = JournalDetail.new(:property => 'attr', :prop_key => 'tracker_id', :old_value => 1, :value => 2) | |
149 | assert_match 'Bug', show_detail(detail, true) |
|
149 | assert_match 'Bug', show_detail(detail, true) | |
150 | assert_match 'Feature request', show_detail(detail, true) |
|
150 | assert_match 'Feature request', show_detail(detail, true) | |
151 | end |
|
151 | end | |
152 |
|
152 | |||
153 | should "show old and new values with a assigned to attribute" do |
|
153 | should "show old and new values with a assigned to attribute" do | |
154 |
detail = JournalDetail. |
|
154 | detail = JournalDetail.new(:property => 'attr', :prop_key => 'assigned_to_id', :old_value => 1, :value => 2) | |
155 | assert_match 'redMine Admin', show_detail(detail, true) |
|
155 | assert_match 'redMine Admin', show_detail(detail, true) | |
156 | assert_match 'John Smith', show_detail(detail, true) |
|
156 | assert_match 'John Smith', show_detail(detail, true) | |
157 | end |
|
157 | end | |
158 |
|
158 | |||
159 | should "show old and new values with a priority attribute" do |
|
159 | should "show old and new values with a priority attribute" do | |
160 |
detail = JournalDetail. |
|
160 | detail = JournalDetail.new(:property => 'attr', :prop_key => 'priority_id', :old_value => 4, :value => 5) | |
161 | assert_match 'Low', show_detail(detail, true) |
|
161 | assert_match 'Low', show_detail(detail, true) | |
162 | assert_match 'Normal', show_detail(detail, true) |
|
162 | assert_match 'Normal', show_detail(detail, true) | |
163 | end |
|
163 | end | |
164 |
|
164 | |||
165 | should "show old and new values with a category attribute" do |
|
165 | should "show old and new values with a category attribute" do | |
166 |
detail = JournalDetail. |
|
166 | detail = JournalDetail.new(:property => 'attr', :prop_key => 'category_id', :old_value => 1, :value => 2) | |
167 | assert_match 'Printing', show_detail(detail, true) |
|
167 | assert_match 'Printing', show_detail(detail, true) | |
168 | assert_match 'Recipes', show_detail(detail, true) |
|
168 | assert_match 'Recipes', show_detail(detail, true) | |
169 | end |
|
169 | end | |
170 |
|
170 | |||
171 | should "show old and new values with a fixed version attribute" do |
|
171 | should "show old and new values with a fixed version attribute" do | |
172 |
detail = JournalDetail. |
|
172 | detail = JournalDetail.new(:property => 'attr', :prop_key => 'fixed_version_id', :old_value => 1, :value => 2) | |
173 | assert_match '0.1', show_detail(detail, true) |
|
173 | assert_match '0.1', show_detail(detail, true) | |
174 | assert_match '1.0', show_detail(detail, true) |
|
174 | assert_match '1.0', show_detail(detail, true) | |
175 | end |
|
175 | end | |
176 |
|
176 | |||
177 | should "show old and new values with a estimated hours attribute" do |
|
177 | should "show old and new values with a estimated hours attribute" do | |
178 |
detail = JournalDetail. |
|
178 | detail = JournalDetail.new(:property => 'attr', :prop_key => 'estimated_hours', :old_value => '5', :value => '6.3') | |
179 | assert_match '5.00', show_detail(detail, true) |
|
179 | assert_match '5.00', show_detail(detail, true) | |
180 | assert_match '6.30', show_detail(detail, true) |
|
180 | assert_match '6.30', show_detail(detail, true) | |
181 | end |
|
181 | end | |
182 |
|
182 | |||
183 | should "show old and new values with a custom field" do |
|
183 | should "show old and new values with a custom field" do | |
184 |
detail = JournalDetail. |
|
184 | detail = JournalDetail.new(:property => 'cf', :prop_key => '1', :old_value => 'MySQL', :value => 'PostgreSQL') | |
185 | assert_equal 'Database changed from MySQL to PostgreSQL', show_detail(detail, true) |
|
185 | assert_equal 'Database changed from MySQL to PostgreSQL', show_detail(detail, true) | |
186 | end |
|
186 | end | |
187 |
|
187 | |||
188 | should "show added file" do |
|
188 | should "show added file" do | |
189 |
detail = JournalDetail. |
|
189 | detail = JournalDetail.new(:property => 'attachment', :prop_key => '1', :old_value => nil, :value => 'error281.txt') | |
190 | assert_match 'error281.txt', show_detail(detail, true) |
|
190 | assert_match 'error281.txt', show_detail(detail, true) | |
191 | end |
|
191 | end | |
192 |
|
192 | |||
193 | should "show removed file" do |
|
193 | should "show removed file" do | |
194 |
detail = JournalDetail. |
|
194 | detail = JournalDetail.new(:property => 'attachment', :prop_key => '1', :old_value => 'error281.txt', :value => nil) | |
195 | assert_match 'error281.txt', show_detail(detail, true) |
|
195 | assert_match 'error281.txt', show_detail(detail, true) | |
196 | end |
|
196 | end | |
197 | end |
|
197 | end |
General Comments 0
You need to be logged in to leave comments.
Login now