also, i have just read a little more in the rspec book.
here's an extract:
------------- extract start ---------------------
assign()
View specs expose an assign method, which we use to provide data to
the view. Modify the spec as follows:
describe "messages/show.html.erb" do
it "displays the text attribute of the message" do
assign(:message, double("Message", :text => "Hello world!"))
render
rendered.should contain("Hello world!")
end
end
The new first line of the example creates a test double, which stubs
the text( ) method with a return value of “Hello world!” and assigns
it to an @message instance variable on the view.
------------- extract end ---------------------
If :message (in the view spec) can correspond to @message variable (in
the actual show.html.erb view), is this a Rspec convention/thing?
Sorry, Im just trying to find more resources to read up on rspec but
i'm having not much luck. Appreciate your thoughts.
Thank you .
_______________________________________________
rspec-users mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/rspec-users