spree_auth_devise 3.2.0.beta → 3.2.0

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of spree_auth_devise might be problematic. Click here for more details.

Files changed (91) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +17 -6
  3. data/.travis.yml +19 -7
  4. data/Appraisals +13 -0
  5. data/CHANGELOG.md +11 -3
  6. data/Gemfile +1 -0
  7. data/README.md +30 -27
  8. data/Rakefile +1 -1
  9. data/app/mailers/spree/user_mailer.rb +6 -6
  10. data/app/models/spree/auth_configuration.rb +3 -3
  11. data/app/models/spree/user.rb +17 -16
  12. data/app/overrides/auth_shared_login_bar.rb +6 -7
  13. data/config.ru +1 -1
  14. data/config/initializers/devise.rb +1 -1
  15. data/config/initializers/warden.rb +2 -2
  16. data/config/locales/bg.yml +54 -0
  17. data/config/locales/de.yml +1 -1
  18. data/config/locales/en.yml +1 -1
  19. data/config/locales/es.yml +1 -1
  20. data/config/locales/fr.yml +1 -1
  21. data/config/locales/it.yml +2 -2
  22. data/config/locales/nl.yml +1 -1
  23. data/config/locales/pt-BR.yml +1 -1
  24. data/config/locales/pt.yml +1 -1
  25. data/config/locales/tr.yml +1 -1
  26. data/config/routes.rb +17 -18
  27. data/db/default/users.rb +6 -6
  28. data/db/migrate/20101026184949_create_users.rb +14 -9
  29. data/db/migrate/20101026184950_rename_columns_for_devise.rb +6 -1
  30. data/db/migrate/20101214150824_convert_user_remember_field.rb +6 -1
  31. data/db/migrate/20120203010234_add_reset_password_sent_at_to_spree_users.rb +6 -1
  32. data/db/migrate/20120605211305_make_users_email_index_unique.rb +8 -3
  33. data/db/migrate/20140904000425_add_deleted_at_to_users.rb +6 -1
  34. data/db/migrate/20141002154641_add_confirmable_to_users.rb +6 -1
  35. data/db/migrate/20150416152553_add_missing_indices_on_user.rb +6 -1
  36. data/gemfiles/spree_3_1.gemfile +7 -0
  37. data/gemfiles/spree_3_2.gemfile +8 -0
  38. data/gemfiles/spree_master.gemfile +8 -0
  39. data/lib/controllers/backend/spree/admin/admin_controller_decorator.rb +6 -8
  40. data/lib/controllers/backend/spree/admin/admin_orders_controller_decorator.rb +15 -14
  41. data/lib/controllers/backend/spree/admin/admin_resource_controller_decorator.rb +1 -1
  42. data/lib/controllers/backend/spree/admin/orders/customer_details_controller_decorator.rb +9 -8
  43. data/lib/controllers/backend/spree/admin/user_passwords_controller.rb +6 -1
  44. data/lib/controllers/backend/spree/admin/user_sessions_controller.rb +22 -16
  45. data/lib/controllers/frontend/spree/checkout_controller_decorator.rb +17 -16
  46. data/lib/controllers/frontend/spree/user_confirmations_controller.rb +4 -0
  47. data/lib/controllers/frontend/spree/user_passwords_controller.rb +5 -1
  48. data/lib/controllers/frontend/spree/user_registrations_controller.rb +4 -0
  49. data/lib/controllers/frontend/spree/user_sessions_controller.rb +18 -11
  50. data/lib/controllers/frontend/spree/users_controller.rb +16 -15
  51. data/lib/generators/spree/auth/install/install_generator.rb +8 -2
  52. data/lib/spree/auth/devise.rb +1 -1
  53. data/lib/spree/auth/engine.rb +9 -9
  54. data/lib/tasks/auth.rake +1 -1
  55. data/lib/views/frontend/spree/users/show.html.erb +1 -1
  56. data/spec/controllers/spree/checkout_controller_spec.rb +1 -2
  57. data/spec/controllers/spree/products_controller_spec.rb +0 -1
  58. data/spec/controllers/spree/user_passwords_controller_spec.rb +3 -4
  59. data/spec/controllers/spree/user_registrations_controller_spec.rb +0 -1
  60. data/spec/controllers/spree/user_sessions_controller_spec.rb +0 -1
  61. data/spec/controllers/spree/users_controller_spec.rb +0 -1
  62. data/spec/factories/confirmed_user.rb +1 -1
  63. data/spec/features/account_spec.rb +0 -1
  64. data/spec/features/admin/orders_spec.rb +0 -1
  65. data/spec/features/admin/password_reset_spec.rb +0 -1
  66. data/spec/features/admin/products_spec.rb +0 -1
  67. data/spec/features/admin/sign_in_spec.rb +0 -1
  68. data/spec/features/admin/sign_out_spec.rb +0 -1
  69. data/spec/features/admin_permissions_spec.rb +0 -1
  70. data/spec/features/change_email_spec.rb +0 -1
  71. data/spec/features/checkout_spec.rb +8 -8
  72. data/spec/features/confirmation_spec.rb +1 -1
  73. data/spec/features/order_spec.rb +0 -1
  74. data/spec/features/password_reset_spec.rb +0 -1
  75. data/spec/features/sign_in_spec.rb +1 -2
  76. data/spec/features/sign_out_spec.rb +0 -1
  77. data/spec/features/sign_up_spec.rb +0 -1
  78. data/spec/mailers/user_mailer_spec.rb +0 -1
  79. data/spec/models/order_spec.rb +0 -1
  80. data/spec/models/user_spec.rb +3 -1
  81. data/spec/spec_helper.rb +0 -7
  82. data/spec/support/ability.rb +1 -1
  83. data/spec/support/authentication_helpers.rb +2 -2
  84. data/spec/support/capybara.rb +1 -1
  85. data/spec/support/confirm_helpers.rb +1 -1
  86. data/spec/support/database_cleaner.rb +2 -3
  87. data/spec/support/spree.rb +0 -16
  88. data/spree_auth_devise.gemspec +6 -6
  89. metadata +16 -13
  90. data/Versionfile +0 -5
  91. data/circle.yml +0 -13
