Test flash notice in layout view spec (rspec2, rails3)
- by jbpros
Hi!
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!