Hello David Thanks for that. Doesn't assign have 2 arguments with the first being the variable to be assigned to and the second being the contents? On Aug 3, 2011 7:01 PM, "ct9a" <anexi...@gmail.com> wrote: > 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 > rspec-users@rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users > > -- > You received this message because you are subscribed to the Google Groups "rspec" group. > To post to this group, send email to rs...@googlegroups.com. > To unsubscribe from this group, send email to rspec+unsubscr...@googlegroups.com. > For more options, visit this group at http://groups.google.com/group/rspec?hl=en. >
_______________________________________________ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users