spree_auth_devise 3.4.0 → 3.5.2
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/.travis.yml +1 -1
- data/Appraisals +2 -2
- data/CHANGELOG.md +1 -1
- data/README.md +11 -0
- data/{lib/controllers/frontend → app/controllers}/spree/user_passwords_controller.rb +4 -0
- data/{lib/controllers/frontend → app/controllers}/spree/user_registrations_controller.rb +4 -0
- data/{lib/controllers/frontend → app/controllers}/spree/user_sessions_controller.rb +4 -0
- data/app/views/spree/shared/_login.html.erb +18 -0
- data/{lib/views/frontend → app/views}/spree/shared/_user_form.html.erb +7 -3
- data/{lib/views/frontend → app/views}/spree/user_passwords/edit.html.erb +4 -4
- data/{lib/views/frontend → app/views}/spree/user_passwords/new.html.erb +4 -4
- data/{lib/views/frontend → app/views}/spree/user_registrations/new.html.erb +2 -2
- data/config/initializers/warden.rb +4 -8
- data/gemfiles/{spree_3_6.gemfile → spree_3_7.gemfile} +1 -1
- data/lib/controllers/frontend/spree/checkout_controller_decorator.rb +1 -1
- data/lib/spree_auth_devise.rb +0 -1
- data/lib/views/frontend/spree/checkout/_new_user.html.erb +1 -1
- data/lib/views/frontend/spree/checkout/registration.html.erb +4 -3
- data/lib/views/frontend/spree/users/edit.html.erb +4 -4
- data/spec/controllers/spree/checkout_controller_spec.rb +12 -2
- data/spec/controllers/spree/user_sessions_controller_spec.rb +20 -0
- data/spec/features/checkout_spec.rb +7 -9
- data/spec/features/order_spec.rb +2 -8
- data/spec/features/sign_out_spec.rb +1 -6
- data/spec/support/add_to_cart.rb +15 -0
- data/spree_auth_devise.gemspec +5 -4
- metadata +50 -29
- data/lib/views/frontend/spree/shared/_login.html.erb +0 -18
- /data/{lib/controllers/frontend → app/controllers}/spree/user_confirmations_controller.rb +0 -0
- /data/{lib/views/frontend → app/views}/spree/user_mailer/confirmation_instructions.text.erb +0 -0
- /data/{lib/views/frontend → app/views}/spree/user_mailer/reset_password_instructions.text.erb +0 -0
- /data/{lib/views/frontend → app/views}/spree/user_sessions/new.html.erb +0 -0
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
|
-
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
2
|
+
SHA256:
|
|
3
|
+
metadata.gz: 45307062e764620c14c90a2e46698079e68fcc2cf4a275c9b68b4dd7c440e235
|
|
4
|
+
data.tar.gz: 51a0e596192d24d194635e319ae70894d3d7ff9dcb098c7783c0b70f865f3a53
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 0467202177d333b27390f4f6fd025e54d8600dfa514419a93d8f9d836740928d7226f8f89a841c215cd5b7e7a83e266bd04f06af4bddd0e961c4faf12d7d944e
|
|
7
|
+
data.tar.gz: 9d362bd0a46360b6907526dfb50c193b2399551bcd64e7804a65521cc893fc50e49adaf01a7ac981530677dfab3db5345ae65a8f48eb835bd82d6a54378f9327
|
data/.travis.yml
CHANGED
data/Appraisals
CHANGED
data/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
## Spree Auth Devise v3.3.0 (unreleased)
|
|
2
2
|
|
|
3
|
-
* `Rails 5.1` support with `spree_extension` gem for
|
|
3
|
+
* `Rails 5.1` support with `spree_extension` gem for compatibility with all Rails version 4.2+
|
|
4
4
|
|
|
5
5
|
## Spree Auth Devise v3.2.0 (2017-06-15)
|
|
6
6
|
|
data/README.md
CHANGED
|
@@ -132,3 +132,14 @@ You need to do a quick one-time creation of a test application and then you can
|
|
|
132
132
|
Then run the rspec tests.
|
|
133
133
|
|
|
134
134
|
bundle exec rspec
|
|
135
|
+
|
|
136
|
+
About Spark Solutions
|
|
137
|
+
----------------------
|
|
138
|
+
[][spark]
|
|
139
|
+
|
|
140
|
+
Spree Auth Devise is maintained by [Spark Solutions Sp. z o.o.][spark].
|
|
141
|
+
|
|
142
|
+
We are passionate about open source software.
|
|
143
|
+
We are [available for hire][spark].
|
|
144
|
+
|
|
145
|
+
[spark]:http://sparksolutions.co?utm_source=github
|
|
@@ -6,6 +6,10 @@ class Spree::UserPasswordsController < Devise::PasswordsController
|
|
|
6
6
|
include Spree::Core::ControllerHelpers::Order
|
|
7
7
|
include Spree::Core::ControllerHelpers::Store
|
|
8
8
|
|
|
9
|
+
if defined?(SpreeI18n::ControllerLocaleHelper)
|
|
10
|
+
include SpreeI18n::ControllerLocaleHelper
|
|
11
|
+
end
|
|
12
|
+
|
|
9
13
|
# Overridden due to bug in Devise.
|
|
10
14
|
# respond_with resource, :location => new_session_path(resource_name)
|
|
11
15
|
# is generating bad url /session/new.user
|
|
@@ -6,6 +6,10 @@ class Spree::UserRegistrationsController < Devise::RegistrationsController
|
|
|
6
6
|
include Spree::Core::ControllerHelpers::Order
|
|
7
7
|
include Spree::Core::ControllerHelpers::Store
|
|
8
8
|
|
|
9
|
+
if defined?(SpreeI18n::ControllerLocaleHelper)
|
|
10
|
+
include SpreeI18n::ControllerLocaleHelper
|
|
11
|
+
end
|
|
12
|
+
|
|
9
13
|
before_action :check_permissions, only: [:edit, :update]
|
|
10
14
|
skip_before_action :require_no_authentication
|
|
11
15
|
|
|
@@ -6,6 +6,10 @@ class Spree::UserSessionsController < Devise::SessionsController
|
|
|
6
6
|
include Spree::Core::ControllerHelpers::Order
|
|
7
7
|
include Spree::Core::ControllerHelpers::Store
|
|
8
8
|
|
|
9
|
+
if defined?(SpreeI18n::ControllerLocaleHelper)
|
|
10
|
+
include SpreeI18n::ControllerLocaleHelper
|
|
11
|
+
end
|
|
12
|
+
|
|
9
13
|
def create
|
|
10
14
|
authenticate_spree_user!
|
|
11
15
|
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
<%= form_for Spree::User.new, :as => :spree_user, :url => spree.create_new_session_path do |f| %>
|
|
2
|
+
<div id="password-credentials">
|
|
3
|
+
<div class="form-group">
|
|
4
|
+
<%= f.label :email, Spree.t(:email) %>
|
|
5
|
+
<%= f.email_field :email, placeholder: "#{Spree.t(:email)}", :class => 'form-control', :tabindex => 1, autofocus: true %>
|
|
6
|
+
</div>
|
|
7
|
+
<div class="form-group">
|
|
8
|
+
<%= f.label :password, Spree.t(:password) %>
|
|
9
|
+
<%= f.password_field :password, placeholder: "#{Spree.t(:password)}", :class => 'form-control', :tabindex => 2 %>
|
|
10
|
+
</div>
|
|
11
|
+
</div>
|
|
12
|
+
<div>
|
|
13
|
+
<%= f.check_box :remember_me, :tabindex => 3 %>
|
|
14
|
+
<%= f.label :remember_me, Spree.t(:remember_me) %>
|
|
15
|
+
</div>
|
|
16
|
+
|
|
17
|
+
<div><%= f.submit Spree.t(:login), :class => 'btn btn-lg btn-success btn-block', :tabindex => 4 %></div>
|
|
18
|
+
<% end %>
|
|
@@ -1,13 +1,17 @@
|
|
|
1
1
|
<fieldset id="password-credentials">
|
|
2
2
|
<div class="form-group">
|
|
3
|
+
<%= f.label :email, Spree.t(:email), class: 'required', title: 'required' %>
|
|
3
4
|
<%= f.email_field :email, :class => 'form-control', :placeholder => Spree.t(:email) %>
|
|
4
5
|
</div>
|
|
5
6
|
<hr />
|
|
6
7
|
<div class="form-group">
|
|
8
|
+
<%= f.label :password, Spree.t(:password), class: 'required', title: 'required' %>
|
|
7
9
|
<%= f.password_field :password, :class => 'form-control', :placeholder => Spree.t(:password) %>
|
|
8
|
-
|
|
10
|
+
|
|
11
|
+
</div>
|
|
9
12
|
<div class="form-group">
|
|
13
|
+
<%= f.label :password_confirmation, Spree.t(:password_confirmation), class: 'required', title: 'required' %>
|
|
10
14
|
<%= f.password_field :password_confirmation, :class => 'form-control', :placeholder => Spree.t(:confirm_password) %>
|
|
11
|
-
</div>
|
|
15
|
+
</div>
|
|
12
16
|
</fieldset>
|
|
13
|
-
<div data-hook="signup_below_password_fields"></div>
|
|
17
|
+
<div data-hook="signup_below_password_fields"></div>
|
|
@@ -6,14 +6,14 @@
|
|
|
6
6
|
</div>
|
|
7
7
|
<div class="panel-body">
|
|
8
8
|
<%= form_for @spree_user, :as => :spree_user, :url => spree.update_password_path, :method => :put do |f| %>
|
|
9
|
-
<
|
|
9
|
+
<div class="form-group">
|
|
10
10
|
<%= f.label :password, Spree.t(:password) %>
|
|
11
11
|
<%= f.password_field :password, :class => "form-control" %>
|
|
12
|
-
</
|
|
13
|
-
<
|
|
12
|
+
</div>
|
|
13
|
+
<div class="form-group">
|
|
14
14
|
<%= f.label :password_confirmation, Spree.t(:confirm_password) %>
|
|
15
15
|
<%= f.password_field :password_confirmation, :class => "form-control" %>
|
|
16
|
-
</
|
|
16
|
+
</div>
|
|
17
17
|
<%= f.hidden_field :reset_password_token %>
|
|
18
18
|
<%= f.submit Spree.t(:update), :class => 'btn btn-lg btn-success btn-block' %>
|
|
19
19
|
<% end %>
|
|
@@ -8,13 +8,13 @@
|
|
|
8
8
|
<p><%= Spree.t(:instructions_to_reset_password) %></p>
|
|
9
9
|
|
|
10
10
|
<%= form_for Spree::User.new, :as => :spree_user, :url => spree.reset_password_path do |f| %>
|
|
11
|
-
<
|
|
11
|
+
<div class="form-group">
|
|
12
12
|
<%= f.label :email, Spree.t(:email) %>
|
|
13
13
|
<%= f.email_field :email, :class => "form-control" %>
|
|
14
|
-
</
|
|
15
|
-
<
|
|
14
|
+
</div>
|
|
15
|
+
<div>
|
|
16
16
|
<%= f.submit Spree.t(:reset_password), :class => 'btn btn-lg btn-success btn-block' %>
|
|
17
|
-
</
|
|
17
|
+
</div>
|
|
18
18
|
<% end %>
|
|
19
19
|
</div>
|
|
20
20
|
</div>
|
|
@@ -9,11 +9,11 @@
|
|
|
9
9
|
<%= form_for resource, :as => :spree_user, :url => spree.registration_path do |f| %>
|
|
10
10
|
<div data-hook="signup_inside_form">
|
|
11
11
|
<%= render :partial => 'spree/shared/user_form', :locals => { :f => f } %>
|
|
12
|
-
<
|
|
12
|
+
<div><%= f.submit Spree.t(:create), :class => 'btn btn-lg btn-success btn-block' %></div>
|
|
13
13
|
</div>
|
|
14
14
|
<% end %>
|
|
15
15
|
<div class="text-center">
|
|
16
|
-
<%= Spree.t(:or) %>
|
|
16
|
+
<%= Spree.t(:or) %>
|
|
17
17
|
<%= link_to Spree.t(:login_as_existing), spree.login_path %>
|
|
18
18
|
</div>
|
|
19
19
|
<div data-hook="login_extras"></div>
|
|
@@ -1,18 +1,14 @@
|
|
|
1
1
|
# Merges users orders to their account after sign in and sign up.
|
|
2
2
|
Warden::Manager.after_set_user except: :fetch do |user, auth, _opts|
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
token = auth.cookies.signed[:guest_token] || auth.cookies.signed[:token]
|
|
4
|
+
token_attr = Spree::Order.has_attribute?(:token) ? :token : :guest_token
|
|
5
5
|
|
|
6
6
|
if token.present? && user.is_a?(Spree::User)
|
|
7
|
-
Spree::Order.incomplete.where(
|
|
8
|
-
order.associate_user!(user)
|
|
9
|
-
end
|
|
10
|
-
elsif guest_token.present? && user.is_a?(Spree::User)
|
|
11
|
-
Spree::Order.incomplete.where(guest_token: guest_token, user_id: nil).each do |order|
|
|
7
|
+
Spree::Order.incomplete.where(token_attr => token, user_id: nil).each do |order|
|
|
12
8
|
order.associate_user!(user)
|
|
13
9
|
end
|
|
14
10
|
end
|
|
15
|
-
end
|
|
11
|
+
end
|
|
16
12
|
|
|
17
13
|
Warden::Manager.before_logout do |_user, auth, _opts|
|
|
18
14
|
auth.cookies.delete(:guest_token)
|
data/lib/spree_auth_devise.rb
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
<%= form_for @user, :as => :spree_user, :url => spree.registration_path(@user) do |f| %>
|
|
8
8
|
<div data-hook="signup_inside_form">
|
|
9
9
|
<%= render :partial => 'spree/shared/user_form', :locals => { :f => f } %>
|
|
10
|
-
<
|
|
10
|
+
<div><%= f.submit Spree.t(:create), :class => 'btn btn-lg btn-success btn-block' %></div>
|
|
11
11
|
</div>
|
|
12
12
|
<% end %>
|
|
13
13
|
<div class="text-center">
|
|
@@ -12,10 +12,11 @@
|
|
|
12
12
|
</div>
|
|
13
13
|
<div id="guest_checkout" class="panel-body" data-hook>
|
|
14
14
|
<%= form_for @order, :url => update_checkout_registration_path, :method => :put, :html => { :id => 'checkout_form_registration' } do |f| %>
|
|
15
|
-
<
|
|
15
|
+
<div class="form-group">
|
|
16
|
+
<%= f.label :email, Spree.t(:email), class: 'required', title: 'required' %>
|
|
16
17
|
<%= f.email_field :email, :class => 'form-control title', :placeholder => Spree.t(:email) %>
|
|
17
|
-
</
|
|
18
|
-
<
|
|
18
|
+
</div>
|
|
19
|
+
<div><%= f.submit Spree.t(:continue), :class => 'btn btn-lg btn-success btn-block' %></div>
|
|
19
20
|
<% end %>
|
|
20
21
|
</div>
|
|
21
22
|
</div>
|
|
@@ -5,13 +5,13 @@
|
|
|
5
5
|
</div>
|
|
6
6
|
<div class="panel-body">
|
|
7
7
|
<%= render :partial => 'spree/shared/error_messages', :locals => { :target => @user } %>
|
|
8
|
-
|
|
8
|
+
|
|
9
9
|
<%= form_for Spree::User.new, :as => @user, :url => spree.user_path(@user), :method => :put do |f| %>
|
|
10
10
|
<%= render :partial => 'spree/shared/user_form', :locals => { :f => f } %>
|
|
11
|
-
<
|
|
11
|
+
<div>
|
|
12
12
|
<%= f.submit Spree.t(:update), :class => 'btn btn-primary' %>
|
|
13
|
-
</
|
|
13
|
+
</div>
|
|
14
14
|
<% end %>
|
|
15
15
|
</div>
|
|
16
16
|
</div>
|
|
17
|
-
</div>
|
|
17
|
+
</div>
|
|
@@ -67,10 +67,20 @@ RSpec.describe Spree::CheckoutController, type: :controller do
|
|
|
67
67
|
end
|
|
68
68
|
|
|
69
69
|
context 'with a token' do
|
|
70
|
-
before
|
|
70
|
+
before do
|
|
71
|
+
if Spree.version.to_f > 3.6
|
|
72
|
+
allow(order).to receive(:token) { 'ABC' }
|
|
73
|
+
else
|
|
74
|
+
allow(order).to receive(:guest_token) { 'ABC' }
|
|
75
|
+
end
|
|
76
|
+
end
|
|
71
77
|
|
|
72
78
|
it 'redirects to the tokenized order view' do
|
|
73
|
-
|
|
79
|
+
if Spree.version.to_f > 3.6
|
|
80
|
+
request.cookie_jar.signed[:token] = 'ABC'
|
|
81
|
+
else
|
|
82
|
+
request.cookie_jar.signed[:guest_token] = 'ABC'
|
|
83
|
+
end
|
|
74
84
|
spree_post :update, { state: 'confirm' }
|
|
75
85
|
expect(response).to redirect_to spree.order_path(order)
|
|
76
86
|
expect(flash.notice).to eq Spree.t(:order_processed_successfully)
|
|
@@ -106,6 +106,26 @@ RSpec.describe Spree::UserSessionsController, type: :controller do
|
|
|
106
106
|
end
|
|
107
107
|
end
|
|
108
108
|
|
|
109
|
+
context 'with a guest_token from a pre-3.7 version of Spree present' do
|
|
110
|
+
before do
|
|
111
|
+
request.cookie_jar.signed[:guest_token] = 'ABC'
|
|
112
|
+
request.cookie_jar.signed[:token] = 'DEF'
|
|
113
|
+
end
|
|
114
|
+
|
|
115
|
+
it 'assigns the correct token attribute for the order' do
|
|
116
|
+
if Spree.version.to_f > 3.6
|
|
117
|
+
order = create(:order, email: user.email, token: 'ABC', user_id: nil, created_by_id: nil)
|
|
118
|
+
else
|
|
119
|
+
order = create(:order, email: user.email, guest_token: 'ABC', user_id: nil, created_by_id: nil)
|
|
120
|
+
end
|
|
121
|
+
spree_post :create, spree_user: { email: user.email, password: 'secret' }
|
|
122
|
+
|
|
123
|
+
order.reload
|
|
124
|
+
expect(order.user_id).to eq user.id
|
|
125
|
+
expect(order.created_by_id).to eq user.id
|
|
126
|
+
end
|
|
127
|
+
end
|
|
128
|
+
|
|
109
129
|
context "and html format is used" do
|
|
110
130
|
it "redirects to default after signing in" do
|
|
111
131
|
spree_post :create, spree_user: { email: user.email, password: 'secret' }
|
|
@@ -31,9 +31,7 @@ RSpec.feature 'Checkout', :js, type: :feature do
|
|
|
31
31
|
|
|
32
32
|
scenario 'allow a visitor to checkout as guest, without registration' do
|
|
33
33
|
Spree::Auth::Config.set(registration_step: true)
|
|
34
|
-
|
|
35
|
-
click_button 'Add To Cart'
|
|
36
|
-
within('h1') { expect(page).to have_text 'Shopping Cart' }
|
|
34
|
+
add_to_cart 'RoR Mug'
|
|
37
35
|
click_button 'Checkout'
|
|
38
36
|
|
|
39
37
|
expect(page).to have_content(/Checkout as a Guest/i)
|
|
@@ -60,13 +58,13 @@ RSpec.feature 'Checkout', :js, type: :feature do
|
|
|
60
58
|
|
|
61
59
|
scenario 'associate an uncompleted guest order with user after logging in' do
|
|
62
60
|
user = create(:user, email: 'email@person.com', password: 'password', password_confirmation: 'password')
|
|
63
|
-
|
|
64
|
-
click_button 'Add To Cart'
|
|
61
|
+
add_to_cart 'RoR Mug'
|
|
65
62
|
|
|
66
63
|
visit spree.login_path
|
|
67
64
|
fill_in 'Email', with: user.email
|
|
68
65
|
fill_in 'Password', with: user.password
|
|
69
66
|
click_button 'Login'
|
|
67
|
+
expect(page).to have_text('Cart')
|
|
70
68
|
click_link 'Cart'
|
|
71
69
|
|
|
72
70
|
expect(page).to have_text 'RoR Mug'
|
|
@@ -93,8 +91,7 @@ RSpec.feature 'Checkout', :js, type: :feature do
|
|
|
93
91
|
scenario 'associate an incomplete guest order with user after successful password reset' do
|
|
94
92
|
create(:store)
|
|
95
93
|
user = create(:user, email: 'email@person.com', password: 'password', password_confirmation: 'password')
|
|
96
|
-
|
|
97
|
-
click_button 'Add To Cart'
|
|
94
|
+
add_to_cart 'RoR Mug'
|
|
98
95
|
|
|
99
96
|
visit spree.login_path
|
|
100
97
|
click_link 'Forgot Password?'
|
|
@@ -112,7 +109,9 @@ RSpec.feature 'Checkout', :js, type: :feature do
|
|
|
112
109
|
fill_in 'Password Confirmation', with: 'password'
|
|
113
110
|
click_button 'Update'
|
|
114
111
|
|
|
112
|
+
expect(page).to have_text('Cart')
|
|
115
113
|
click_link 'Cart'
|
|
114
|
+
expect(page).to have_text('RoR Mug')
|
|
116
115
|
click_button 'Checkout'
|
|
117
116
|
|
|
118
117
|
str_addr = 'bill_address'
|
|
@@ -129,8 +128,7 @@ RSpec.feature 'Checkout', :js, type: :feature do
|
|
|
129
128
|
end
|
|
130
129
|
|
|
131
130
|
scenario 'allow a user to register during checkout' do
|
|
132
|
-
|
|
133
|
-
click_button 'Add To Cart'
|
|
131
|
+
add_to_cart 'RoR Mug'
|
|
134
132
|
click_button 'Checkout'
|
|
135
133
|
|
|
136
134
|
expect(page).to have_text 'Registration'
|
data/spec/features/order_spec.rb
CHANGED
|
@@ -17,10 +17,7 @@ RSpec.feature 'Orders', :js, type: :feature do
|
|
|
17
17
|
user = create(:user, email: 'email@person.com', password: 'password', password_confirmation: 'password')
|
|
18
18
|
|
|
19
19
|
using_session('first') do
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
click_link 'RoR Mug'
|
|
23
|
-
click_button 'Add To Cart'
|
|
20
|
+
add_to_cart 'RoR Mug'
|
|
24
21
|
|
|
25
22
|
visit spree.login_path
|
|
26
23
|
fill_in 'Email', with: user.email
|
|
@@ -32,10 +29,7 @@ RSpec.feature 'Orders', :js, type: :feature do
|
|
|
32
29
|
end
|
|
33
30
|
|
|
34
31
|
using_session('second') do
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
click_link 'RoR Shirt'
|
|
38
|
-
click_button 'Add To Cart'
|
|
32
|
+
add_to_cart 'RoR Shirt'
|
|
39
33
|
|
|
40
34
|
visit spree.login_path
|
|
41
35
|
fill_in 'Email', with: user.email
|
|
@@ -31,12 +31,7 @@ RSpec.feature 'Sign Out', type: :feature, js: true do
|
|
|
31
31
|
let!(:other_user) { create(:user) }
|
|
32
32
|
|
|
33
33
|
it 'clears token cookies' do
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
click_link 'RoR Mug'
|
|
37
|
-
click_button 'Add To Cart'
|
|
38
|
-
|
|
39
|
-
click_link 'Cart'
|
|
34
|
+
add_to_cart 'RoR Mug'
|
|
40
35
|
expect(page).to have_text 'RoR Mug'
|
|
41
36
|
|
|
42
37
|
click_link 'Logout'
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
def add_to_cart(product_name)
|
|
2
|
+
visit spree.root_path
|
|
3
|
+
click_link product_name
|
|
4
|
+
if Spree.version.to_f > 3.6
|
|
5
|
+
expect(page).to have_selector('form#add-to-cart-form')
|
|
6
|
+
expect(page).to have_selector('button#add-to-cart-button')
|
|
7
|
+
wait_for_condition do
|
|
8
|
+
expect(page.find('#add-to-cart-button').disabled?).to eq(false)
|
|
9
|
+
end
|
|
10
|
+
end
|
|
11
|
+
click_button 'Add To Cart'
|
|
12
|
+
wait_for_condition do
|
|
13
|
+
expect(page).to have_content(Spree.t(:shopping_cart))
|
|
14
|
+
end
|
|
15
|
+
end
|
data/spree_auth_devise.gemspec
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
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.
|
|
6
|
+
s.version = '3.5.2'
|
|
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
|
|
|
@@ -19,7 +19,7 @@ Gem::Specification.new do |s|
|
|
|
19
19
|
s.require_path = 'lib'
|
|
20
20
|
s.requirements << 'none'
|
|
21
21
|
|
|
22
|
-
s.add_dependency 'devise', '
|
|
22
|
+
s.add_dependency 'devise', '>= 4.4', '< 4.7'
|
|
23
23
|
s.add_dependency 'devise-encryptable', '0.2.0'
|
|
24
24
|
|
|
25
25
|
spree_version = '>= 3.1.0', '< 4.0'
|
|
@@ -29,13 +29,14 @@ Gem::Specification.new do |s|
|
|
|
29
29
|
s.add_development_dependency 'capybara', '~> 2.7'
|
|
30
30
|
s.add_development_dependency 'capybara-screenshot'
|
|
31
31
|
s.add_development_dependency 'coffee-rails', '~> 4.2'
|
|
32
|
+
s.add_development_dependency 'sass-rails'
|
|
32
33
|
s.add_development_dependency 'database_cleaner', '~> 1.5'
|
|
33
34
|
s.add_development_dependency 'email_spec', '~> 2.1'
|
|
34
35
|
s.add_development_dependency 'factory_bot', '~> 4.7'
|
|
35
36
|
s.add_development_dependency 'ffaker'
|
|
36
37
|
s.add_development_dependency 'launchy'
|
|
37
|
-
s.add_development_dependency 'mysql2'
|
|
38
|
-
s.add_development_dependency 'pg'
|
|
38
|
+
s.add_development_dependency 'mysql2'
|
|
39
|
+
s.add_development_dependency 'pg'
|
|
39
40
|
s.add_development_dependency 'selenium-webdriver'
|
|
40
41
|
s.add_development_dependency 'pry'
|
|
41
42
|
s.add_development_dependency 'rspec-rails', '~> 3.5'
|
metadata
CHANGED
|
@@ -1,29 +1,35 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: spree_auth_devise
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 3.
|
|
4
|
+
version: 3.5.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Sean Schofield
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2019-07-03 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: devise
|
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
|
16
16
|
requirements:
|
|
17
|
-
- - "
|
|
17
|
+
- - ">="
|
|
18
18
|
- !ruby/object:Gem::Version
|
|
19
|
-
version: 4.4
|
|
19
|
+
version: '4.4'
|
|
20
|
+
- - "<"
|
|
21
|
+
- !ruby/object:Gem::Version
|
|
22
|
+
version: '4.7'
|
|
20
23
|
type: :runtime
|
|
21
24
|
prerelease: false
|
|
22
25
|
version_requirements: !ruby/object:Gem::Requirement
|
|
23
26
|
requirements:
|
|
24
|
-
- - "
|
|
27
|
+
- - ">="
|
|
28
|
+
- !ruby/object:Gem::Version
|
|
29
|
+
version: '4.4'
|
|
30
|
+
- - "<"
|
|
25
31
|
- !ruby/object:Gem::Version
|
|
26
|
-
version: 4.
|
|
32
|
+
version: '4.7'
|
|
27
33
|
- !ruby/object:Gem::Dependency
|
|
28
34
|
name: devise-encryptable
|
|
29
35
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -114,6 +120,20 @@ dependencies:
|
|
|
114
120
|
- - "~>"
|
|
115
121
|
- !ruby/object:Gem::Version
|
|
116
122
|
version: '4.2'
|
|
123
|
+
- !ruby/object:Gem::Dependency
|
|
124
|
+
name: sass-rails
|
|
125
|
+
requirement: !ruby/object:Gem::Requirement
|
|
126
|
+
requirements:
|
|
127
|
+
- - ">="
|
|
128
|
+
- !ruby/object:Gem::Version
|
|
129
|
+
version: '0'
|
|
130
|
+
type: :development
|
|
131
|
+
prerelease: false
|
|
132
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
133
|
+
requirements:
|
|
134
|
+
- - ">="
|
|
135
|
+
- !ruby/object:Gem::Version
|
|
136
|
+
version: '0'
|
|
117
137
|
- !ruby/object:Gem::Dependency
|
|
118
138
|
name: database_cleaner
|
|
119
139
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -188,30 +208,30 @@ dependencies:
|
|
|
188
208
|
name: mysql2
|
|
189
209
|
requirement: !ruby/object:Gem::Requirement
|
|
190
210
|
requirements:
|
|
191
|
-
- - "
|
|
211
|
+
- - ">="
|
|
192
212
|
- !ruby/object:Gem::Version
|
|
193
|
-
version: 0
|
|
213
|
+
version: '0'
|
|
194
214
|
type: :development
|
|
195
215
|
prerelease: false
|
|
196
216
|
version_requirements: !ruby/object:Gem::Requirement
|
|
197
217
|
requirements:
|
|
198
|
-
- - "
|
|
218
|
+
- - ">="
|
|
199
219
|
- !ruby/object:Gem::Version
|
|
200
|
-
version: 0
|
|
220
|
+
version: '0'
|
|
201
221
|
- !ruby/object:Gem::Dependency
|
|
202
222
|
name: pg
|
|
203
223
|
requirement: !ruby/object:Gem::Requirement
|
|
204
224
|
requirements:
|
|
205
|
-
- - "
|
|
225
|
+
- - ">="
|
|
206
226
|
- !ruby/object:Gem::Version
|
|
207
|
-
version: '0
|
|
227
|
+
version: '0'
|
|
208
228
|
type: :development
|
|
209
229
|
prerelease: false
|
|
210
230
|
version_requirements: !ruby/object:Gem::Requirement
|
|
211
231
|
requirements:
|
|
212
|
-
- - "
|
|
232
|
+
- - ">="
|
|
213
233
|
- !ruby/object:Gem::Version
|
|
214
|
-
version: '0
|
|
234
|
+
version: '0'
|
|
215
235
|
- !ruby/object:Gem::Dependency
|
|
216
236
|
name: selenium-webdriver
|
|
217
237
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -367,11 +387,23 @@ files:
|
|
|
367
387
|
- README.md
|
|
368
388
|
- Rakefile
|
|
369
389
|
- app/controllers/metal_decorator.rb
|
|
390
|
+
- app/controllers/spree/user_confirmations_controller.rb
|
|
391
|
+
- app/controllers/spree/user_passwords_controller.rb
|
|
392
|
+
- app/controllers/spree/user_registrations_controller.rb
|
|
393
|
+
- app/controllers/spree/user_sessions_controller.rb
|
|
370
394
|
- app/mailers/spree/user_mailer.rb
|
|
371
395
|
- app/models/spree/auth_configuration.rb
|
|
372
396
|
- app/models/spree/user.rb
|
|
373
397
|
- app/overrides/auth_shared_login_bar.rb
|
|
374
398
|
- app/overrides/spree/admin/shared/_header/auth_admin_login_navigation_bar.html.erb.deface
|
|
399
|
+
- app/views/spree/shared/_login.html.erb
|
|
400
|
+
- app/views/spree/shared/_user_form.html.erb
|
|
401
|
+
- app/views/spree/user_mailer/confirmation_instructions.text.erb
|
|
402
|
+
- app/views/spree/user_mailer/reset_password_instructions.text.erb
|
|
403
|
+
- app/views/spree/user_passwords/edit.html.erb
|
|
404
|
+
- app/views/spree/user_passwords/new.html.erb
|
|
405
|
+
- app/views/spree/user_registrations/new.html.erb
|
|
406
|
+
- app/views/spree/user_sessions/new.html.erb
|
|
375
407
|
- bin/rails
|
|
376
408
|
- config.ru
|
|
377
409
|
- config/initializers/devise.rb
|
|
@@ -399,7 +431,7 @@ files:
|
|
|
399
431
|
- db/seeds.rb
|
|
400
432
|
- gemfiles/spree_3_2.gemfile
|
|
401
433
|
- gemfiles/spree_3_5.gemfile
|
|
402
|
-
- gemfiles/
|
|
434
|
+
- gemfiles/spree_3_7.gemfile
|
|
403
435
|
- gemfiles/spree_master.gemfile
|
|
404
436
|
- lib/assets/javascripts/spree/backend/spree_auth.js.erb
|
|
405
437
|
- lib/assets/javascripts/spree/frontend/account.js
|
|
@@ -414,10 +446,6 @@ files:
|
|
|
414
446
|
- lib/controllers/backend/spree/admin/user_sessions_controller.rb
|
|
415
447
|
- lib/controllers/frontend/spree/checkout_controller_decorator.rb
|
|
416
448
|
- lib/controllers/frontend/spree/store_controller_decorator.rb
|
|
417
|
-
- lib/controllers/frontend/spree/user_confirmations_controller.rb
|
|
418
|
-
- lib/controllers/frontend/spree/user_passwords_controller.rb
|
|
419
|
-
- lib/controllers/frontend/spree/user_registrations_controller.rb
|
|
420
|
-
- lib/controllers/frontend/spree/user_sessions_controller.rb
|
|
421
449
|
- lib/controllers/frontend/spree/users_controller.rb
|
|
422
450
|
- lib/generators/spree/auth/install/install_generator.rb
|
|
423
451
|
- lib/generators/spree/auth/install/templates/config/initializers/devise.rb
|
|
@@ -437,15 +465,7 @@ files:
|
|
|
437
465
|
- lib/views/frontend/spree/checkout/registration.html.erb
|
|
438
466
|
- lib/views/frontend/spree/shared/_flashes.html.erb
|
|
439
467
|
- lib/views/frontend/spree/shared/_link_to_account.html.erb
|
|
440
|
-
- lib/views/frontend/spree/shared/_login.html.erb
|
|
441
468
|
- lib/views/frontend/spree/shared/_login_bar.html.erb
|
|
442
|
-
- lib/views/frontend/spree/shared/_user_form.html.erb
|
|
443
|
-
- lib/views/frontend/spree/user_mailer/confirmation_instructions.text.erb
|
|
444
|
-
- lib/views/frontend/spree/user_mailer/reset_password_instructions.text.erb
|
|
445
|
-
- lib/views/frontend/spree/user_passwords/edit.html.erb
|
|
446
|
-
- lib/views/frontend/spree/user_passwords/new.html.erb
|
|
447
|
-
- lib/views/frontend/spree/user_registrations/new.html.erb
|
|
448
|
-
- lib/views/frontend/spree/user_sessions/new.html.erb
|
|
449
469
|
- lib/views/frontend/spree/users/edit.html.erb
|
|
450
470
|
- lib/views/frontend/spree/users/show.html.erb
|
|
451
471
|
- spec/controllers/spree/admin/orders_controller_spec.rb
|
|
@@ -477,6 +497,7 @@ files:
|
|
|
477
497
|
- spec/models/user_spec.rb
|
|
478
498
|
- spec/spec_helper.rb
|
|
479
499
|
- spec/support/ability.rb
|
|
500
|
+
- spec/support/add_to_cart.rb
|
|
480
501
|
- spec/support/authentication_helpers.rb
|
|
481
502
|
- spec/support/cache_helpers.rb
|
|
482
503
|
- spec/support/capybara.rb
|
|
@@ -508,8 +529,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
508
529
|
version: '0'
|
|
509
530
|
requirements:
|
|
510
531
|
- none
|
|
511
|
-
|
|
512
|
-
rubygems_version: 2.6.10
|
|
532
|
+
rubygems_version: 3.0.2
|
|
513
533
|
signing_key:
|
|
514
534
|
specification_version: 4
|
|
515
535
|
summary: Provides authentication and authorization services for use with Spree by
|
|
@@ -544,6 +564,7 @@ test_files:
|
|
|
544
564
|
- spec/models/user_spec.rb
|
|
545
565
|
- spec/spec_helper.rb
|
|
546
566
|
- spec/support/ability.rb
|
|
567
|
+
- spec/support/add_to_cart.rb
|
|
547
568
|
- spec/support/authentication_helpers.rb
|
|
548
569
|
- spec/support/cache_helpers.rb
|
|
549
570
|
- spec/support/capybara.rb
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
<%= form_for Spree::User.new, :as => :spree_user, :url => spree.create_new_session_path do |f| %>
|
|
2
|
-
<div id="password-credentials">
|
|
3
|
-
<p>
|
|
4
|
-
<%= f.label :email, Spree.t(:email) %>
|
|
5
|
-
<%= f.email_field :email, :class => 'form-control', :tabindex => 1, autofocus: true %>
|
|
6
|
-
</p>
|
|
7
|
-
<p>
|
|
8
|
-
<%= f.label :password, Spree.t(:password) %>
|
|
9
|
-
<%= f.password_field :password, :class => 'form-control', :tabindex => 2 %>
|
|
10
|
-
</p>
|
|
11
|
-
</div>
|
|
12
|
-
<p>
|
|
13
|
-
<%= f.check_box :remember_me, :tabindex => 3 %>
|
|
14
|
-
<%= f.label :remember_me, Spree.t(:remember_me) %>
|
|
15
|
-
</p>
|
|
16
|
-
|
|
17
|
-
<p><%= f.submit Spree.t(:login), :class => 'btn btn-lg btn-success btn-block', :tabindex => 4 %></p>
|
|
18
|
-
<% end %>
|
|
File without changes
|
|
File without changes
|
/data/{lib/views/frontend → app/views}/spree/user_mailer/reset_password_instructions.text.erb
RENAMED
|
File without changes
|
|
File without changes
|