I’d like to spec the fact that my application layout view prints out flash notices. However the following code does not run, the flash method does not exist in view specs (as opposed to controller specs where it works perfectly):
describe 'layouts/application' do
it "renders flash notices" do
flash[:notice] = "This is a notice!"
render
response.should contain "This is a notice!"
end
end
Is my code wrong or is it a “not-yet-implemented feature” in Rspec 2? I’m on Rails3 and Rspec2 from its master branch on Git.
Thanks!
Funny, I was just searching here on the flash issue because my authentication cucumber stories in Rails 3 beta 3 and RSpec 2 appear to be broken where they are hitting the flash notices.
So, I think you’re right. There is either some new trick in using flash notices in Rails3 with RSpec2 or RSpec2 has not implemented this.
Very problematic if you’re trying to port Cucumber stories over to Rails3 right now.