Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions spec/rails_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,14 @@ def executor_around_each_request
# arbitrary gems may also be filtered via:
# config.filter_gems_from_backtrace("gem name")

# Rails 8.1 loads routes lazily. Devise registers its mappings while the
# routes are drawn (via devise_for), so until the routes are loaded
# Devise.mappings is empty and sign_in raises "Could not find a valid
# mapping". Force the routes to load before the suite runs.
config.before(:suite) do
Rails.application.reload_routes_unless_loaded
end

config.before(:suite) do
DatabaseCleaner.clean_with(:truncation)
end
Expand Down
5 changes: 4 additions & 1 deletion spec/requests/madmin/projects_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@
get "/madmin/projects"

expect(response).to have_http_status(:ok)
expect(response.body).to include(project.title)
# The title is HTML-escaped in the rendered page (e.g. an apostrophe
# becomes '), so compare against the escaped form to avoid a flaky
# failure whenever Faker generates a name with special characters.
expect(response.body).to include(CGI.escapeHTML(project.title))
end
end

Expand Down
Loading