diff --git a/spec/support/user_integration_helpers.rb b/spec/support/user_integration_helpers.rb index d543934..5336be8 100644 --- a/spec/support/user_integration_helpers.rb +++ b/spec/support/user_integration_helpers.rb @@ -6,4 +6,13 @@ module UserIntegrationHelpers fill_in 'Password', :with => user.password click_button('Sign in') end + + def api_sign_in + user = Factory.create :user + + post api_sessions_path, :format => :json, :session => { + :email => user.email, + :password => user.password + } + end end