> assign(:message, stub("Message"))
>
> That should get rid of your deprecation message.
Yeah! But strange deprecation message that it mentions:
* response is deprecated.
* please use rendered instead.
When it should be:
* assigns is deprecated.
* please use assign instead.
Also, how do I use this assigned message
In my show view I have:
<%=h @message.text %>
When I run it now:
assign(:message, stub("Message"))
puts "@message: #[email protected]}"
render
@message: nil <--------- OUCH!!!
F
1) messages/show.html.erb displays the text attribute of the message
Failure/Error: Unable to find matching line from backtrace
Stub "Message" received unexpected message :text with (no args)
@message is nil after using assigns! But inside the view it seems at
least to recognize the stub called "Message"?
Now if I inspect @message in the view instead
<%=h @message.inspect %>
expected the following element's content to include "Hello world!":
#<RSpec::Mocks::Mock:0x81952668 @name="Message">
Now I just need to find out how to extract the text from the Stub
message... ?
_______________________________________________
rspec-users mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/rspec-users