solidus_social 1.2.0 → 1.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (74) hide show
  1. checksums.yaml +5 -5
  2. data/.circleci/config.yml +35 -0
  3. data/.gem_release.yml +5 -0
  4. data/.github/stale.yml +17 -0
  5. data/.gitignore +6 -8
  6. data/.rspec +3 -3
  7. data/.rubocop.yml +3 -149
  8. data/.rubocop_todo.yml +42 -0
  9. data/CHANGELOG.md +31 -9
  10. data/Gemfile +21 -20
  11. data/{LICENSE.md → LICENSE} +2 -2
  12. data/README.md +56 -14
  13. data/Rakefile +4 -19
  14. data/app/controllers/spree/admin/authentication_methods_controller.rb +2 -0
  15. data/app/controllers/spree/omniauth_callbacks_controller.rb +8 -6
  16. data/app/controllers/spree/user_authentications_controller.rb +3 -1
  17. data/app/decorators/controllers/solidus_social/spree/user_registrations_controller_decorator.rb +27 -0
  18. data/app/decorators/models/solidus_social/spree/user_decorator.rb +28 -0
  19. data/app/helpers/spree/omniauth_callbacks_helper.rb +2 -0
  20. data/app/models/spree/authentication_method.rb +3 -1
  21. data/app/models/spree/social_configuration.rb +2 -0
  22. data/app/models/spree/user_authentication.rb +3 -1
  23. data/app/overrides/add_authentications_to_account_summary.rb +2 -0
  24. data/app/overrides/admin_configuration_decorator.rb +3 -1
  25. data/app/overrides/user_registrations_decorator.rb +2 -0
  26. data/app/views/spree/admin/authentication_methods/_form.html.erb +4 -4
  27. data/app/views/spree/admin/authentication_methods/edit.html.erb +2 -2
  28. data/app/views/spree/admin/authentication_methods/index.html.erb +10 -10
  29. data/app/views/spree/admin/authentication_methods/new.html.erb +2 -2
  30. data/app/views/spree/shared/_social.html.erb +5 -5
  31. data/app/views/spree/shared/_user_form.html.erb +3 -3
  32. data/app/views/spree/users/_new-customer.html.erb +2 -2
  33. data/app/views/spree/users/_social.html.erb +5 -5
  34. data/bin/console +17 -0
  35. data/bin/rails +15 -4
  36. data/bin/rake +7 -0
  37. data/bin/sandbox +72 -0
  38. data/bin/setup +8 -0
  39. data/config/locales/en.yml +1 -0
  40. data/config/routes.rb +6 -4
  41. data/db/migrate/20120120163432_create_user_authentications.rb +2 -0
  42. data/db/migrate/20120123163222_create_authentication_methods.rb +2 -0
  43. data/lib/generators/solidus_social/install/install_generator.rb +7 -5
  44. data/lib/generators/solidus_social/install/templates/config/initializers/solidus_social.rb +3 -1
  45. data/lib/solidus_social.rb +22 -7
  46. data/lib/solidus_social/engine.rb +29 -54
  47. data/lib/solidus_social/facebook_omniauth_strategy_ext.rb +25 -0
  48. data/lib/solidus_social/factories.rb +4 -0
  49. data/lib/solidus_social/version.rb +3 -16
  50. data/solidus_social.gemspec +43 -46
  51. data/spec/controllers/spree/omniauth_callbacks_controller_spec.rb +14 -9
  52. data/spec/features/spree/admin/authentication_methods_configuration_spec.rb +13 -10
  53. data/spec/features/spree/sign_in_spec.rb +13 -10
  54. data/spec/lib/solidus_social/engine_spec.rb +9 -0
  55. data/spec/lib/{spree_social/engine_spec.rb → solidus_social_speec.rb} +3 -1
  56. data/spec/lib/spree/social_config_spec.rb +2 -0
  57. data/spec/models/spree/authentication_method_spec.rb +4 -2
  58. data/spec/models/spree/social_configuration_spec.rb +2 -0
  59. data/spec/models/spree/user_decorator_spec.rb +5 -3
  60. data/spec/spec_helper.rb +17 -29
  61. data/spec/support/omniauth.rb +4 -0
  62. metadata +56 -196
  63. data/.hound.yml +0 -26
  64. data/.travis.yml +0 -32
  65. data/app/assets/javascripts/spree/backend/solidus_social.js +0 -1
  66. data/app/assets/javascripts/spree/frontend/solidus_social.js +0 -1
  67. data/app/assets/stylesheets/spree/backend/solidus_social.css +0 -3
  68. data/app/controllers/spree/user_registrations_controller_decorator.rb +0 -15
  69. data/app/models/spree/user_decorator.rb +0 -16
  70. data/spec/support/capybara.rb +0 -11
  71. data/spec/support/database_cleaner.rb +0 -23
  72. data/spec/support/devise.rb +0 -3
  73. data/spec/support/factory_girl.rb +0 -7
  74. data/spec/support/spree.rb +0 -8
