views:

17

answers:

0

I generated home and contact page thru:

rails generate Pages home contact

did tests to verify and all was okay, now I wanted to add the page "about". I created the about.html.erb through copying the contact.html.erb and pasting then renaming it to about.html.erb. I then changed the content to "Pages#about" instead of "Pages#contact"

I changed route.rb to:

SampleApp::Application.routes.draw do
  get "pages/home"

  get "pages/contact"

  get "pages/about"

then pages_controller.rb to:

def home
  end

  def contact
  end

  def about
  end

Finally added this to pages_controller_spec.rb:

 describe "GET 'about'" do
    it "should be successful" do
      get 'about'
      response.should be_success
    end
  end

on my autotest this was the error:

Failures:
  1) PagesController GET 'about' should be successful
     Failure/Error: get 'about'
     No route matches {:controller=>"pages", :action=>"about"}
     # ./spec/controllers/pages_controller_spec.rb:22:in `block (3 levels) in <top (required)>'

What did I do wrong?

Should I have generated the about page through:

rails generate Pages about

to generate the about page? instead of copy-paste?