File tree 6 files changed +55
-4
lines changed
6 files changed +55
-4
lines changed Original file line number Diff line number Diff line change @@ -3,6 +3,9 @@ source "https://rubygems.org"
3
3
branch = ENV . fetch ( 'SOLIDUS_BRANCH' , 'master' )
4
4
gem "solidus" , github : "solidusio/solidus" , branch : branch
5
5
6
+ # Provides basic authentication functionality for testing parts of your engine
7
+ gem 'solidus_auth_devise' , '~> 1.0'
8
+
6
9
if branch == 'master' || branch >= "v2.0"
7
10
gem "rails-controller-testing" , group : :test
8
11
else
Original file line number Diff line number Diff line change
1
+ begin
2
+ Spree ::UserPasswordsController . include SolidusI18n ::ControllerLocaleHelper
3
+ Spree ::UserRegistrationsController . include SolidusI18n ::ControllerLocaleHelper
4
+ Spree ::UserSessionsController . include SolidusI18n ::ControllerLocaleHelper
5
+ Spree ::Admin ::UserSessionsController . include SolidusI18n ::ControllerLocaleHelper
6
+ rescue NameError
7
+ # App is not using solidus_auth_devise
8
+ end
Original file line number Diff line number Diff line change 604
604
add : Nuovo credito
605
605
back_to_user_list : Lista utenti
606
606
select_reason : Motivo
607
- admin_login : Login
607
+ admin_login : Login amministratore
608
608
administration : Amministrazione
609
609
advertise : Promuovi
610
610
agree_to_privacy_policy : Accetta Politica di Privacy
708
708
other : Subtotale (%{count} articoli)
709
709
categories : Categorie
710
710
category : Categoria
711
+ change_my_password : Cambia la mia password
711
712
charged : Addebitato
712
713
check_for_spree_alerts : Visualizza le segnalazioni di Spree
713
714
checkout : Checkout
Original file line number Diff line number Diff line change 1
1
require 'spec_helper'
2
2
3
- RSpec . feature 'Translations ' , :js do
3
+ RSpec . feature 'Admin translations ' , :js do
4
4
stub_authorization!
5
5
6
6
given! ( :store ) { create ( :store ) }
31
31
expect ( SolidusI18n ::Config . available_locales ) . to include ( :fr )
32
32
end
33
33
end
34
+
35
+ context 'solidus_auth_devise pages translation' do
36
+ let ( :locale ) { :it }
37
+
38
+ background do
39
+ SolidusI18n ::Config . available_locales = [ :en , :it ]
40
+ end
41
+
42
+ scenario 'the login page is translated' do
43
+ visit spree . admin_login_path ( locale : locale )
44
+ expect ( page ) . to have_content ( /#{ Spree . t ( :admin_login , locale : locale ) } /i )
45
+ end
46
+ end
34
47
end
Original file line number Diff line number Diff line change 1
1
# encoding: utf-8
2
2
require 'spec_helper'
3
3
4
- RSpec . feature 'Translations ' , :js do
4
+ RSpec . feature 'Frontend translations ' , :js do
5
5
given ( :language ) { Spree . t ( :this_file_language , scope : 'i18n' , locale : 'pt-BR' ) }
6
6
7
7
background do
8
8
reset_spree_preferences
9
- SolidusI18n ::Config . available_locales = [ :en , :'pt-BR' ]
9
+ SolidusI18n ::Config . available_locales = [ :en , :'pt-BR' , :it ]
10
10
end
11
11
12
12
context 'page' do
25
25
end
26
26
end
27
27
end
28
+
29
+ context 'solidus_auth_devise pages translation' do
30
+ let ( :locale ) { :it }
31
+
32
+ scenario 'the login page is translated' do
33
+ visit spree . login_path ( locale : locale )
34
+ expect ( page ) . to have_content ( /#{ Spree . t ( :login_as_existing , locale : locale ) } /i )
35
+ end
36
+
37
+ scenario 'the signup page is translated' do
38
+ visit spree . signup_path ( locale : locale )
39
+ expect ( page ) . to have_content ( /#{ Spree . t ( :new_customer , locale : locale ) } /i )
40
+ end
41
+
42
+ scenario 'the forgot password page is translated' do
43
+ visit spree . recover_password_path ( locale : locale )
44
+ expect ( page ) . to have_content ( /#{ Spree . t ( :forgot_password , locale : locale ) } /i )
45
+ end
46
+
47
+ scenario 'the change password page is translated' do
48
+ visit spree . edit_password_path ( locale : locale , reset_password_token : "123" )
49
+ expect ( page ) . to have_content ( /#{ Spree . t ( :change_my_password , locale : locale ) } /i )
50
+ end
51
+ end
28
52
end
Original file line number Diff line number Diff line change 26
26
config . expect_with :rspec do |expectations |
27
27
expectations . syntax = :expect
28
28
end
29
+
30
+ config . include Devise ::Test ::ControllerHelpers , type : :controller
29
31
end
30
32
31
33
Dir [ File . join ( File . dirname ( __FILE__ ) , '/support/**/*.rb' ) ] . each { |file | require file }
You can’t perform that action at this time.
0 commit comments