title: rails route--undefined method
body: <p>I have a model called "newbie". The routes.rb file looks like:</p>
  
  <pre><code>  Myapp::Application.routes.draw do
    resources :newbies
  
    root to: 'static_pages#home'
    match '/about',   to: 'static_pages#about'
  </code></pre>
  
  <p>controller is like:</p>
  
  <pre><code>  class NewbiesController &lt; ApplicationController
  
      def show
        @newbie = Newbie.find(params[:id])
      end
      ......
    end
  </code></pre>
  
  <p>When I write tests:</p>
  
  <pre><code>require 'spec_helper'
  
  describe "Newbie pages" do
    subject { page }
    describe "profile page" do
      let(:newbie) { FactoryGirl.create(:newbie) }
      before { visit newbie_path(newbie)}
  
      it { should have_selector('h1',    text: newbie.name) }
      it { should have_selector('title', text: newbie.name) }
    end
  end
  </code></pre>
  
  <p>It always fails says:</p>
  
  <pre><code> 1) Newbie pages profile page 
   Failure/Error: before { visit newbie_path(newbie)}
   NoMethodError:
     undefined method `newbie_path' for #       &lt;RSpec::Core::ExampleGroup::Nested_2::Nested_2:0x007f97f7f33068&gt;
   # ./spec/requests/newbie_pages_spec.rb:16:in `block (3 levels) in &lt;top (required)&gt;'
  
   2) Newbie pages profile page 
   Failure/Error: before { visit newbie_path(newbie)}
   NoMethodError:undefined method `newbie_path' for 
  </code></pre>
  
  <h1></h1>
  
  <p>I think resources:newbies will create helper methods like newbie_path, but why it says undefined method?</p>
  
  <p>Thanks</p>