Skip to content

Commit 4453e8f

Browse files
committed
Make sure specs pass with Rails < 7.1
1 parent 4d1de65 commit 4453e8f

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

spec/dummy/config/environments/test.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
config.cache_store = :null_store
3030

3131
# Raise exceptions instead of rendering exception templates.
32-
config.action_dispatch.show_exceptions = :none
32+
config.action_dispatch.show_exceptions = false
3333

3434
# Disable request forgery protection in test environment.
3535
config.action_controller.allow_forgery_protection = false

spec/inertia/conditional_sharing_spec.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,11 @@
1919

2020
context "when there is conditional data shared via before_action" do
2121
it "raises an error because it is frozen" do
22+
# Rails < 7.1 won't raise the error unless we load the controller before the request we actually want to test.
23+
#
24+
# This can be removed when we drop support for Rails < 7.1.
25+
get conditional_share_show_path, headers: {'X-Inertia' => true}
26+
2227
expect {
2328
get conditional_share_show_with_a_problem_path, headers: {'X-Inertia' => true}
2429
}.to raise_error(FrozenError)

0 commit comments

Comments
 (0)