Skip to content

Commit

Permalink
Fix brittle test. have_text does not wait for JS to run. Have_content…
Browse files Browse the repository at this point in the history
… does. It mostly worked with have_text, but not always
  • Loading branch information
DanielJackson-Oslo committed Feb 29, 2024
1 parent 399286a commit f8b4a84
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions spec/features/user_manages_space_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,14 @@
fill_in "space_post_number", with: space.post_number
find("body").click # Blur from field

expect(page).to have_text(I18n.t("space_create.any_of_these.one"))
expect(page).to have_content(I18n.t("space_create.any_of_these.one"))

click_on I18n.t("space_create.none_are_duplicates.one")

tom_select("select#space_space_type_ids", option_id: space_type.id)
tom_select("select#space_space_group_title", option_id: space_group.title)
click_on I18n.t("helpers.submit.create", model: Space.model_name.human)
expect(page).to have_text(space.title)
expect(page).to have_content(space.title)
end
end

Expand Down

0 comments on commit f8b4a84

Please sign in to comment.