Created
September 7, 2011 11:48
Revisions
-
nicalpi renamed this gist
Sep 8, 2011 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
nicalpi revised this gist
Sep 7, 2011 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,4 @@ # You can read about this gist at: http://wealsodocookies.com/posts/how-to-test-facebook-login-using-devise-omniauth-rspec-and-capybara def set_omniauth(opts = {}) default = {:provider => :facebook, -
nicalpi revised this gist
Sep 7, 2011 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -37,6 +37,6 @@ def set_invalid_omniauth(opts = {}) }.merge(opts) OmniAuth.config.test_mode = true OmniAuth.config.mock_auth[credentials[:provider]] = credentials[:invalid] end -
nicalpi revised this gist
Sep 7, 2011 . 1 changed file with 4 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,4 @@ background do set_omniauth() click_link_or_button 'Sign up with Facebook' end -
nicalpi revised this gist
Sep 7, 2011 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,6 @@ # You can read about this gist at: def set_omniauth(opts = {}) default = {:provider => :facebook, :uuid => "1234", :facebook => { @@ -30,7 +30,7 @@ def set_omniauth(opts) } end def set_invalid_omniauth(opts = {}) credentials = { :provider => :facebook, :invalid => :invalid_crendentials -
nicalpi revised this gist
Sep 7, 2011 . 1 changed file with 2 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -1,3 +1,5 @@ # You can read about this gist at: def set_omniauth(opts) default = {:provider => :facebook, :uuid => "1234", -
nicalpi created this gist
Sep 7, 2011 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,40 @@ def set_omniauth(opts) default = {:provider => :facebook, :uuid => "1234", :facebook => { :email => "[email protected]", :gender => "Male", :first_name => "foo", :last_name => "bar" } } credentials = default.merge(opts) provider = credentials[:provider] user_hash = credentials[provider] OmniAuth.config.test_mode = true OmniAuth.config.mock_auth[provider] = { 'uid' => credentials[:uuid], "extra" => { "user_hash" => { "email" => user_hash[:email], "first_name" => user_hash[:first_name], "last_name" => user_hash[:last_name], "gender" => user_hash[:gender] } } } end def set_invalid_omniauth(opts) credentials = { :provider => :facebook, :invalid => :invalid_crendentials }.merge(opts) OmniAuth.config.test_mode = true OmniAuth.config.mock_auth[credentials[:provider] = credentials[:invalid] end