assert_template changed behaviour from 3.x to 4.0.x
10 views
Skip to first unread message
Jarl Friis
unread,
Feb 21, 2014, 5:36:02 AM2/21/14
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to rubyonrails-talk
Hi.
I have a situation where the user is POSTing to the controller and the
controller will
1) send an email using a view template
2) respond xml over HTTP response without using a view template
The test contains a line with
assert_template ''
which verifies that no template is used for HTTP response as it simple
responds the object serialized as XML.
In 3.x this worked fine, but in 4.0.x the functionality (the
controller behaviour) still seems to work fine, that is it
1) send an email using a view template
2) respond xml over HTTP response without using a view template
but the test fails since the `assert_template ''` fails with a text like:
expecting <""> but rendering with <["notifier/my_email_view"]>
The notifier/my_email_view is the view I am using to send emails with.
So the assert_template catches the view used to send email and I am
trying to assert that no view is used to respond HTML. How can I
achieve that?