Skip to content

Instantly share code, notes, and snippets.

@pd
Created July 31, 2009 15:13
Show Gist options
  • Save pd/159262 to your computer and use it in GitHub Desktop.
Save pd/159262 to your computer and use it in GitHub Desktop.
describe 'an ApplicationController spec', :shared => true do
before(:all) do
ActionController::Routing::Routes.draw do |map|
map.resources :foo
map.connect '/access', :controller => 'foo', :action => 'access', :conditions => { :method => :put }
map.login '/login', :controller => 'foo', :action => 'index'
end
end
after(:all) do
eval IO.read(RAILS_ROOT + '/config/routes.rb')
end
end
class FooController < ApplicationController
def index; render :text => 'foo'; end
end
describe ApplicationController do
# ...
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment