Just a little frustration moment here and hoping someone can explain to
what is going on.
I had a passing view spec using >= rspec-rails2. Then after updating to
2.1.0-2.2.1 it always fails. Thinking I was crazy I built the example in
rspec book, and I get the same thing. Here is the full source:
If I switch out the message.stub(:title => “the title”) in “it ‘renders
text field for the message title’ do” with assign(:message,
mock_model(“Message”,:title => “the title”).as_new_record), everything
passes. Why does the stub not work anymore?
Using the stub gives this:
- messages/new.html.erb renders a text field for the message title
Failure/Error: form.should have_selector(“input”,
expected following output to contain a tag:<form accept-charset="UTF-8" action="/messages" class="new_message"
which must be why the test fails. Is this an intentional change on how
or assign works?