Skip to content

Instantly share code, notes, and snippets.

@ryanbriones
Created November 6, 2009 02:35
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ryanbriones/227629 to your computer and use it in GitHub Desktop.
Save ryanbriones/227629 to your computer and use it in GitHub Desktop.
describe SomeController do
before(:each) do
# exisiting mock setup
end
# add to mocks, placement after before is key
it_should_behave_like "a before filter thingie"
it "blah"
end
shared_examples_for "an action that requires a user" do
before(:each) do
# setup
end
it "should redirect to login path if user is not logged in"
# etc...
end
require File.expand_path('/path/to/authenication_helper')
describe SomeController do
it_should_behave_like "an action that requires a user"
describe "when listing somes" do
it "blah"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment