Add missing expectations after refreshing the page
This way we know for sure the page has finished refreshing. Note that, for now, we aren't adding a check after every call to the `refresh` method because sometimes the page remains identical after refreshing. Not sure what we should do in these cases.
This commit is contained in:
@@ -110,9 +110,12 @@ describe "Admin legislation questions", :admin do
|
||||
find("#nested_question_options input").set("Changed")
|
||||
click_button "Save changes"
|
||||
|
||||
expect(page).to have_content "Question updated successfully"
|
||||
expect(page).not_to have_css "#error_explanation"
|
||||
|
||||
refresh
|
||||
|
||||
expect(page).not_to have_content "Question updated successfully"
|
||||
expect(page).to have_field(field_en[:id], with: "Changed")
|
||||
end
|
||||
|
||||
@@ -136,6 +139,7 @@ describe "Admin legislation questions", :admin do
|
||||
|
||||
refresh
|
||||
|
||||
expect(page).not_to have_content "Question updated successfully"
|
||||
expect(page).not_to have_field fields_for(:en).first[:id], with: "Yes"
|
||||
expect(page).to have_field fields_for(:en).last[:id], with: "No"
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user