@@ -25,4 +25,4 @@ feature 'Confirmation' do
25
25
  expect(page).to have_text 'You have signed up successfully.'
26
26
  expect(Spree::User.last.confirmed?).to be(false)
27
27
  end
28
- end
28
+ end
@@ -1,5 +1,4 @@
1
1
  RSpec.feature 'Orders', :js, type: :feature do
2
-
3
2
  scenario 'allow a user to view their cart at any time' do
4
3
  visit spree.cart_path
5
4
  expect(page).to have_text 'Your cart is empty'
@@ -1,5 +1,4 @@
1
1
  RSpec.feature 'Reset Password', type: :feature do
2
-
3
2
  let!(:store) { create(:store) }
4
3
 
5
4
  background do
@@ -1,5 +1,4 @@
1
1
  RSpec.feature 'Sign In', type: :feature do
2
-
3
2
  background do
4
3
  @user = create(:user, email: 'email@person.com', password: 'secret', password_confirmation: 'secret')
5
4
  visit spree.login_path
@@ -44,7 +43,7 @@ RSpec.feature 'Sign In', type: :feature do
44
43
  expect(current_path).to eq '/admin/orders'
45
44
  end
46
45
 
47
- it "should store the user previous location" do
46
+ xit "should store the user previous location" do
48
47
  visit spree.account_path
49
48
  fill_in "Email", with: @user.email
50
49
  fill_in "Password", with: @user.password
@@ -1,5 +1,4 @@
1
1
  RSpec.feature 'Sign Out', type: :feature do
2
-
3
2
  given!(:user) do
