Skip to content

Instantly share code, notes, and snippets.

@yohfee
Created February 23, 2011 05:32
Show Gist options
  • Select an option

  • Save yohfee/840064 to your computer and use it in GitHub Desktop.

Select an option

Save yohfee/840064 to your computer and use it in GitHub Desktop.
#spec/routing/pages_routing_spec.rb
require 'spec_helper'
describe 'routes to the pages controller' do
describe 'GET root_path' do
subject { {:get => root_path} }
it { should be_routable }
it { should route_to :controller => 'pages', :action => 'home' }
end
describe 'GET service_path' do
subject { {:get => service_path} }
it { should be_routable }
it { should route_to :controller => 'pages', :action => 'service' }
end
end
#config/routes.rb
Hoge::Application.routes.draw do
root :to => 'pages/home'
match 'pages/service' => 'pages#service', :as => :service
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment