Topic: Authentication signin page

authentication_pages_spec.rb

require 'spec_helper'

describe "Authentication" do

  subject { page }

  describe "signin page" do
    before { visit signin_path }

    it { should have_selector('h1',    text: 'Sign in') }
    it { should have_selector('title', text: 'Sign in') }
  end
end



config/route.rb

MyApp::Application.routes.draw do
  #get "users/new"
resources :users
resources :sessions, only: [:new, :create, :destroy]

  match '/signup',  to: 'users#new'
  match '/signin',  to: 'sessions#new'
  match '/signout', to: 'sessions#destroy', via: :delete

root to: 'static_pages#home'
  # match '/signup',  to: 'users#new'

  match '/help',    to: 'static_pages#help'
  match '/about',   to: 'static_pages#about'
  match '/contact', to: 'static_pages#contact'




session_controller.rb
class SessionsController < ApplicationController

  def new
  end

  def create
  end

  def destroy
  end
end


app/views/sessions/new.html.erb

<% provide(:title, "Sign in") %>
<h1>Sign in</h1>


when i run the test.."bundle exec rspec spec/"..according to the tutorial it should pass..but i am getting this error

1) Authentication signin page
     Failure/Error: before { visit signin_path }
     ActionController::RoutingError:
       uninitialized constant SessionsController
     # ./spec/requests/authentication_pages_spec.rb:8:in `block (3 levels) in <top (required)>'

  2) Authentication signin page
     Failure/Error: before { visit signin_path }
     ActionController::RoutingError:
       uninitialized constant SessionsController
     # ./spec/requests/authentication_pages_spec.rb:8:in `block (3 levels) in <top (required)>'

Finished in 2.54 seconds
37 examples, 2 failures

Failed examples:

rspec ./spec/requests/authentication_pages_spec.rb:10 # Authentication signin page
rspec ./spec/requests/authentication_pages_spec.rb:11 # Authentication signin page

how do i fix it...