Skip to content

Commit e9d5724

Browse files
committed
ci: use Rails 7.1 in JRuby tests
1 parent d933130 commit e9d5724

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

gemfiles/jruby.gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@ source "https://rubygems.org"
33
gem "activerecord-jdbcsqlite3-adapter"
44
gem "jdbc-sqlite3"
55

6-
gem "rails", "~> 7.0"
6+
gem "rails", "~> 7.1.0"
77

88
gemspec path: ".."

spec/action_policy/rspec_spec.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ def filter_with_context(users, context:)
215215
expect { subject.yell("admin") }
216216
.to be_authorized_to(:yell?, target).with(TestService::CustomPolicy)
217217
.with_context(able_to_yell: false)
218-
end.to raise_error(RSpec::Expectations::ExpectationNotMetError, %r{and context.+:able_to_yell=>true})
218+
end.to raise_error(RSpec::Expectations::ExpectationNotMetError, %r{and context.+able_to_yell(=>|: )true})
219219
end
220220
end
221221

@@ -353,7 +353,7 @@ def filter_with_context(users, context:)
353353
end.to raise_error(
354354
RSpec::Expectations::ExpectationNotMetError,
355355
Regexp.new("expected a scoping named :default for type :data " \
356-
"with scope options {:with_admins=>false} " \
356+
"with scope options {:?with_admins(=>|: )false} " \
357357
"from TestService::CustomPolicy to have been applied")
358358
)
359359
end
@@ -366,7 +366,7 @@ def filter_with_context(users, context:)
366366
end.to raise_error(
367367
RSpec::Expectations::ExpectationNotMetError,
368368
Regexp.new("expected a scoping named :default for type :data " \
369-
"with scope options matching {:with_admins=>\\(a falsey value\\)} " \
369+
"with scope options matching {:?with_admins(=>|: )\\(a falsey value\\)} " \
370370
"from TestService::CustomPolicy to have been applied")
371371
)
372372
end
@@ -393,7 +393,7 @@ def filter_with_context(users, context:)
393393
end.to raise_error(
394394
RSpec::Expectations::ExpectationNotMetError,
395395
Regexp.new("expected a scoping named :default for type :data without scope options " \
396-
"and context {:all_users=>false} " \
396+
"and context {:?all_users(=>|: )false} " \
397397
"from TestService::CustomPolicy to have been applied")
398398
)
399399
end

test/action_policy/test_helper_test.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -174,13 +174,13 @@ def test_assert_have_authorized_scope_raised_when_scope_options_mismatch
174174

175175
assert_match(
176176
Regexp.new("Expected a scoping named :default for :data type " \
177-
"with scope options {:with_admins=>false} " \
177+
"with scope options {:?with_admins(=>|: )false} " \
178178
"and without context from UserPolicy to have been applied"),
179179
error.message
180180
)
181181
assert_match(
182182
Regexp.new("Registered scopings: .*TestHelperTest::CustomPolicy :default " \
183-
"for :data with scope options {:with_admins=>true}"),
183+
"for :data with scope options {:?with_admins(=>|: )true}"),
184184
error.message
185185
)
186186
end
@@ -194,7 +194,7 @@ def test_assert_have_authorized_scope_raised_when_context_mismatch
194194

195195
assert_match(
196196
Regexp.new("Expected a scoping named :all for :data type without scope options " \
197-
"and with context: {:all_users=>false} from TestHelperTest::CustomPolicy to have been applied"),
197+
"and with context: {:?all_users(=>|: )false} from TestHelperTest::CustomPolicy to have been applied"),
198198
error.message
199199
)
200200
end

0 commit comments

Comments
 (0)