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:
Graham Kaplan
2014-04-05 19:18:57 -07:00
parent a6da30dc08
commit 230295790b
17 changed files with 112 additions and 12 deletions
+3
View File
@@ -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
+8
View File
@@ -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