File tree Expand file tree Collapse file tree
lib/controllers/backend/spree/admin Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -35,6 +35,10 @@ def authorization_failure
3535
3636 private
3737
38+ def signed_in_root_path ( _resource )
39+ spree . admin_path
40+ end
41+
3842 # NOTE: as soon as this gem stops supporting Solidus 3.1 if-else should be removed and left only include
3943 if defined? ( ::Spree ::Admin ::SetsUserLanguageLocaleKey )
4044 include ::Spree ::Admin ::SetsUserLanguageLocaleKey
Original file line number Diff line number Diff line change 1+ # frozen_string_literal: true
2+
3+ RSpec . describe Spree ::Admin ::UserSessionsController , type : :controller do
4+ let ( :user ) { create ( :user , password : 'secret' ) }
5+
6+ before { @request . env [ 'devise.mapping' ] = Devise . mappings [ :spree_user ] }
7+
8+ it "redirects to the admin root after signing in with no stored location" do
9+ get :new
10+
11+ post ( :create ,
12+ params : {
13+ spree_user : {
14+ email : user . email ,
15+ password : 'secret'
16+ } ,
17+ }
18+ )
19+
20+ expect ( response ) . to redirect_to spree . admin_path
21+ end
22+ end
Original file line number Diff line number Diff line change 22
33RSpec . feature 'Admin - Sign In' , type : :feature do
44 background do
5- @user = create ( :user , email : 'email@person.com' )
5+ @user = create ( :admin_user , email : 'email@person.com' )
66 visit spree . admin_login_path
77 end
88
1919 expect ( page ) . to have_text 'Logged in successfully'
2020 expect ( page ) . not_to have_text 'Login'
2121 expect ( page ) . to have_text 'Logout'
22- expect ( current_path ) . to eq '/'
22+ expect ( current_path ) . to eq '/admin/orders '
2323 end
2424
2525 scenario 'shows validation erros' do
You can’t perform that action at this time.
0 commit comments