-
Notifications
You must be signed in to change notification settings - Fork 281
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixes invalid mapping in shared/social partial #215
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
FactoryBot.define do | ||
factory :authentication_method, class: Spree::AuthenticationMethod do | ||
provider 'facebook' | ||
api_key 'fake' | ||
api_secret 'fake' | ||
environment { Rails.env } | ||
active true | ||
end | ||
end |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
FactoryBot.define do | ||
factory :user_authentication, class: Spree::UserAuthentication do | ||
provider 'facebook' | ||
uid 'fake' | ||
end | ||
end |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
RSpec.feature 'account page visit', :js do | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Block has too many lines. [26/25] |
||
let(:user) { create(:user) } | ||
|
||
before do | ||
login_as(user, scope: :spree_user) | ||
end | ||
|
||
context 'with existing active authentication methods' do | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping. |
||
let!(:authentication_method) { create(:authentication_method) } | ||
|
||
before do | ||
visit '/account' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping. |
||
end | ||
|
||
it 'shows possible methods to connect' do | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping. |
||
expect(page).to have_link(title: Spree.t(:sign_in_with, provider: authentication_method.provider)) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Line is too long. [104/80] |
||
end | ||
|
||
context 'when authentication method was used' do | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping. |
||
before do | ||
create(:user_authentication, provider: authentication_method.provider, user: user) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Line is too long. [90/80] |
||
visit '/account' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping. |
||
end | ||
|
||
it 'does not show used method' do | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping. |
||
expect(page).not_to have_link(title: Spree.t(:sign_in_with, provider: authentication_method.provider)) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Line is too long. [110/80] |
||
end | ||
|
||
it 'shows method as connected' do | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping. |
||
expect(page).to have_text('You Have Signed In With These Services') | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping. |
||
expect(page).to have_text(authentication_method.provider) | ||
end | ||
end | ||
end | ||
end |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,8 @@ | ||
RSpec.feature 'signing in using Omniauth', :js do | ||
context 'facebook' do | ||
background do | ||
Spree::AuthenticationMethod.create!( | ||
provider: 'facebook', | ||
api_key: 'fake', | ||
api_secret: 'fake', | ||
environment: Rails.env, | ||
active: true) | ||
create(:authentication_method, provider: 'facebook') | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping. |
||
|
||
OmniAuth.config.test_mode = true | ||
OmniAuth.config.mock_auth[:facebook] = { | ||
'provider' => 'facebook', | ||
|
@@ -47,12 +43,8 @@ | |
|
||
context 'twitter' do | ||
background do | ||
Spree::AuthenticationMethod.create!( | ||
provider: 'twitter', | ||
api_key: 'fake', | ||
api_secret: 'fake', | ||
environment: Rails.env, | ||
active: true) | ||
create(:authentication_method, provider: 'twitter') | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping. |
||
|
||
OmniAuth.config.test_mode = true | ||
OmniAuth.config.mock_auth[:twitter] = { | ||
'provider' => 'twitter', | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
RSpec.configure do |config| | ||
config.include Devise::TestHelpers, type: :controller | ||
config.include Devise::Test::ControllerHelpers, type: :controller | ||
end |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
RSpec.configure do |config| | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Missing magic comment # frozen_string_literal: true. |
||
config.include Warden::Test::Helpers, type: :feature | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.