Created
January 23, 2013 02:05
-
-
Save jstirk/4601203 to your computer and use it in GitHub Desktop.
Put these in spec/support/ , but not example_request_spec.rb
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
module AuthenticationHelpers | |
def log_in_as(model) | |
login_as(model) | |
end | |
end | |
RSpec.configure do |config| | |
config.include AuthenticationHelpers, :type => :request | |
config.include Devise::TestHelpers, :type => :controller | |
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
describe "My Account" do | |
context "as a logged in User" do | |
before(:each) do | |
log_in_as(user) | |
end | |
end | |
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
RSpec.configure do |config| | |
config.include Warden::Test::Helpers, :type => :request | |
config.before :each, :type => :request do | |
Warden.test_mode! | |
end | |
config.after :each, :type => :request do | |
Warden.test_reset! | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment