[rspec-users] Problem specing application layout, missing partial?
thecatwasnot at gmail.com
Mon Jul 5 13:21:39 EDT 2010
On Mon, Jul 5, 2010 at 11:16 AM, David Chelimsky <dchelimsky at gmail.com>wrote:
> On Jul 5, 2010, at 9:52 AM, Pixel wrote:
> In an effort to teach myself BDD I'm trying it out. I'm trying to do a
> simple (should be straightforward) spec on my application.html.haml file
> first looking for a div tag with the class 'nav' it seems that rspec isn't
> able to render the app/views/layouts/application.html.haml file.
> Gist with command/error/backtrace:
> Short version:
> Don't pass anything to render() in the spec. It'll do the right thing as
> long as you name the template in the string passed to describe:
> require "spec_helper"
> describe "layouts/application.html.haml" do
> it "displays a navigation area" do
> rendered.should have_selector('div#nav')
Of course it helps when I write out the file name correctly in the describe
line, so that rspec can build the correct call. Woops! Thanks for your
help and patience David, much appreciated.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the rspec-users