solidus_social 1.2.0 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +5 -5
- data/.circleci/config.yml +35 -0
- data/.gem_release.yml +5 -0
- data/.github/stale.yml +17 -0
- data/.gitignore +6 -8
- data/.rspec +3 -3
- data/.rubocop.yml +3 -149
- data/.rubocop_todo.yml +42 -0
- data/CHANGELOG.md +31 -9
- data/Gemfile +21 -20
- data/{LICENSE.md → LICENSE} +2 -2
- data/README.md +56 -14
- data/Rakefile +4 -19
- data/app/controllers/spree/admin/authentication_methods_controller.rb +2 -0
- data/app/controllers/spree/omniauth_callbacks_controller.rb +8 -6
- data/app/controllers/spree/user_authentications_controller.rb +3 -1
- data/app/decorators/controllers/solidus_social/spree/user_registrations_controller_decorator.rb +27 -0
- data/app/decorators/models/solidus_social/spree/user_decorator.rb +28 -0
- data/app/helpers/spree/omniauth_callbacks_helper.rb +2 -0
- data/app/models/spree/authentication_method.rb +3 -1
- data/app/models/spree/social_configuration.rb +2 -0
- data/app/models/spree/user_authentication.rb +3 -1
- data/app/overrides/add_authentications_to_account_summary.rb +2 -0
- data/app/overrides/admin_configuration_decorator.rb +3 -1
- data/app/overrides/user_registrations_decorator.rb +2 -0
- data/app/views/spree/admin/authentication_methods/_form.html.erb +4 -4
- data/app/views/spree/admin/authentication_methods/edit.html.erb +2 -2
- data/app/views/spree/admin/authentication_methods/index.html.erb +10 -10
- data/app/views/spree/admin/authentication_methods/new.html.erb +2 -2
- data/app/views/spree/shared/_social.html.erb +5 -5
- data/app/views/spree/shared/_user_form.html.erb +3 -3
- data/app/views/spree/users/_new-customer.html.erb +2 -2
- data/app/views/spree/users/_social.html.erb +5 -5
- data/bin/console +17 -0
- data/bin/rails +15 -4
- data/bin/rake +7 -0
- data/bin/sandbox +72 -0
- data/bin/setup +8 -0
- data/config/locales/en.yml +1 -0
- data/config/routes.rb +6 -4
- data/db/migrate/20120120163432_create_user_authentications.rb +2 -0
- data/db/migrate/20120123163222_create_authentication_methods.rb +2 -0
- data/lib/generators/solidus_social/install/install_generator.rb +7 -5
- data/lib/generators/solidus_social/install/templates/config/initializers/solidus_social.rb +3 -1
- data/lib/solidus_social.rb +22 -7
- data/lib/solidus_social/engine.rb +29 -54
- data/lib/solidus_social/facebook_omniauth_strategy_ext.rb +25 -0
- data/lib/solidus_social/factories.rb +4 -0
- data/lib/solidus_social/version.rb +3 -16
- data/solidus_social.gemspec +43 -46
- data/spec/controllers/spree/omniauth_callbacks_controller_spec.rb +14 -9
- data/spec/features/spree/admin/authentication_methods_configuration_spec.rb +13 -10
- data/spec/features/spree/sign_in_spec.rb +13 -10
- data/spec/lib/solidus_social/engine_spec.rb +9 -0
- data/spec/lib/{spree_social/engine_spec.rb → solidus_social_speec.rb} +3 -1
- data/spec/lib/spree/social_config_spec.rb +2 -0
- data/spec/models/spree/authentication_method_spec.rb +4 -2
- data/spec/models/spree/social_configuration_spec.rb +2 -0
- data/spec/models/spree/user_decorator_spec.rb +5 -3
- data/spec/spec_helper.rb +17 -29
- data/spec/support/omniauth.rb +4 -0
- metadata +56 -196
- data/.hound.yml +0 -26
- data/.travis.yml +0 -32
- data/app/assets/javascripts/spree/backend/solidus_social.js +0 -1
- data/app/assets/javascripts/spree/frontend/solidus_social.js +0 -1
- data/app/assets/stylesheets/spree/backend/solidus_social.css +0 -3
- data/app/controllers/spree/user_registrations_controller_decorator.rb +0 -15
- data/app/models/spree/user_decorator.rb +0 -16
- data/spec/support/capybara.rb +0 -11
- data/spec/support/database_cleaner.rb +0 -23
- data/spec/support/devise.rb +0 -3
- data/spec/support/factory_girl.rb +0 -7
- data/spec/support/spree.rb +0 -8
data/bin/setup
ADDED
data/config/locales/en.yml
CHANGED
@@ -10,6 +10,7 @@ en:
|
|
10
10
|
destroy: 'Successfully destroyed authentication method.'
|
11
11
|
back_to_authentication_methods_list: "Back To Authentication Methods List"
|
12
12
|
edit_social_method: "Editing Social Authentication Method"
|
13
|
+
environment: "Environment"
|
13
14
|
new_social_method: "New Authentication Method"
|
14
15
|
no_authentication_methods_found: "No Authentication Methods Found"
|
15
16
|
one_more_step: 'One more step to complete your registration from %{kind}'
|
data/config/routes.rb
CHANGED
@@ -1,9 +1,11 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
Spree::Core::Engine.routes.draw do
|
2
4
|
devise_for :spree_user,
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
5
|
+
class_name: Spree.user_class,
|
6
|
+
only: [:omniauth_callbacks],
|
7
|
+
controllers: { omniauth_callbacks: 'spree/omniauth_callbacks' },
|
8
|
+
path: Spree::SocialConfig[:path_prefix]
|
7
9
|
resources :user_authentications
|
8
10
|
|
9
11
|
get 'account' => 'users#show', as: 'user_root'
|
@@ -1,16 +1,18 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module SolidusSocial
|
2
4
|
module Generators
|
3
5
|
class InstallGenerator < Rails::Generators::Base
|
4
|
-
source_root
|
6
|
+
source_root "#{__dir__}/templates"
|
5
7
|
|
6
8
|
class_option :auto_run_migrations, type: :boolean, default: false
|
7
9
|
|
8
10
|
def add_stylesheets
|
9
|
-
inject_into_file 'vendor/assets/stylesheets/spree/frontend/all.css', " *= require spree/frontend/solidus_social\n", before: %r
|
11
|
+
inject_into_file 'vendor/assets/stylesheets/spree/frontend/all.css', " *= require spree/frontend/solidus_social\n", before: %r{\*/}, verbose: true
|
10
12
|
end
|
11
13
|
|
12
14
|
def add_migrations
|
13
|
-
run '
|
15
|
+
run 'bin/rails railties:install:migrations FROM=solidus_social'
|
14
16
|
end
|
15
17
|
|
16
18
|
def copy_initializer
|
@@ -20,9 +22,9 @@ module SolidusSocial
|
|
20
22
|
def run_migrations
|
21
23
|
run_migrations = options[:auto_run_migrations] || ['', 'y', 'Y'].include?(ask('Would you like to run the migrations now? [Y/n]'))
|
22
24
|
if run_migrations
|
23
|
-
run '
|
25
|
+
run 'bin/rails db:migrate'
|
24
26
|
else
|
25
|
-
puts 'Skipping
|
27
|
+
puts 'Skipping bin/rails db:migrate, don\'t forget to run it!' # rubocop:disable Rails/Output
|
26
28
|
end
|
27
29
|
end
|
28
30
|
end
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
Spree::SocialConfig.configure do |config|
|
2
4
|
config.use_static_preferences!
|
3
5
|
|
@@ -42,7 +44,7 @@ OmniAuth.logger.progname = 'omniauth'
|
|
42
44
|
|
43
45
|
OmniAuth.config.on_failure = proc do |env|
|
44
46
|
env['devise.mapping'] = Devise.mappings[Spree.user_class.table_name.singularize.to_sym]
|
45
|
-
controller_name
|
47
|
+
controller_name = ActiveSupport::Inflector.camelize(env['devise.mapping'].controllers[:omniauth_callbacks])
|
46
48
|
controller_klass = ActiveSupport::Inflector.constantize("#{controller_name}Controller")
|
47
49
|
controller_klass.action(:failure).call(env)
|
48
50
|
end
|
data/lib/solidus_social.rb
CHANGED
@@ -1,11 +1,26 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'solidus_core'
|
2
4
|
require 'solidus_support'
|
3
5
|
require 'solidus_auth_devise'
|
4
|
-
|
5
|
-
require 'omniauth-facebook'
|
6
|
-
require 'omniauth-github'
|
7
|
-
require 'omniauth-google-oauth2'
|
8
|
-
require 'omniauth-amazon'
|
9
|
-
require 'solidus_social/engine'
|
6
|
+
|
10
7
|
require 'solidus_social/version'
|
11
|
-
require '
|
8
|
+
require 'solidus_social/engine'
|
9
|
+
|
10
|
+
module SolidusSocial
|
11
|
+
def self.configured_providers
|
12
|
+
::Spree::SocialConfig.providers.keys.map(&:to_s)
|
13
|
+
end
|
14
|
+
|
15
|
+
def self.init_providers
|
16
|
+
::Spree::SocialConfig.providers.each do |provider, credentials|
|
17
|
+
setup_key_for(provider, credentials[:api_key], credentials[:api_secret])
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
def self.setup_key_for(provider, key, secret)
|
22
|
+
Devise.setup do |config|
|
23
|
+
config.omniauth provider, key, secret, setup: true
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
@@ -1,68 +1,43 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'omniauth-twitter'
|
4
|
+
require 'omniauth-facebook'
|
5
|
+
require 'omniauth-github'
|
6
|
+
require 'omniauth-google-oauth2'
|
7
|
+
require 'omniauth-amazon'
|
8
|
+
require 'deface'
|
9
|
+
require 'coffee_script'
|
10
|
+
require 'spree/core'
|
11
|
+
require 'solidus_social/facebook_omniauth_strategy_ext'
|
12
|
+
|
1
13
|
module SolidusSocial
|
2
14
|
class Engine < Rails::Engine
|
3
|
-
|
4
|
-
|
5
|
-
config.autoload_paths += %W(#{config.root}/lib)
|
6
|
-
|
7
|
-
initializer 'solidus_social.environment', before: 'spree.environment' do
|
8
|
-
Spree::SocialConfig = Spree::SocialConfiguration.new
|
9
|
-
end
|
15
|
+
include SolidusSupport::EngineExtensions::Decorators
|
10
16
|
|
11
|
-
|
12
|
-
next unless Rails.application.respond_to?(:reloader)
|
17
|
+
isolate_namespace ::Spree
|
13
18
|
|
14
|
-
|
15
|
-
# Reload and decorate the spree user class immediately after it is
|
16
|
-
# unloaded so that it is available to devise when loading routes
|
17
|
-
load File.join(__dir__, '../../app/models/spree/user_decorator.rb')
|
18
|
-
end
|
19
|
-
end
|
19
|
+
engine_name 'solidus_social'
|
20
20
|
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
end
|
21
|
+
# use rspec for tests
|
22
|
+
config.generators do |g|
|
23
|
+
g.test_framework :rspec
|
25
24
|
end
|
26
25
|
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
def self.configured_providers
|
31
|
-
Spree::SocialConfig.providers.keys.map(&:to_s)
|
32
|
-
end
|
33
|
-
|
34
|
-
def self.init_providers
|
35
|
-
Spree::SocialConfig.providers.each do |provider, credentials|
|
36
|
-
setup_key_for(provider, credentials[:api_key], credentials[:api_secret])
|
37
|
-
end
|
38
|
-
end
|
26
|
+
USER_DECORATOR_PATH = root.join(
|
27
|
+
"app/decorators/models/solidus_social/spree/user_decorator.rb"
|
28
|
+
).to_s
|
39
29
|
|
40
|
-
|
41
|
-
|
42
|
-
config.omniauth provider, key, secret, setup: true
|
30
|
+
initializer 'solidus_social.environment', before: 'spree.environment' do
|
31
|
+
::Spree::SocialConfig = ::Spree::SocialConfiguration.new
|
43
32
|
end
|
44
|
-
end
|
45
|
-
end
|
46
33
|
|
47
|
-
|
48
|
-
|
49
|
-
class Facebook < OAuth2
|
50
|
-
MOBILE_USER_AGENTS = 'palm|blackberry|nokia|phone|midp|mobi|symbian|chtml|ericsson|minimo|' \
|
51
|
-
'audiovox|motorola|samsung|telit|upg1|windows ce|ucweb|astel|plucker|' \
|
52
|
-
'x320|x240|j2me|sgh|portable|sprint|docomo|kddi|softbank|android|mmp|' \
|
53
|
-
'pdxgw|netfront|xiino|vodafone|portalmmm|sagem|mot-|sie-|ipod|up\\.b|' \
|
54
|
-
'webos|amoi|novarra|cdm|alcatel|pocket|ipad|iphone|mobileexplorer|' \
|
55
|
-
'mobile'
|
56
|
-
def request_phase
|
57
|
-
options[:scope] ||= 'email'
|
58
|
-
options[:info_fields] ||= 'email'
|
59
|
-
options[:display] = mobile_request? ? 'touch' : 'page'
|
60
|
-
super
|
61
|
-
end
|
34
|
+
initializer 'solidus_social.decorate_spree_user' do |app|
|
35
|
+
next unless app.respond_to?(:reloader)
|
62
36
|
|
63
|
-
|
64
|
-
|
65
|
-
|
37
|
+
app.reloader.after_class_unload do
|
38
|
+
# Reload and decorate the spree user class immediately after it is
|
39
|
+
# unloaded so that it is available to devise when loading routes
|
40
|
+
load USER_DECORATOR_PATH
|
66
41
|
end
|
67
42
|
end
|
68
43
|
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
module SolidusSocial
|
2
|
+
# Patch the Facebook strategy discriminating between mobile and desktop.
|
3
|
+
module FacebookOmniauthStrategyExt
|
4
|
+
MOBILE_USER_AGENTS = 'palm|blackberry|nokia|phone|midp|mobi|symbian|chtml|ericsson|minimo|' \
|
5
|
+
'audiovox|motorola|samsung|telit|upg1|windows ce|ucweb|astel|plucker|' \
|
6
|
+
'x320|x240|j2me|sgh|portable|sprint|docomo|kddi|softbank|android|mmp|' \
|
7
|
+
'pdxgw|netfront|xiino|vodafone|portalmmm|sagem|mot-|sie-|ipod|up\\.b|' \
|
8
|
+
'webos|amoi|novarra|cdm|alcatel|pocket|ipad|iphone|mobileexplorer|' \
|
9
|
+
'mobile'
|
10
|
+
|
11
|
+
def request_phase
|
12
|
+
options[:scope] ||= 'email'
|
13
|
+
options[:info_fields] ||= 'email'
|
14
|
+
options[:display] = mobile_request? ? 'touch' : 'page'
|
15
|
+
super
|
16
|
+
end
|
17
|
+
|
18
|
+
def mobile_request?
|
19
|
+
ua = Rack::Request.new(@env).user_agent.to_s
|
20
|
+
ua.downcase =~ Regexp.new(MOBILE_USER_AGENTS)
|
21
|
+
end
|
22
|
+
|
23
|
+
OmniAuth::Strategies::Facebook.prepend self
|
24
|
+
end
|
25
|
+
end
|
@@ -1,18 +1,5 @@
|
|
1
|
-
|
2
|
-
module_function
|
3
|
-
|
4
|
-
# Returns the version of the currently loaded SolidusSocial as a
|
5
|
-
# <tt>Gem::Version</tt>.
|
6
|
-
def version
|
7
|
-
Gem::Version.new VERSION::STRING
|
8
|
-
end
|
1
|
+
# frozen_string_literal: true
|
9
2
|
|
10
|
-
|
11
|
-
|
12
|
-
MINOR = 2
|
13
|
-
TINY = 0
|
14
|
-
PRE = nil
|
15
|
-
|
16
|
-
STRING = [MAJOR, MINOR, TINY, PRE].compact.join('.')
|
17
|
-
end
|
3
|
+
module SolidusSocial
|
4
|
+
VERSION = '1.3.0'
|
18
5
|
end
|
data/solidus_social.gemspec
CHANGED
@@ -1,47 +1,44 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
s.add_development_dependency 'sqlite3', '~> 1.3.10'
|
45
|
-
s.add_development_dependency 'rubocop', '~> 0.39.0'
|
46
|
-
s.add_development_dependency 'rake', '< 11'
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative 'lib/solidus_social/version'
|
4
|
+
|
5
|
+
Gem::Specification.new do |spec|
|
6
|
+
spec.name = 'solidus_social'
|
7
|
+
spec.version = SolidusSocial::VERSION
|
8
|
+
spec.authors = ['John Dyer']
|
9
|
+
spec.email = 'jdyer@spreecommerce.com'
|
10
|
+
|
11
|
+
spec.summary = 'Adds social network login services (OAuth) to Solidus'
|
12
|
+
spec.homepage = 'https://github.com/solidusio-contrib/solidus_social#readme'
|
13
|
+
spec.license = 'BSD-3-Clause'
|
14
|
+
|
15
|
+
|
16
|
+
spec.metadata['homepage_uri'] = spec.homepage
|
17
|
+
spec.metadata['source_code_uri'] = 'https://github.com/solidusio-contrib/solidus_social'
|
18
|
+
spec.metadata['changelog_uri'] = 'https://github.com/solidusio-contrib/solidus_social/blob/master/CHANGELOG.md'
|
19
|
+
|
20
|
+
spec.required_ruby_version = Gem::Requirement.new('~> 2.4')
|
21
|
+
|
22
|
+
# Specify which files should be added to the gem when it is released.
|
23
|
+
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
24
|
+
files = Dir.chdir(__dir__) { `git ls-files -z`.split("\x0") }
|
25
|
+
spec.files = files.grep_v(%r{^(test|spec|features)/})
|
26
|
+
spec.test_files = files.grep(%r{^(test|spec|features)/})
|
27
|
+
spec.bindir = "exe"
|
28
|
+
spec.executables = files.grep(%r{^exe/}) { |f| File.basename(f) }
|
29
|
+
spec.require_paths = ["lib"]
|
30
|
+
|
31
|
+
spec.add_dependency 'deface'
|
32
|
+
spec.add_dependency 'oa-core'
|
33
|
+
spec.add_dependency 'omniauth'
|
34
|
+
spec.add_dependency 'omniauth-amazon'
|
35
|
+
spec.add_dependency 'omniauth-facebook'
|
36
|
+
spec.add_dependency 'omniauth-github'
|
37
|
+
spec.add_dependency 'omniauth-google-oauth2'
|
38
|
+
spec.add_dependency 'omniauth-twitter'
|
39
|
+
spec.add_dependency 'solidus_auth_devise'
|
40
|
+
spec.add_dependency 'solidus_core', ['>= 2.0.0', '< 3']
|
41
|
+
spec.add_dependency 'solidus_support', '~> 0.4.0'
|
42
|
+
|
43
|
+
spec.add_development_dependency 'solidus_dev_support'
|
47
44
|
end
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
RSpec.describe Spree::OmniauthCallbacksController, type: :controller do
|
2
4
|
let(:user) { create(:user) }
|
3
5
|
let(:omni_params) { double('omni', :[] => nil).as_null_object }
|
@@ -45,18 +47,19 @@ RSpec.describe Spree::OmniauthCallbacksController, type: :controller do
|
|
45
47
|
end
|
46
48
|
end
|
47
49
|
|
48
|
-
|
50
|
+
describe '#callback' do
|
49
51
|
context 'when user is authenticated' do
|
50
52
|
before do
|
51
53
|
allow(controller).to receive(:spree_current_user).and_return(user)
|
52
54
|
end
|
53
55
|
|
54
|
-
|
56
|
+
it_behaves_like 'denied_permissions'
|
55
57
|
|
56
58
|
context 'when existing user_authentication' do
|
57
59
|
let(:user_authentication) { double('user_authentication', user: user) }
|
60
|
+
|
58
61
|
before do
|
59
|
-
allow(Spree::UserAuthentication).to receive(:
|
62
|
+
allow(Spree::UserAuthentication).to receive(:find_by).and_return(user_authentication)
|
60
63
|
end
|
61
64
|
|
62
65
|
it 'does not need to create the user_authentication' do
|
@@ -77,7 +80,7 @@ RSpec.describe Spree::OmniauthCallbacksController, type: :controller do
|
|
77
80
|
|
78
81
|
context 'when no existing user_authentication' do
|
79
82
|
before do
|
80
|
-
allow(Spree::UserAuthentication).to receive(:
|
83
|
+
allow(Spree::UserAuthentication).to receive(:find_by).and_return(nil)
|
81
84
|
end
|
82
85
|
|
83
86
|
it 'creates a new user_authentication' do
|
@@ -96,7 +99,7 @@ RSpec.describe Spree::OmniauthCallbacksController, type: :controller do
|
|
96
99
|
controller.twitter
|
97
100
|
end
|
98
101
|
|
99
|
-
|
102
|
+
it_behaves_like 'associate_order'
|
100
103
|
end
|
101
104
|
end
|
102
105
|
|
@@ -105,12 +108,13 @@ RSpec.describe Spree::OmniauthCallbacksController, type: :controller do
|
|
105
108
|
allow(controller).to receive(:spree_current_user).and_return(nil)
|
106
109
|
end
|
107
110
|
|
108
|
-
|
111
|
+
it_behaves_like 'denied_permissions'
|
109
112
|
|
110
113
|
context 'when existing user_authentication' do
|
111
114
|
let(:user_authentication) { double('user_authentication', user: user) }
|
115
|
+
|
112
116
|
before do
|
113
|
-
allow(Spree::UserAuthentication).to receive(:
|
117
|
+
allow(Spree::UserAuthentication).to receive(:find_by).and_return(user_authentication)
|
114
118
|
end
|
115
119
|
|
116
120
|
it 'does not need to create the user_authentication' do
|
@@ -131,8 +135,9 @@ RSpec.describe Spree::OmniauthCallbacksController, type: :controller do
|
|
131
135
|
|
132
136
|
context 'when no existing user_authentication' do
|
133
137
|
let(:user) { Spree::User.new }
|
138
|
+
|
134
139
|
before do
|
135
|
-
allow(Spree::UserAuthentication).to receive(:
|
140
|
+
allow(Spree::UserAuthentication).to receive(:find_by).and_return(nil)
|
136
141
|
allow(controller).to receive(:auth_hash).and_return('provider' => 'facebook', 'info' => { 'email' => 'spree@gmail.com' }, 'uid' => '123')
|
137
142
|
end
|
138
143
|
|
@@ -175,7 +180,7 @@ RSpec.describe Spree::OmniauthCallbacksController, type: :controller do
|
|
175
180
|
before { @user = create(:user, email: 'spree@gmail.com') }
|
176
181
|
|
177
182
|
it 'does not create new user' do
|
178
|
-
expect { controller.twitter }.
|
183
|
+
expect { controller.twitter }.not_to change(Spree::User, :count)
|
179
184
|
end
|
180
185
|
|
181
186
|
it 'assigns authentication to existing user' do
|