spree_auth_devise 4.0.0 → 4.3.1
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.
Potentially problematic release.
This version of spree_auth_devise might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/.circleci/config.yml +41 -0
- data/.gitignore +1 -0
- data/.travis.yml +33 -37
- data/Appraisals +3 -14
- data/Gemfile +1 -1
- data/README.md +3 -12
- data/Rakefile +9 -3
- data/app/controllers/spree/api/v2/storefront/account_confirmations_controller.rb +20 -0
- data/app/controllers/spree/api/v2/storefront/passwords_controller.rb +35 -0
- data/app/controllers/spree/user_confirmations_controller.rb +38 -0
- data/app/controllers/spree/user_passwords_controller.rb +9 -1
- data/app/controllers/spree/user_registrations_controller.rb +34 -1
- data/app/controllers/spree/user_sessions_controller.rb +23 -1
- data/app/mailers/spree/user_mailer.rb +11 -4
- data/app/models/spree/user.rb +42 -0
- data/app/services/spree/account/create.rb +19 -0
- data/app/services/spree/account/update.rb +17 -0
- data/app/views/spree/user_mailer/confirmation_instructions.html.erb +20 -0
- data/app/views/spree/user_mailer/confirmation_instructions.text.erb +8 -5
- data/app/views/spree/user_mailer/reset_password_instructions.html.erb +20 -0
- data/app/views/spree/user_mailer/reset_password_instructions.text.erb +7 -5
- data/app/views/spree/user_passwords/edit.html.erb +20 -17
- data/app/views/spree/user_passwords/new.html.erb +17 -15
- data/app/views/spree/user_registrations/new.html.erb +12 -17
- data/app/views/spree/user_sessions/new.html.erb +11 -12
- data/config/locales/de.yml +16 -0
- data/config/locales/en.yml +21 -6
- data/config/locales/zh-TW.yml +58 -0
- data/config/routes.rb +12 -3
- data/db/migrate/20120203010234_add_reset_password_sent_at_to_spree_users.rb +2 -2
- data/gemfiles/{spree_3_2.gemfile → spree_4_1.gemfile} +1 -1
- data/lib/controllers/api/spree/api/v2/storefront/account_controller_decorator.rb +41 -0
- data/lib/controllers/frontend/spree/checkout_controller_decorator.rb +3 -2
- data/lib/controllers/frontend/spree/users_controller.rb +4 -4
- data/lib/generators/spree/auth/install/install_generator.rb +0 -4
- data/lib/spree/auth/engine.rb +14 -1
- data/lib/spree/testing_support/auth_helpers.rb +36 -0
- data/lib/spree/testing_support/checkout_helpers.rb +24 -0
- data/lib/spree_auth_devise.rb +0 -1
- data/lib/views/backend/spree/admin/user_passwords/new.html.erb +1 -1
- data/lib/views/backend/spree/admin/user_sessions/new.html.erb +1 -1
- data/spec/controllers/spree/admin/orders_controller_spec.rb +1 -1
- data/spec/controllers/spree/admin/user_sessions_controller_spec.rb +1 -1
- data/spec/controllers/spree/api/v2/storefront/passwords_controller_spec.rb +63 -0
- data/spec/controllers/spree/checkout_controller_spec.rb +12 -13
- data/spec/controllers/spree/products_controller_spec.rb +1 -1
- data/spec/controllers/spree/user_passwords_controller_spec.rb +4 -4
- data/spec/controllers/spree/user_registrations_controller_spec.rb +8 -8
- data/spec/controllers/spree/user_sessions_controller_spec.rb +17 -17
- data/spec/controllers/spree/users_controller_spec.rb +4 -4
- data/spec/features/account_spec.rb +10 -8
- data/spec/features/admin/password_reset_spec.rb +2 -4
- data/spec/features/admin/sign_in_spec.rb +13 -9
- data/spec/features/admin/sign_out_spec.rb +1 -1
- data/spec/features/admin_permissions_spec.rb +1 -1
- data/spec/features/change_email_spec.rb +1 -7
- data/spec/features/checkout_spec.rb +40 -65
- data/spec/features/confirmation_spec.rb +4 -6
- data/spec/features/order_spec.rb +9 -15
- data/spec/features/password_reset_spec.rb +2 -4
- data/spec/features/sign_in_spec.rb +21 -17
- data/spec/features/sign_out_spec.rb +14 -23
- data/spec/features/sign_up_spec.rb +6 -4
- data/spec/mailers/user_mailer_spec.rb +4 -4
- data/spec/models/user_spec.rb +10 -8
- data/spec/requests/spree/api/v2/storefront/account_confirmation_spec.rb +48 -0
- data/spec/requests/spree/api/v2/storefront/account_spec.rb +101 -0
- data/spec/spec_helper.rb +7 -22
- data/spree_auth_devise.gemspec +14 -27
- metadata +35 -337
- data/app/overrides/auth_shared_login_bar.rb +0 -6
- data/app/overrides/spree/admin/shared/_header/auth_admin_login_navigation_bar.html.erb.deface +0 -4
- data/app/views/spree/shared/_login.html.erb +0 -18
- data/app/views/spree/shared/_user_form.html.erb +0 -17
- data/gemfiles/spree_3_5.gemfile +0 -8
- data/gemfiles/spree_3_7.gemfile +0 -9
- data/gemfiles/spree_4_0.gemfile +0 -8
- data/lib/assets/javascripts/spree/backend/spree_auth.js.erb +0 -1
- data/lib/assets/javascripts/spree/frontend/account.js +0 -8
- data/lib/assets/javascripts/spree/frontend/spree_auth.js.erb +0 -2
- data/lib/assets/stylesheets/spree/backend/spree_auth.css.erb +0 -3
- data/lib/assets/stylesheets/spree/frontend/spree_auth.css.erb +0 -3
- data/lib/controllers/frontend/spree/store_controller_decorator.rb +0 -7
- data/lib/views/frontend/spree/checkout/_new_user.html.erb +0 -20
- data/lib/views/frontend/spree/checkout/registration.html.erb +0 -25
- data/lib/views/frontend/spree/shared/_link_to_account.html.erb +0 -6
- data/lib/views/frontend/spree/users/edit.html.erb +0 -17
- data/lib/views/frontend/spree/users/show.html.erb +0 -48
- data/spec/support/add_to_cart.rb +0 -15
- data/spec/support/authentication_helpers.rb +0 -14
- data/spec/support/cache_helpers.rb +0 -5
- data/spec/support/capybara.rb +0 -16
- data/spec/support/database_cleaner.rb +0 -17
- data/spec/support/factory_girl.rb +0 -5
- data/spec/support/spree.rb +0 -10
@@ -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 class="form-check">
|
13
|
-
<%= f.check_box :remember_me, :tabindex => 3, :class => 'form-check-input' %>
|
14
|
-
<%= f.label :remember_me, Spree.t(:remember_me), :class => 'form-check-label' %>
|
15
|
-
</p>
|
16
|
-
|
17
|
-
<p><%= f.submit Spree.t(:login), :class => 'btn btn-lg btn-success btn-block', :tabindex => 4 %></p>
|
18
|
-
<% end %>
|
@@ -1,17 +0,0 @@
|
|
1
|
-
<fieldset id="password-credentials">
|
2
|
-
<div class="form-group">
|
3
|
-
<%= f.label :email, Spree.t(:email), class: 'required', title: 'required' %>
|
4
|
-
<%= f.email_field :email, :class => 'form-control', :placeholder => Spree.t(:email) %>
|
5
|
-
</div>
|
6
|
-
<hr />
|
7
|
-
<div class="form-group">
|
8
|
-
<%= f.label :password, Spree.t(:password), class: 'required', title: 'required' %>
|
9
|
-
<%= f.password_field :password, :class => 'form-control', :placeholder => Spree.t(:password) %>
|
10
|
-
|
11
|
-
</div>
|
12
|
-
<div class="form-group">
|
13
|
-
<%= f.label :password_confirmation, Spree.t(:password_confirmation), class: 'required', title: 'required' %>
|
14
|
-
<%= f.password_field :password_confirmation, :class => 'form-control', :placeholder => Spree.t(:confirm_password) %>
|
15
|
-
</div>
|
16
|
-
</fieldset>
|
17
|
-
<div data-hook="signup_below_password_fields"></div>
|
data/gemfiles/spree_3_5.gemfile
DELETED
data/gemfiles/spree_3_7.gemfile
DELETED
data/gemfiles/spree_4_0.gemfile
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
//= require spree/backend
|
@@ -1,20 +0,0 @@
|
|
1
|
-
<div>
|
2
|
-
<div class="card mb-3">
|
3
|
-
<div class="card-header">
|
4
|
-
<h3 class="card-title mb-0 h6"><%= Spree.t(:create_a_new_account) %></h3>
|
5
|
-
</div>
|
6
|
-
<div id="new-customer" class="card-body" data-hook="login">
|
7
|
-
<%= form_for @user, :as => :spree_user, :url => spree.registration_path(@user) do |f| %>
|
8
|
-
<div data-hook="signup_inside_form">
|
9
|
-
<%= render :partial => 'spree/shared/user_form', :locals => { :f => f } %>
|
10
|
-
<div><%= f.submit Spree.t(:create), :class => 'btn btn-lg btn-success btn-block' %></div>
|
11
|
-
</div>
|
12
|
-
<% end %>
|
13
|
-
<div class="text-center">
|
14
|
-
<%= Spree.t(:or) %>
|
15
|
-
<%= link_to Spree.t(:login_as_existing), spree.login_path %>
|
16
|
-
</div>
|
17
|
-
<div data-hook="login_extras"></div>
|
18
|
-
</div>
|
19
|
-
</div>
|
20
|
-
</div>
|
@@ -1,25 +0,0 @@
|
|
1
|
-
<%= render :partial => 'spree/shared/error_messages', :locals => { :target => @user } %>
|
2
|
-
<h1><%= Spree.t(:registration) %></h1>
|
3
|
-
<div id="registration" class="row" data-hook>
|
4
|
-
<div id="account" class="col-lg-6">
|
5
|
-
<%= render :partial => 'new_user' %>
|
6
|
-
</div>
|
7
|
-
<% if Spree::Config[:allow_guest_checkout] %>
|
8
|
-
<div class="col-lg-6">
|
9
|
-
<div class="card mb-3">
|
10
|
-
<div class="card-header">
|
11
|
-
<h3 class="card-title mb-0 h6"><%= Spree.t(:guest_user_account) %></h3>
|
12
|
-
</div>
|
13
|
-
<div id="guest_checkout" class="card-body" data-hook>
|
14
|
-
<%= form_for @order, :url => update_checkout_registration_path, :method => :put, :html => { :id => 'checkout_form_registration' } do |f| %>
|
15
|
-
<div class="form-group">
|
16
|
-
<%= f.label :email, Spree.t(:email), class: 'required', title: 'required' %>
|
17
|
-
<%= f.email_field :email, :class => 'form-control title', :placeholder => Spree.t(:email) %>
|
18
|
-
</div>
|
19
|
-
<div><%= f.submit Spree.t(:continue), :class => 'btn btn-lg btn-success btn-block' %></div>
|
20
|
-
<% end %>
|
21
|
-
</div>
|
22
|
-
</div>
|
23
|
-
</div>
|
24
|
-
<% end %>
|
25
|
-
</div>
|
@@ -1,6 +0,0 @@
|
|
1
|
-
<% if spree_current_user %>
|
2
|
-
<li class="nav-item"><%= link_to Spree.t(:my_account), spree.account_path, :class => 'nav-link text-white' %></li>
|
3
|
-
<li class="nav-item"><%= link_to Spree.t(:logout), spree.logout_path, :class => 'nav-link text-white' %></li>
|
4
|
-
<% else %>
|
5
|
-
<li id="link-to-login" class="nav-item"><%= link_to Spree.t(:login), spree.login_path, :class => 'nav-link text-white' %></li>
|
6
|
-
<% end %>
|
@@ -1,17 +0,0 @@
|
|
1
|
-
<div class="col-lg-6 offset-lg-3">
|
2
|
-
<div class="card mb-3">
|
3
|
-
<div class="card-header">
|
4
|
-
<h3 class="card-title mb-0 h6"><%= Spree.t(:editing_user) %></h3>
|
5
|
-
</div>
|
6
|
-
<div class="card-body">
|
7
|
-
<%= render :partial => 'spree/shared/error_messages', :locals => { :target => @user } %>
|
8
|
-
|
9
|
-
<%= form_for Spree::User.new, :as => @user, :url => spree.user_path(@user), :method => :put do |f| %>
|
10
|
-
<%= render :partial => 'spree/shared/user_form', :locals => { :f => f } %>
|
11
|
-
<div>
|
12
|
-
<%= f.submit Spree.t(:update), :class => 'btn btn-primary' %>
|
13
|
-
</div>
|
14
|
-
<% end %>
|
15
|
-
</div>
|
16
|
-
</div>
|
17
|
-
</div>
|
@@ -1,48 +0,0 @@
|
|
1
|
-
<h1><%= accurate_title %></h1>
|
2
|
-
|
3
|
-
<div data-hook="account_summary" class="account-summary card bg-light mb-3">
|
4
|
-
<dl id="user-info" class="card-body">
|
5
|
-
<dt><%= Spree.t(:email) %></dt>
|
6
|
-
<dd><%= @user.email %> (<%= link_to Spree.t(:edit), spree.edit_account_path %>)</dd>
|
7
|
-
<br />
|
8
|
-
<dt><%= Spree.t(:credit_balance, scope: [:store_credits])%></dt>
|
9
|
-
<dd>
|
10
|
-
<%= Spree::Money.new(spree_current_user.total_available_store_credit, currency: Spree::Config[:currency]) %>
|
11
|
-
</dd>
|
12
|
-
</dl>
|
13
|
-
</div>
|
14
|
-
|
15
|
-
<div data-hook="account_my_orders" class="account-my-orders">
|
16
|
-
|
17
|
-
<h3><%= Spree.t(:my_orders) %></h3>
|
18
|
-
<% if @orders.present? %>
|
19
|
-
<table class="table table-striped order-summary">
|
20
|
-
<thead class="active">
|
21
|
-
<tr>
|
22
|
-
<th class="order-number"><%= Spree::Order.human_attribute_name(:number) %></th>
|
23
|
-
<th class="order-date"><%= Spree.t(:date) %></th>
|
24
|
-
<th class="order-status"><%= Spree.t(:status) %></th>
|
25
|
-
<th class="order-payment-state"><%= Spree.t(:payment_state) %></th>
|
26
|
-
<th class="order-shipment-state"><%= Spree.t(:shipment_state) %></th>
|
27
|
-
<th class="order-total"><%= Spree.t(:total) %></th>
|
28
|
-
</tr>
|
29
|
-
</thead>
|
30
|
-
<tbody>
|
31
|
-
<% @orders.each do |order| %>
|
32
|
-
<tr>
|
33
|
-
<td class="order-number"><%= link_to order.number, order_url(order) %></td>
|
34
|
-
<td class="order-date"><%= l order.completed_at.to_date %></td>
|
35
|
-
<td class="order-status"><%= Spree.t("order_state.#{order.state}").titleize %></td>
|
36
|
-
<td class="order-payment-state"><%= Spree.t("payment_states.#{order.payment_state}").titleize if order.payment_state %></td>
|
37
|
-
<td class="order-shipment-state"><%= Spree.t("shipment_states.#{order.shipment_state}").titleize if order.shipment_state %></td>
|
38
|
-
<td class="lead text-primary order-total"><%= order.display_total %></td>
|
39
|
-
</tr>
|
40
|
-
<% end %>
|
41
|
-
</tbody>
|
42
|
-
</table>
|
43
|
-
<% else %>
|
44
|
-
<div class="alert alert-info" role="alert"><%= Spree.t(:you_have_no_orders_yet) %></div>
|
45
|
-
<% end %>
|
46
|
-
<br />
|
47
|
-
|
48
|
-
</div>
|
data/spec/support/add_to_cart.rb
DELETED
@@ -1,15 +0,0 @@
|
|
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
|
@@ -1,14 +0,0 @@
|
|
1
|
-
module AuthenticationHelpers
|
2
|
-
def sign_in_as!(user)
|
3
|
-
visit '/login'
|
4
|
-
fill_in 'Email', with: user.email
|
5
|
-
fill_in 'Password', with: 'secret'
|
6
|
-
click_button 'Login'
|
7
|
-
end
|
8
|
-
end
|
9
|
-
|
10
|
-
RSpec.configure do |config|
|
11
|
-
config.include AuthenticationHelpers, type: :feature
|
12
|
-
config.include Devise::Test::ControllerHelpers, type: :controller
|
13
|
-
config.include Rack::Test::Methods, type: :feature
|
14
|
-
end
|
data/spec/support/capybara.rb
DELETED
@@ -1,16 +0,0 @@
|
|
1
|
-
require 'capybara/rspec'
|
2
|
-
require 'capybara/rails'
|
3
|
-
require 'capybara-screenshot/rspec'
|
4
|
-
require 'selenium-webdriver'
|
5
|
-
|
6
|
-
RSpec.configure do |_config|
|
7
|
-
Capybara.save_and_open_page_path = ENV['CIRCLE_ARTIFACTS'] if ENV['CIRCLE_ARTIFACTS']
|
8
|
-
|
9
|
-
Capybara.register_driver :chrome do |app|
|
10
|
-
Capybara::Selenium::Driver.new app,
|
11
|
-
browser: :chrome,
|
12
|
-
options: Selenium::WebDriver::Chrome::Options.new(args: %w[disable-popup-blocking headless disable-gpu window-size=1920,1080])
|
13
|
-
end
|
14
|
-
|
15
|
-
Capybara.javascript_driver = :chrome
|
16
|
-
end
|
@@ -1,17 +0,0 @@
|
|
1
|
-
require 'database_cleaner'
|
2
|
-
|
3
|
-
RSpec.configure do |config|
|
4
|
-
config.before(:suite) do
|
5
|
-
DatabaseCleaner.strategy = :transaction
|
6
|
-
DatabaseCleaner.clean_with :truncation
|
7
|
-
end
|
8
|
-
|
9
|
-
config.before(:each) do
|
10
|
-
DatabaseCleaner.strategy = RSpec.current_example.metadata[:js] ? :truncation : :transaction
|
11
|
-
DatabaseCleaner.start
|
12
|
-
end
|
13
|
-
|
14
|
-
config.after(:each) do
|
15
|
-
DatabaseCleaner.clean
|
16
|
-
end
|
17
|
-
end
|
data/spec/support/spree.rb
DELETED
@@ -1,10 +0,0 @@
|
|
1
|
-
require 'spree/testing_support/factories'
|
2
|
-
require 'spree/testing_support/url_helpers'
|
3
|
-
require 'spree/testing_support/controller_requests'
|
4
|
-
require 'spree/testing_support/authorization_helpers'
|
5
|
-
require 'spree/testing_support/capybara_ext'
|
6
|
-
|
7
|
-
RSpec.configure do |config|
|
8
|
-
config.include Spree::TestingSupport::UrlHelpers
|
9
|
-
config.include Spree::TestingSupport::ControllerRequests, type: :controller
|
10
|
-
end
|