4
3
  create(:user,
5
4
  email: 'email@person.com',
@@ -1,5 +1,4 @@
1
1
  RSpec.feature 'Sign Up', type: :feature do
2
-
3
2
  context 'with valid data' do
4
3
  scenario 'create a new user' do
5
4
  visit spree.signup_path
@@ -1,5 +1,4 @@
1
1
  RSpec.describe Spree::UserMailer, type: :mailer do
2
-
3
2
  let!(:store) { create(:store) }
4
3
  let(:user) { create(:user) }
5
4
 
@@ -1,5 +1,4 @@
1
1
  RSpec.describe Spree::Order, type: :model do
2
-
3
2
  let(:order) { described_class.new }
4
3
 
5
4
  context '#associate_user!' do
@@ -1,5 +1,4 @@
1
1
  RSpec.describe Spree::User, type: :model do
2
-
3
2
  before(:all) { Spree::Role.create name: 'admin' }
4
3
 
5
4
  it '#admin?' do
@@ -41,6 +40,9 @@ RSpec.describe Spree::User, type: :model do
41
40
  end
42
41
 
43
42
  it 'will not soft delete with completed orders' do
43
+ # depends on Spree Core
44
+ # this was introduced in Spree 3.2
45
+ skip "this is't supported in Spree 3.1 and lower" if Spree.version.to_f < 3.2
44
46
  order = build(:order, completed_at: Time.now)
45
47
  order.save
46
48
  user = order.user
data/spec/spec_helper.rb CHANGED
@@ -8,7 +8,6 @@ require File.expand_path('../dummy/config/environment', __FILE__)
8
8
  require 'rspec/rails'
9
9
  require 'shoulda-matchers'
10
10
  require 'ffaker'
11
- require 'rails-controller-testing'
12
11
 
13
12
  RSpec.configure do |config|
14
13
  config.filter_run focus: true
@@ -20,12 +19,6 @@ RSpec.configure do |config|
20
19
  config.mock_with :rspec do |mock|
21
20
  mock.syntax = [:should, :expect]
22
21
  end
23
-
24
- [:controller, :view, :request].each do |type|
25
- config.include ::Rails::Controller::Testing::TestProcess, type: type
26
- config.include ::Rails::Controller::Testing::TemplateAssertions, type: type
27
- config.include ::Rails::Controller::Testing::Integration, type: type
28
- end
29
22
  end
30
23
 
31
24
  Dir[File.join(File.dirname(__FILE__), 'support/**/*.rb')].each { |f| require f }
@@ -8,7 +8,7 @@ if defined? CanCan::Ability
8
8
  class AbilityDecorator
9
9
  include CanCan::Ability
10
10
 
11
- def initialize(user)
11
+ def initialize(_user)
12
12
  cannot :manage, Spree::Order
13
13
  end
14
14
  end
@@ -9,6 +9,6 @@ end
9
9
 
10
10
  RSpec.configure do |config|
11
11
  config.include AuthenticationHelpers, type: :feature
12
- config.include Devise::TestHelpers, type: :controller
13
- config.include Rack::Test::Methods, type: :feature
12
+ config.include Devise::Test::ControllerHelpers, type: :controller
13
+ config.include Rack::Test::Methods, type: :feature
14
14
  end
@@ -3,7 +3,7 @@ require 'capybara/rails'
3
3
  require 'capybara/poltergeist'
4
4
  require 'capybara-screenshot/rspec'
5
5
 
6
- RSpec.configure do |config|
6
+ RSpec.configure do |_config|
7
7
  Capybara.javascript_driver = :poltergeist
8
8
  Capybara.save_and_open_page_path = ENV['CIRCLE_ARTIFACTS'] if ENV['CIRCLE_ARTIFACTS']
9
9
  end
@@ -8,4 +8,4 @@ end
8
8
 
9
9
  RSpec.configure do |c|
10
10
  c.include ConfirmHelpers
11
- end
11
+ end
@@ -1,18 +1,17 @@
1
1
  require 'database_cleaner'
2
2
 
3
3
  RSpec.configure do |config|
4
-
5
4
  config.before(:suite) do
6
5
  DatabaseCleaner.strategy = :transaction
7
6
  DatabaseCleaner.clean_with :truncation
8
7
  end
9
8
 
10
- config.before do
9
+ config.before(:each) do
11
10
  DatabaseCleaner.strategy = RSpec.current_example.metadata[:js] ? :truncation : :transaction
12
11
  DatabaseCleaner.start
13
12
  end
14
13
 
15
- config.after do
14
+ config.after(:each) do
16
15
  DatabaseCleaner.clean
17
16
  end
18
17
  end
@@ -4,22 +4,6 @@ require 'spree/testing_support/controller_requests'
4
4
  require 'spree/testing_support/authorization_helpers'
5
5
  require 'spree/testing_support/capybara_ext'
6
6
 
7
- # Monkey patch for pending: https://github.com/spree/spree/pull/5182
8
- module Spree
9
- module TestingSupport
10
- module AuthorizationHelpers
11
- module Controller
12
- def stub_authorization!(&block)
13
- ability_class = build_ability(&block)
14
- before do
15
- allow(controller).to receive(:current_ability).and_return(ability_class.new(nil))
16
- end
17
- end
18
- end
19
- end
20
- end
21
- end
22
-
23
7
  RSpec.configure do |config|
24
8
  config.include Spree::TestingSupport::UrlHelpers
25
9
  config.include Spree::TestingSupport::ControllerRequests, type: :controller
@@ -3,24 +3,24 @@
3
3
  Gem::Specification.new do |s|
4
4
  s.platform = Gem::Platform::RUBY
5
5
  s.name = 'spree_auth_devise'
6
- s.version = '3.2.0.beta'
6
+ s.version = '3.2.0'
7
7
  s.summary = 'Provides authentication and authorization services for use with Spree by using Devise and CanCan.'
8
8
  s.description = s.summary
9
9
 
10
- s.required_ruby_version = '>= 2.2.2'
10
+ s.required_ruby_version = '>= 2.2.7'
11
11
 
12
12
  s.author = 'Sean Schofield'
13
13
  s.email = 'sean@spreecommerce.com'
14
14
  s.homepage = 'http://spreecommerce.com'
15
- s.license = %q{BSD-3}
15
+ s.license = 'BSD-3'
16
16
 
17
17
  s.files = `git ls-files`.split("\n")
18
18
  s.test_files = `git ls-files -- spec/*`.split("\n")
19
19
  s.require_path = 'lib'
20
20
  s.requirements << 'none'
21
21
 
22
- s.add_dependency 'devise', '~> 4.0.0'
23
- s.add_dependency 'devise-encryptable', '0.1.2'
22
+ s.add_dependency 'devise', '~> 4.3.0'
23
+ s.add_dependency 'devise-encryptable', '0.2.0'
24
24
 
25
25
  spree_version = '>= 3.1.0', '< 4.0'
26
26
  s.add_dependency 'spree_core', spree_version
@@ -43,5 +43,5 @@ Gem::Specification.new do |s|
43
43
  s.add_development_dependency 'spree_backend', spree_version
44
44
  s.add_development_dependency 'spree_frontend', spree_version
45
45
  s.add_development_dependency 'sqlite3'
46
- s.add_development_dependency 'rails-controller-testing'
46
+ s.add_development_dependency 'appraisal'
47
47
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: spree_auth_devise
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.2.0.beta
4
+ version: 3.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sean Schofield
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-12-06 00:00:00.000000000 Z
11
+ date: 2017-06-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: devise
@@ -16,28 +16,28 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 4.0.0
19
+ version: 4.3.0
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: 4.0.0
26
+ version: 4.3.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: devise-encryptable
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - '='
32
32
  - !ruby/object:Gem::Version
33
- version: 0.1.2
33
+ version: 0.2.0
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - '='
39
39
  - !ruby/object:Gem::Version
40
- version: 0.1.2
40
+ version: 0.2.0
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: spree_core
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -323,7 +323,7 @@ dependencies:
323
323
  - !ruby/object:Gem::Version
324
324
  version: '0'
325
325
  - !ruby/object:Gem::Dependency
326
- name: rails-controller-testing
326
+ name: appraisal
327
327
  requirement: !ruby/object:Gem::Requirement
328
328
  requirements:
329
329
  - - ">="
@@ -346,12 +346,12 @@ files:
346
346
  - ".gitignore"
347
347
  - ".rspec"
348
348
  - ".travis.yml"
349
+ - Appraisals
349
350
  - CHANGELOG.md
350
351
  - Gemfile
351
352
  - LICENSE.md
352
353
  - README.md
353
354
  - Rakefile
354
- - Versionfile
355
355
  - app/controllers/metal_decorator.rb
356
356
  - app/mailers/spree/user_mailer.rb
357
357
  - app/models/spree/auth_configuration.rb
@@ -359,10 +359,10 @@ files:
359
359
  - app/overrides/auth_shared_login_bar.rb
360
360
  - app/overrides/spree/admin/shared/_header/auth_admin_login_navigation_bar.html.erb.deface
361
361
  - bin/rails
362
- - circle.yml
363
362
  - config.ru
364
363
  - config/initializers/devise.rb
365
364
  - config/initializers/warden.rb
365
+ - config/locales/bg.yml
366
366
  - config/locales/de.yml
367
367
  - config/locales/en.yml
368
368
  - config/locales/es.yml
@@ -383,6 +383,9 @@ files:
383
383
  - db/migrate/20141002154641_add_confirmable_to_users.rb
384
384
  - db/migrate/20150416152553_add_missing_indices_on_user.rb
385
385
  - db/seeds.rb
386
+ - gemfiles/spree_3_1.gemfile
387
+ - gemfiles/spree_3_2.gemfile
388
+ - gemfiles/spree_master.gemfile
386
389
  - lib/assets/javascripts/spree/backend/spree_auth.js.erb
387
390
  - lib/assets/javascripts/spree/frontend/account.js.coffee
388
391
  - lib/assets/javascripts/spree/frontend/spree_auth.js.erb
@@ -478,16 +481,16 @@ required_ruby_version: !ruby/object:Gem::Requirement
478
481
  requirements:
479
482
  - - ">="
480
483
  - !ruby/object:Gem::Version
481
- version: 2.2.2
484
+ version: 2.2.7
482
485
  required_rubygems_version: !ruby/object:Gem::Requirement
483
486
  requirements:
484
- - - ">"
487
+ - - ">="
485
488
  - !ruby/object:Gem::Version
486
- version: 1.3.1
489
+ version: '0'
487
490
  requirements:
488
491
  - none
489
492
  rubyforge_project:
490
- rubygems_version: 2.5.1
493
+ rubygems_version: 2.6.12
491
494
  signing_key:
492
495
  specification_version: 4
493
496
  summary: Provides authentication and authorization services for use with Spree by
data/Versionfile DELETED
@@ -1,5 +0,0 @@
1
- "2.2.x" => { :branch => "2-2-stable" }
2
- "2.1.x" => { :branch => "2-1-stable" }
3
- "2.0.x" => { :branch => "2-0-stable" }
4
- "1.3.x" => { :branch => "1-3-stable" }
5
- "1.2.x" => { :branch => "1-2-stable" }
data/circle.yml DELETED
@@ -1,13 +0,0 @@
1
- machine:
2
- environment:
3
- DB: postgres
4
- services:
5
- - postgresql
6
- ruby:
7
- version: '2.2.4'
8
-
9
- dependencies:
10
- pre:
11
- - gem install bundler
12
- post:
13
- - bundle exec rake test_app