I'm very new to RoR and am receiving the following error on rspec spec/

1) Layouts GET /layouts works! (now write some real specs)
Failure/Error: get layouts_path
NameError:
undefined local variable or method `layouts_path' for
#<RSpec::Core::ExampleGroup::Nested_5::Nested_1:0x007f8adc382020>
# ./spec/requests/layouts_spec.rb:7:in `block (3 levels) in <top
(required)>'

My layouts_spec.rb looks like the following:

require 'spec_helper'

describe "Layouts" do
describe "GET /layouts" do
it "works! (now write some real specs)" do
# Run the generator again with the --webrat flag if you want to
use webrat methods/matchers
get layouts_path
response.status.should be(200)
end
end
end


Does anyone have an idea of the problem? Thanks in advance for any
replies. Cheers.

--
Posted via http://www.ruby-forum.com/.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Search Discussions

  • Drew Davis at Oct 19, 2012 at 5:44 pm
    Thanks!

    rake routes output:

    users_new GET /users/new(.:format) users#new
    signup /signup(.:format) users#new
    contact /contact(.:format) pages#contact
    about /about(.:format) pages#about
    help /help(.:format) pages#help
    root / pages#home
    pages_home GET /pages/home(.:format) pages#home
    pages_about GET /pages/about(.:format) pages#about
    pages_contact GET /pages/contact(.:format) pages#contact
    pages_help GET /pages/help(.:format) pages#help

    I'm running through a tutorial and I'm not sure I have defined the
    layouts path yet.

    Where should I define the layouts path?

    Thanks again.

    --
    Posted via http://www.ruby-forum.com/.

    --
    You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
    To post to this group, send email to rubyonrails-talk@googlegroups.com.
    To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Timster at Oct 19, 2012 at 7:43 pm
    You would need to specify this in your routes.rb file. If you post a link
    to the tutorial you are using, we can help you figure out where in the
    tutorial it has you defining that path.

    --
    You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
    To post to this group, send email to rubyonrails-talk@googlegroups.com.
    To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
    To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/_VObflKhDu8J.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Timster at Oct 19, 2012 at 6:39 pm
    What is the output of "rake routes" when you run it from a command line?
    Have you actually defined a layouts path?

    --
    You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
    To post to this group, send email to rubyonrails-talk@googlegroups.com.
    To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
    To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/6zleJ94CDZwJ.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Drew Davis at Oct 19, 2012 at 7:53 pm
    I have the book and here's the link:

    http://ruby.railstutorial.org/ruby-on-rails-tutorial-book

    Thanks

    --
    Posted via http://www.ruby-forum.com/.

    --
    You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
    To post to this group, send email to rubyonrails-talk@googlegroups.com.
    To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Colin Law at Oct 19, 2012 at 7:53 pm

    On 19 October 2012 19:02, Drew Davis wrote:
    I have the book and here's the link:

    http://ruby.railstutorial.org/ruby-on-rails-tutorial-book
    To save us searching, which section are you on?

    Colin

    --
    You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
    To post to this group, send email to rubyonrails-talk@googlegroups.com.
    To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Drew Davis at Oct 22, 2012 at 1:13 pm

    Colin Law wrote in post #1080478:
    On 19 October 2012 19:02, Drew Davis wrote:
    I have the book and here's the link:

    http://ruby.railstutorial.org/ruby-on-rails-tutorial-book
    To save us searching, which section are you on?

    Colin

    This is actually a slightly different version of the tutorial. I'm on
    section 5.3 Layout links and the user sign up page.

    Thanks - Drew

    --
    Posted via http://www.ruby-forum.com/.

    --
    You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
    To post to this group, send email to rubyonrails-talk@googlegroups.com.
    To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Colin Law at Oct 22, 2012 at 1:59 pm

    On 22 October 2012 14:12, Drew Davis wrote:
    Colin Law wrote in post #1080478:
    On 19 October 2012 19:02, Drew Davis wrote:
    I have the book and here's the link:

    http://ruby.railstutorial.org/ruby-on-rails-tutorial-book
    To save us searching, which section are you on?

    Colin

    This is actually a slightly different version of the tutorial. I'm on
    section 5.3 Layout links and the user sign up page.
    I can't see any reference to your test layouts_spec.rb in that
    section, http://ruby.railstutorial.org/chapters/filling-in-the-layout#sec-layout_links

    Colin

    --
    You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
    To post to this group, send email to rubyonrails-talk@googlegroups.com.
    To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Drew Davis at Oct 22, 2012 at 3:03 pm

    Colin Law wrote in post #1080669:
    On 22 October 2012 14:12, Drew Davis wrote:

    This is actually a slightly different version of the tutorial. I'm on
    section 5.3 Layout links and the user sign up page.
    I can't see any reference to your test layouts_spec.rb in that
    section,
    http://ruby.railstutorial.org/chapters/filling-in-the-layout#sec-layout_links

    Colin
    I'm having a hard time finding the Ruby on Rails 3 Tutorial online. Is
    there a different avenue of trouble shooting for this error? The local
    variable in layouts_spec.rb is layouts_path and I've looked back through
    the book for the layouts_spec.rb file but have found nothing.

    Should I just remove this file or move it to a different location?

    Is this a necessary file? I removed it and the page still functions and
    the tests pass.

    I'm just curious where the file came from because I assume it was auto
    generated and if removing it will be a problem or cause errors later on
    down the line?

    Thanks, Drew

    --
    Posted via http://www.ruby-forum.com/.

    --
    You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
    To post to this group, send email to rubyonrails-talk@googlegroups.com.
    To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Colin Law at Oct 22, 2012 at 4:01 pm

    On 22 October 2012 15:56, Drew Davis wrote:
    Colin Law wrote in post #1080669:
    On 22 October 2012 14:12, Drew Davis wrote:

    This is actually a slightly different version of the tutorial. I'm on
    section 5.3 Layout links and the user sign up page.
    I can't see any reference to your test layouts_spec.rb in that
    section,
    http://ruby.railstutorial.org/chapters/filling-in-the-layout#sec-layout_links

    Colin
    I'm having a hard time finding the Ruby on Rails 3 Tutorial online.
    I believe the link I provided is to that tutorial.
    Is
    there a different avenue of trouble shooting for this error? The local
    variable in layouts_spec.rb is layouts_path and I've looked back through
    the book for the layouts_spec.rb file but have found nothing.

    Should I just remove this file or move it to a different location?

    Is this a necessary file? I removed it and the page still functions and
    the tests pass.

    I'm just curious where the file came from because I assume it was auto
    generated and if removing it will be a problem or cause errors later on
    down the line?
    Well I certainly have not idea where it came from. Are you using git
    (or similar) for version control of your code? If not then you should
    be. Then you would know when it was created. The file certainly
    looks like something you do not want since you have no model called
    Layout, and I suspect it would be a bad idea to have one. Just delete
    it and carry on.

    Colin

    --
    You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
    To post to this group, send email to rubyonrails-talk@googlegroups.com.
    To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouprubyonrails-talk @
categoriesrubyonrails
postedOct 19, '12 at 5:33p
activeOct 22, '12 at 4:01p
posts10
users3
websiterubyonrails.org
irc#RubyOnRails

3 users in discussion

Drew Davis: 5 posts Colin Law: 3 posts Timster: 2 posts

People

Translate

site design / logo © 2021 Grokbase