Add reusable methods to common actions translations module

Because we do this same expectation from a lot of specs.
This commit is contained in:
Senén Rodero Rodríguez
2019-05-31 19:20:48 +02:00
parent 9fd77d4042
commit 4d15815843

View File

@@ -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