Add Facebook login with Sorcery
The facebook key and secret defined in the sorcery config file are for testing only and need to be changed and not committed to source when app is ready to go live
This commit is contained in:
@@ -23,6 +23,8 @@ require 'capybara/rspec'
|
||||
|
||||
#Capybara.ignore_hidden_elements = false # testing hidden fields
|
||||
|
||||
include Sorcery::TestHelpers::Rails
|
||||
|
||||
RSpec.configure do |config|
|
||||
# == Mock Framework
|
||||
#
|
||||
@@ -33,6 +35,7 @@ RSpec.configure do |config|
|
||||
# config.mock_with :rr
|
||||
# config.mock_with :rspec
|
||||
|
||||
config.include AuthenticationForFeatureRequest, type: :feature
|
||||
|
||||
# Run specs in random order to surface order dependencies. If you find an
|
||||
# order dependency and want to debug it, you can fix the order by providing
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
module AuthenticationForFeatureRequest
|
||||
def login user, password = 'login'
|
||||
user.update_attribute :password, password
|
||||
|
||||
page.driver.post sessions_url, {email: user.email, password: password}
|
||||
visit root_url
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user