I have this RSpec test – it passes correctly:
it "should have the right title" do
page.should { have_selector('title',
:text => "#{base_title}") }
end
I am trying to re-write the same piece of code like this:
it { should have_selector('title',
:text => "#{base_title}") }
but the shorter code fails.
Why?
The answer is that I forgot to add before that statement: