34 |
34 |
find('input[name=commit]').click
|
35 |
35 |
end
|
36 |
36 |
|
|
37 |
assert_text /Issue #\d+ created./
|
|
38 |
|
37 |
39 |
# find created issue
|
38 |
40 |
issue = Issue.find_by_subject("new test issue")
|
39 |
41 |
assert_kind_of Issue, issue
|
... | ... | |
86 |
88 |
fill_in field2.name, :with => 'CF2 value'
|
87 |
89 |
assert_difference 'Issue.count' do
|
88 |
90 |
page.first(:button, 'Create').click
|
|
91 |
assert_text /Issue #\d+ created./
|
89 |
92 |
end
|
90 |
93 |
|
91 |
94 |
issue = Issue.order('id desc').first
|
... | ... | |
125 |
128 |
end
|
126 |
129 |
assert_difference 'Issue.count' do
|
127 |
130 |
find('input[name=commit]').click
|
|
131 |
assert_text /Issue #\d+ created./
|
128 |
132 |
end
|
129 |
133 |
|
130 |
134 |
issue = Issue.order('id desc').first
|
... | ... | |
141 |
145 |
attach_file 'attachments[dummy][file]', Rails.root.join('test/fixtures/files/testfile.txt')
|
142 |
146 |
fill_in 'attachments[1][description]', :with => 'Some description'
|
143 |
147 |
click_on 'Create'
|
|
148 |
assert_text /Issue #\d+ created./
|
144 |
149 |
end
|
145 |
150 |
assert_equal 1, issue.attachments.count
|
146 |
151 |
assert_equal 'Some description', issue.attachments.first.description
|
... | ... | |
163 |
168 |
attach_file 'attachments[dummy][file]', Rails.root.join('test/fixtures/files/testfile.txt')
|
164 |
169 |
fill_in 'attachments[1][description]', :with => 'Some description'
|
165 |
170 |
click_on 'Create'
|
|
171 |
assert_text /Issue #\d+ created./
|
166 |
172 |
end
|
167 |
173 |
assert_equal 1, issue.attachments.count
|
168 |
174 |
assert_equal 'Some description', issue.attachments.first.description
|
... | ... | |
181 |
187 |
click_on 'Create'
|
182 |
188 |
end
|
183 |
189 |
click_on 'Create'
|
|
190 |
assert_text /Issue #\d+ created./
|
184 |
191 |
end
|
185 |
192 |
end
|
186 |
193 |
|
... | ... | |
200 |
207 |
end
|
201 |
208 |
assert_difference 'Issue.count' do
|
202 |
209 |
click_button('Create')
|
|
210 |
assert_text /Issue #\d+ created./
|
203 |
211 |
end
|
204 |
212 |
|
205 |
213 |
issue = Issue.order('id desc').first
|
... | ... | |
230 |
238 |
fill_in 'Form update CF', :with => 'CF value'
|
231 |
239 |
assert_no_difference 'Issue.count' do
|
232 |
240 |
page.first(:button, 'Submit').click
|
|
241 |
assert_text 'Successful update.'
|
233 |
242 |
end
|
234 |
243 |
assert page.has_css?('#flash_notice')
|
235 |
244 |
issue = Issue.find(1)
|
... | ... | |
245 |
254 |
page.find("#issue_status_id").select("Closed")
|
246 |
255 |
assert_no_difference 'Issue.count' do
|
247 |
256 |
page.first(:button, 'Submit').click
|
|
257 |
assert_text 'Successful update.'
|
248 |
258 |
end
|
249 |
259 |
assert page.has_css?('#flash_notice')
|
250 |
260 |
assert_equal 5, issue.reload.status.id
|
... | ... | |
267 |
277 |
|
268 |
278 |
click_on 'Submit'
|
269 |
279 |
|
|
280 |
assert_text 'Successful update.'
|
270 |
281 |
assert_equal 3, Issue.find(2).attachments.count
|
271 |
282 |
end
|
272 |
283 |
|