334 |
334 |
|
335 |
335 |
def test_message_posted_message_id
|
336 |
336 |
message = Message.find(1)
|
|
337 |
attachment = message.attachments.first
|
337 |
338 |
Mailer.deliver_message_posted(message)
|
338 |
339 |
mail = last_email
|
339 |
340 |
uid = destination_user(mail).id
|
... | ... | |
344 |
345 |
assert_select "a[href=?]",
|
345 |
346 |
"http://localhost:3000/boards/#{message.board.id}/topics/#{message.id}",
|
346 |
347 |
:text => message.subject
|
|
348 |
# link to the attachments download
|
|
349 |
assert_select 'fieldset.attachments' do
|
|
350 |
assert_select 'a[href=?]',
|
|
351 |
"http://localhost:3000/attachments/download/#{attachment.id}/#{attachment.filename}",
|
|
352 |
:text => attachment.filename
|
|
353 |
end
|
347 |
354 |
end
|
348 |
355 |
end
|
349 |
356 |
|
350 |
357 |
def test_reply_posted_message_id
|
|
358 |
set_tmp_attachments_directory
|
351 |
359 |
message = Message.find(3)
|
|
360 |
attachment = Attachment.generate!(
|
|
361 |
:container => message,
|
|
362 |
:file => uploaded_test_file('testfile.txt', 'text/plain')
|
|
363 |
)
|
352 |
364 |
Mailer.deliver_message_posted(message)
|
353 |
365 |
mail = last_email
|
354 |
366 |
uid = destination_user(mail).id
|
... | ... | |
359 |
371 |
assert_select "a[href=?]",
|
360 |
372 |
"http://localhost:3000/boards/#{message.board.id}/topics/#{message.root.id}?r=#{message.id}#message-#{message.id}",
|
361 |
373 |
:text => message.subject
|
|
374 |
# link to the attachments download
|
|
375 |
assert_select 'fieldset.attachments' do
|
|
376 |
assert_select 'a[href=?]',
|
|
377 |
"http://localhost:3000/attachments/download/#{attachment.id}/testfile.txt",
|
|
378 |
:text => 'testfile.txt'
|
|
379 |
end
|
362 |
380 |
end
|
363 |
381 |
end
|
364 |
382 |
|