[rspec-users] Problem specing application layout, missing partial?

Pixel thecatwasnot at gmail.com
Mon Jul 5 10:52:18 EDT 2010


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:
http://gist.github.com/463978#file_gistfile1.txt

$ rspec spec/views/layouts/application.html.haml_spec.rb -b
F

1) layouts/application.haml.html displays a navigation area
    Failure/Error: render "layouts/application.html.haml"
    Missing partial layouts/application.html with {:handlers=>[:erb,
:rjs, :builder, :rhtml, :rxml, :haml], :formats=>[:html, :text, :js,
:css, :ics, :csv, :xml, :rss, :atom, :yaml, :multipart_form,
:url_encoded_form, :json], :locale=>[:en, :en]} in view paths
"/home/pixel/Development/code/achieveit.git/app/views",
"/home/pixel/Development/code/achieveit.git/vendor/plugins/haml/app/views"
    # /home/pixel/.rvm/gems/ruby-1.9.2-head at rails3/gems/actionpack-3.0.0.beta4/lib/action_view/paths.rb:14:in
`find'
    # /home/pixel/.rvm/gems/ruby-1.9.2-head at rails3/gems/actionpack-3.0.0.beta4/lib/action_view/lookup_context.rb:79:in
`find'
    # /home/pixel/.rvm/gems/ruby-1.9.2-head at rails3/gems/actionpack-3.0.0.beta4/lib/action_view/base.rb:186:in
`find_template'
    # /home/pixel/.rvm/gems/ruby-1.9.2-head at rails3/gems/actionpack-3.0.0.beta4/lib/action_view/render/partials.rb:310:in
`find_template'
    # /home/pixel/.rvm/gems/ruby-1.9.2-head at rails3/gems/actionpack-3.0.0.beta4/lib/action_view/render/partials.rb:211:in
`render'
    # /home/pixel/.rvm/gems/ruby-1.9.2-head at rails3/gems/actionpack-3.0.0.beta4/lib/action_view/render/partials.rb:332:in
`_render_partial'
    # /home/pixel/.rvm/gems/ruby-1.9.2-head at rails3/gems/actionpack-3.0.0.beta4/lib/action_view/render/rendering.rb:30:in
`render'
    # /home/pixel/.rvm/gems/ruby-1.9.2-head at rails3/gems/haml-3.0.13/lib/haml/helpers/action_view_mods.rb:13:in
`render_with_haml'
    # /home/pixel/.rvm/gems/ruby-1.9.2-head at rails3/gems/actionpack-3.0.0.beta4/lib/action_view/test_case.rb:100:in
`render'
    # /home/pixel/.rvm/gems/ruby-1.9.2-head at rails3/gems/rspec-rails-2.0.0.beta.15/lib/rspec/rails/example/view_example_group.rb:58:in
`render'
    # ./spec/views/layouts/application.html.haml_spec.rb:5:in `block
(2 levels) in <top (required)>'
    # /home/pixel/.rvm/gems/ruby-1.9.2-head at rails3/gems/rspec-core-2.0.0.beta.15/lib/rspec/core/example.rb:76:in
`instance_eval'
    # /home/pixel/.rvm/gems/ruby-1.9.2-head at rails3/gems/rspec-core-2.0.0.beta.15/lib/rspec/core/example.rb:76:in
`block in with_pending_capture'
    # /home/pixel/.rvm/gems/ruby-1.9.2-head at rails3/gems/rspec-core-2.0.0.beta.15/lib/rspec/core/example.rb:75:in
`catch'
    # /home/pixel/.rvm/gems/ruby-1.9.2-head at rails3/gems/rspec-core-2.0.0.beta.15/lib/rspec/core/example.rb:75:in
`with_pending_capture'
    # /home/pixel/.rvm/gems/ruby-1.9.2-head at rails3/gems/rspec-core-2.0.0.beta.15/lib/rspec/core/example.rb:50:in
