Module: Spree::TestingSupport::LocaleHelpers
- Defined in:
- lib/spree/testing_support/locale_helpers.rb
Instance Method Summary collapse
-
#add_french_locales ⇒ Object
rubocop:disable Layout/ArgumentAlignment.
- #close_i18n_menu ⇒ Object
-
#open_i18n_menu ⇒ Object
rubocop:enable Layout/ArgumentAlignment.
- #switch_to_currency(currency) ⇒ Object
- #switch_to_locale(locale) ⇒ Object
Instance Method Details
#add_french_locales ⇒ Object
rubocop:disable Layout/ArgumentAlignment
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 |
# File 'lib/spree/testing_support/locale_helpers.rb', line 5 def add_french_locales I18n.backend.store_translations(:fr, spree: { added_to_cart: 'Ajouté au panier avec succès!', continue_shopping: 'Continuer vos achats', choose_currency: 'Choisir la devise', internationalization: 'Internationalisation', i18n: { language: 'Langue', this_file_language: 'Français (FR)' }, cart_page: { header: 'Votre panier', empty_info: 'Votre panier est vide', add_promo_code: 'AJOUTER UN CODE PROMOTIONNEL', checkout: 'Passer la commande', product: 'articles', quantity: 'quantité', title: 'Panier', change_quantity: 'Changer la quantité', remove_from_cart: 'Retirer du panier' }, shopping_cart: 'Panier', cart: 'Panier', close: 'Fermer', search: 'Rechercher', home: 'Accueil', nav_bar: { admin_panel: "Panneau d'administration", close_menu: 'Fermer le menu', go_to_previous_menu: 'Vers le menu précédent', show_menu: 'Afficher le menu', show_search: 'Afficher la recherche', show_user_menu: 'Afficher le menu utilisateur', change_country: 'Changer de pays', desktop: 'Navigation sur le bureau', mobile: 'Navigation mobile' }, login: 'Connexion', logout: 'Se déconnecter', sign_up: 'Enregistrer', email: 'Courriel', password: 'Mot de passe', remember_me: 'Se souvenir de moi', my_account: 'Mon compte', my_orders: 'Mes commandes', logged_in_successfully: 'Connexion réussie' }) end |
#close_i18n_menu ⇒ Object
61 62 63 64 |
# File 'lib/spree/testing_support/locale_helpers.rb', line 61 def find('#header #internationalization-button-desktop').click expect(page).not_to have_selector('#internationalization-options-desktop') end |
#open_i18n_menu ⇒ Object
rubocop:enable Layout/ArgumentAlignment
56 57 58 59 |
# File 'lib/spree/testing_support/locale_helpers.rb', line 56 def find('#header #internationalization-button-desktop').click expect(page).to have_selector('#internationalization-options-desktop') end |
#switch_to_currency(currency) ⇒ Object
66 67 68 69 70 |
# File 'lib/spree/testing_support/locale_helpers.rb', line 66 def switch_to_currency(currency) select currency, from: 'switch_to_currency' expect(page).to have_no_css '.turbolinks-progress-bar' end |
#switch_to_locale(locale) ⇒ Object
72 73 74 75 |
# File 'lib/spree/testing_support/locale_helpers.rb', line 72 def switch_to_locale(locale) select locale, from: 'Language' end |