Skip to content

Commit

Permalink
Make sure specs pass with Rails < 7.1
Browse files Browse the repository at this point in the history
  • Loading branch information
bknoles committed Oct 26, 2024
1 parent 4d1de65 commit 4453e8f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion spec/dummy/config/environments/test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
config.cache_store = :null_store

# Raise exceptions instead of rendering exception templates.
config.action_dispatch.show_exceptions = :none
config.action_dispatch.show_exceptions = false

# Disable request forgery protection in test environment.
config.action_controller.allow_forgery_protection = false
Expand Down
5 changes: 5 additions & 0 deletions spec/inertia/conditional_sharing_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@

context "when there is conditional data shared via before_action" do
it "raises an error because it is frozen" do
# Rails < 7.1 won't raise the error unless we load the controller before the request we actually want to test.
#
# This can be removed when we drop support for Rails < 7.1.
get conditional_share_show_path, headers: {'X-Inertia' => true}

expect {
get conditional_share_show_with_a_problem_path, headers: {'X-Inertia' => true}
}.to raise_error(FrozenError)
Expand Down

0 comments on commit 4453e8f

Please sign in to comment.