`block in run'
    # /home/pixel/.rvm/gems/ruby-1.9.2-head at rails3/gems/rspec-core-2.0.0.beta.15/lib/rspec/core/example.rb:46:in
`call'
    # /home/pixel/.rvm/gems/ruby-1.9.2-head at rails3/gems/rspec-core-2.0.0.beta.15/lib/rspec/core/example.rb:46:in
`run'
    # /home/pixel/.rvm/gems/ruby-1.9.2-head at rails3/gems/rspec-core-2.0.0.beta.15/lib/rspec/core/example_group.rb:186:in
`block in run_examples'
    # /home/pixel/.rvm/gems/ruby-1.9.2-head at rails3/gems/rspec-core-2.0.0.beta.15/lib/rspec/core/example_group.rb:183:in
`map'
    # /home/pixel/.rvm/gems/ruby-1.9.2-head at rails3/gems/rspec-core-2.0.0.beta.15/lib/rspec/core/example_group.rb:183:in
`run_examples'
    # /home/pixel/.rvm/gems/ruby-1.9.2-head at rails3/gems/rspec-core-2.0.0.beta.15/lib/rspec/core/example_group.rb:174:in
`run'
    # /home/pixel/.rvm/gems/ruby-1.9.2-head at rails3/gems/rspec-core-2.0.0.beta.15/lib/rspec/core/command_line.rb:41:in
`block in run_examples'
    # /home/pixel/.rvm/gems/ruby-1.9.2-head at rails3/gems/rspec-core-2.0.0.beta.15/lib/rspec/core/command_line.rb:41:in
`each'
    # /home/pixel/.rvm/gems/ruby-1.9.2-head at rails3/gems/rspec-core-2.0.0.beta.15/lib/rspec/core/command_line.rb:41:in
`inject'
    # /home/pixel/.rvm/gems/ruby-1.9.2-head at rails3/gems/rspec-core-2.0.0.beta.15/lib/rspec/core/command_line.rb:41:in
`run_examples'
    # /home/pixel/.rvm/gems/ruby-1.9.2-head at rails3/gems/rspec-core-2.0.0.beta.15/lib/rspec/core/command_line.rb:24:in
`block in run'
    # /home/pixel/.rvm/gems/ruby-1.9.2-head at rails3/gems/rspec-core-2.0.0.beta.15/lib/rspec/core/formatters/base_formatter.rb:37:in
`block in report'
    # /home/pixel/.rvm/gems/ruby-1.9.2-head at rails3/gems/rspec-core-2.0.0.beta.15/lib/rspec/core/formatters/base_formatter.rb:152:in
`sync_output'
    # /home/pixel/.rvm/gems/ruby-1.9.2-head at rails3/gems/rspec-core-2.0.0.beta.15/lib/rspec/core/formatters/base_formatter.rb:34:in
`report'
    # /home/pixel/.rvm/gems/ruby-1.9.2-head at rails3/gems/rspec-core-2.0.0.beta.15/lib/rspec/core/command_line.rb:21:in
`run'
    # /home/pixel/.rvm/gems/ruby-1.9.2-head at rails3/gems/rspec-core-2.0.0.beta.15/lib/rspec/core/runner.rb:46:in
`run_in_process'
    # /home/pixel/.rvm/gems/ruby-1.9.2-head at rails3/gems/rspec-core-2.0.0.beta.15/lib/rspec/core/runner.rb:37:in
`run'
    # /home/pixel/.rvm/gems/ruby-1.9.2-head at rails3/gems/rspec-core-2.0.0.beta.15/lib/rspec/core/runner.rb:22:in
`block in autorun'


Finished in 0.28094 seconds
1 example, 1 failure

Spec file: http://gist.github.com/463978#file_application.html.haml_spec.rb
File under spec: http://gist.github.com/463978#file_application.html.haml
Gem list: http://gist.github.com/463978#file_gistfile4.txt

The problem may be something simple but several hours of googling haven't
helped and I'm at a loss.

-Cole
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://rubyforge.org/pipermail/rspec-users/attachments/20100705/a50bc0e4/attachment.html>


More information about the rspec-users mailing list