data/.hound.yml DELETED
@@ -1,26 +0,0 @@
1
- ---
2
- # Too picky.
3
- LineLength:
4
- Enabled: false
5
-
6
- # This should truly be on for well documented gems.
7
- Documentation:
8
- Enabled: false
9
-
10
- # Neatly aligned code is too swell.
11
- SingleSpaceBeforeFirstArg:
12
- Enabled: false
13
-
14
- # Don't mess with RSpec DSL.
15
- Blocks:
16
- Exclude:
17
- - 'spec/**/*'
18
-
19
- # We really like the readability with newline in beginning of classes.
20
- EmptyLinesAroundBlockBody:
21
- Enabled: false
22
-
23
- # Use nested module/class definitions instead of compact style.
24
- # Too high git impact to change this now.
25
- ClassAndModuleChildren:
26
- Enabled: false
@@ -1,32 +0,0 @@
1
- sudo: required
2
- cache: bundler
3
- language: ruby
4
- dist: trusty
5
- addons:
6
- apt:
7
- packages:
8
- - google-chrome-beta
9
- rvm:
10
- - 2.3.5
11
- env:
12
- matrix:
13
- - SOLIDUS_BRANCH=v1.0 DB=postgres
14
- - SOLIDUS_BRANCH=v1.1 DB=postgres
15
- - SOLIDUS_BRANCH=v1.2 DB=postgres
16
- - SOLIDUS_BRANCH=v1.3 DB=postgres
17
- - SOLIDUS_BRANCH=v1.4 DB=postgres
18
- - SOLIDUS_BRANCH=v2.0 DB=postgres
19
- - SOLIDUS_BRANCH=v2.1 DB=postgres
20
- - SOLIDUS_BRANCH=v2.2 DB=postgres
21
- - SOLIDUS_BRANCH=v2.3 DB=postgres
22
- - SOLIDUS_BRANCH=master DB=postgres
23
- - SOLIDUS_BRANCH=v1.0 DB=mysql
24
- - SOLIDUS_BRANCH=v1.1 DB=mysql
25
- - SOLIDUS_BRANCH=v1.2 DB=mysql
26
- - SOLIDUS_BRANCH=v1.3 DB=mysql
27
- - SOLIDUS_BRANCH=v1.4 DB=mysql
28
- - SOLIDUS_BRANCH=v2.0 DB=mysql
29
- - SOLIDUS_BRANCH=v2.1 DB=mysql
30
- - SOLIDUS_BRANCH=v2.2 DB=mysql
31
- - SOLIDUS_BRANCH=v2.3 DB=mysql
32
- - SOLIDUS_BRANCH=master DB=mysql
@@ -1 +0,0 @@
1
- //= require spree/backend
@@ -1 +0,0 @@
1
- //= require spree/frontend
@@ -1,3 +0,0 @@
1
- /*
2
- *= require spree/backend
3
- */
@@ -1,15 +0,0 @@
1
- Spree::UserRegistrationsController.class_eval do
2
- after_action :clear_omniauth, only: :create
3
-
4
- private
5
-
6
- def build_resource(*args)
7
- super
8
- @spree_user.apply_omniauth(session[:omniauth]) if session[:omniauth]
9
- @spree_user
10
- end
11
-
12
- def clear_omniauth
13
- session[:omniauth] = nil unless @spree_user.new_record?
14
- end
15
- end
@@ -1,16 +0,0 @@
1
- Spree.user_class.class_eval do
2
- has_many :user_authentications, dependent: :destroy
3
-
4
- devise :omniauthable
5
-
6
- def apply_omniauth(omniauth)
7
- if omniauth.fetch('info', {})['email'].present?
8
- self.email = omniauth['info']['email'] if email.blank?
9
- end
10
- user_authentications.build(provider: omniauth['provider'], uid: omniauth['uid'])
11
- end
12
-
13
- def password_required?
14
- (user_authentications.empty? || !password.blank?) && super
15
- end
16
- end
@@ -1,11 +0,0 @@
1
- require 'capybara/rspec'
2
- require 'capybara/rails'
3
- require 'capybara/poltergeist'
4
- require 'capybara-screenshot/rspec'
5
- require 'selenium-webdriver'
6
-
7
- RSpec.configure do |config|
8
- config.include Rack::Test::Methods, type: :requests
9
-
10
- Capybara.javascript_driver = :selenium_chrome_headless
11
- end
@@ -1,23 +0,0 @@
1
- require 'database_cleaner'
2
-
3
- RSpec.configure do |config|
4
- config.before(:suite) do
5
- DatabaseCleaner.clean_with :truncation
6
- end
7
-
8
- config.before do
9
- DatabaseCleaner.strategy = :transaction
10
- end
11
-
12
- config.before(:each, :js) do
13
- DatabaseCleaner.strategy = :truncation
14
- end
15
-
16
- config.before do
17
- DatabaseCleaner.start
18
- end
19
-
20
- config.after do
21
- DatabaseCleaner.clean
22
- end
23
- end
@@ -1,3 +0,0 @@
1
- RSpec.configure do |config|
2
- config.include Devise::TestHelpers, type: :controller
3
- end
@@ -1,7 +0,0 @@
1
- require 'factory_girl'
2
-
3
- FactoryGirl.find_definitions
4
-
5
- RSpec.configure do |config|
6
- config.include FactoryGirl::Syntax::Methods
7
- end
@@ -1,8 +0,0 @@
1
- require 'spree/testing_support/factories'
2
- require 'spree/testing_support/authorization_helpers'
3
- require 'spree/testing_support/url_helpers'
4
- require 'spree/testing_support/capybara_ext'
5
-
6
- RSpec.configure do |config|
7
- config.include Spree::TestingSupport::UrlHelpers
8
- end