Created
November 6, 2009 02:35
-
-
Save ryanbriones/227629 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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