Add missing expectations in remotely translatable tests
After changing the language, we were checking that certain content isn't there. However, the content wasn't there before changing the language either, so the test will pass even if the request to change the language hasn't finished. Although this is probably OK because we aren't changing the language using an AJAX request, and so Capybara will correctly wait until the request is finished before finishing the test, confirming that the page has changed after a request is something we try to do in every test.
This commit is contained in:
@@ -38,6 +38,7 @@ shared_examples "remotely_translatable" do |factory_name, path_name, path_argume
|
||||
|
||||
select "Español", from: "Language:"
|
||||
|
||||
expect(page).to have_select "Idioma:"
|
||||
expect(page).not_to have_button("Traducir página")
|
||||
end
|
||||
|
||||
@@ -47,6 +48,7 @@ shared_examples "remotely_translatable" do |factory_name, path_name, path_argume
|
||||
|
||||
select "Español", from: "Language:"
|
||||
|
||||
expect(page).to have_select "Idioma:"
|
||||
expect(page).not_to have_button("Traducir página")
|
||||
end
|
||||
|
||||
@@ -57,9 +59,9 @@ shared_examples "remotely_translatable" do |factory_name, path_name, path_argume
|
||||
|
||||
select "Español", from: "Language:"
|
||||
|
||||
expect(page).not_to have_button("Traducir página")
|
||||
expect(page).to have_content "En un breve periodo de tiempo refrescando la página " \
|
||||
"podrá ver todo el contenido en su idioma"
|
||||
expect(page).not_to have_button("Traducir página")
|
||||
end
|
||||
end
|
||||
|
||||
@@ -73,6 +75,7 @@ shared_examples "remotely_translatable" do |factory_name, path_name, path_argume
|
||||
|
||||
select "Español", from: "Language:"
|
||||
|
||||
expect(page).to have_select "Idioma:"
|
||||
expect(page).not_to have_button("Traducir página")
|
||||
end
|
||||
end
|
||||
@@ -97,6 +100,7 @@ shared_examples "remotely_translatable" do |factory_name, path_name, path_argume
|
||||
|
||||
select "Español", from: "Language:"
|
||||
|
||||
expect(page).to have_select "Idioma:"
|
||||
expect(page).not_to have_button("Traducir página")
|
||||
end
|
||||
end
|
||||
@@ -167,10 +171,10 @@ shared_examples "remotely_translatable" do |factory_name, path_name, path_argume
|
||||
visit path
|
||||
select "Español", from: "Idioma:"
|
||||
|
||||
expect(page).not_to have_button "Traducir página"
|
||||
expect(page).not_to have_content "Se han solicitado correctamente las traducciones."
|
||||
expect(page).to have_content "En un breve periodo de tiempo refrescando la página " \
|
||||
"podrá ver todo el contenido en su idioma"
|
||||
expect(page).not_to have_button "Traducir página"
|
||||
expect(page).not_to have_content "Se han solicitado correctamente las traducciones."
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user