From 4d15815843725f1699fcc9534cd7bce20e0bda65 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sen=C3=A9n=20Rodero=20Rodr=C3=ADguez?= Date: Fri, 31 May 2019 19:20:48 +0200 Subject: [PATCH] Add reusable methods to common actions translations module Because we do this same expectation from a lot of specs. --- spec/support/common_actions/translations.rb | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/spec/support/common_actions/translations.rb b/spec/support/common_actions/translations.rb index e45ae346a..768e60059 100644 --- a/spec/support/common_actions/translations.rb +++ b/spec/support/common_actions/translations.rb @@ -60,4 +60,16 @@ module Translations def front_end_path_to_visit?(path) path[/admin|managment|valuation/].blank? end + + def expect_to_have_language(language) + expect(page).to have_select :select_language, with_options: [language] + end + + def expect_not_to_have_language(language) + expect(page).not_to have_select :select_language, with_options: [language] + end + + def expect_to_have_language_selected(language) + expect(page).to have_select :select_language, selected: language + end end