Created
November 17, 2010 08:54
-
-
Save kossnocorp/703165 to your computer and use it in GitHub Desktop.
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 characters
... | |
Devise::OmniAuth.test_mode! | |
Before do | |
Devise::OmniAuth.short_circuit_authorizers! | |
Devise::OmniAuth.stub!(:facebook) do |b| | |
b.post('/oauth/access_token') do | |
[200, {}, { :access_token => 'facebook_access_token' }.to_json] | |
end | |
b.get('/me?access_token=facebook_access_token') do | |
[ | |
200, {}, | |
{ | |
:id => '1111111111', | |
:link => 'http://facebook.com/username', | |
:email => '[email protected]', | |
:first_name => 'User', | |
:last_name => 'Name', | |
:website => 'http://relike.com/users/username' | |
}.to_json | |
] | |
end | |
end | |
end | |
After do | |
Devise::OmniAuth.unshort_circuit_authorizers! | |
Devise::OmniAuth.reset_stubs! | |
end | |
... |
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 characters
... | |
gem 'devise', | |
:git => 'https://github.com/plataformatec/devise.git', | |
:branch => 'omniauth' | |
gem 'oa-oauth', :require => 'omniauth/oauth' | |
... | |
group :development, :test do | |
... | |
gem 'cucumber-rails', '0.3.2' | |
gem 'cucumber', '0.9.3' | |
... | |
end |
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 characters
... | |
Scenario: New user click on "Login" and login into relike | |
Given I am on the home page | |
When I follow "Login" | |
Then I should see "Successfully authorized from Facebook account." | |
... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment