Update shoulda-matchers to 5.3 (#18905)
This commit is contained in:
parent
4caf9910b6
commit
b887b91be2
5 changed files with 6 additions and 11 deletions
2
Gemfile
2
Gemfile
|
|
@ -162,7 +162,7 @@ group :test do
|
|||
gem "pundit-matchers", "~> 1.7" # A set of RSpec matchers for testing Pundit authorisation policies
|
||||
gem "rspec-retry", "~> 0.6" # retry intermittently failing rspec examples
|
||||
gem "ruby-prof", "~> 1.4", require: false # ruby-prof is a fast code profiler for Ruby
|
||||
gem "shoulda-matchers", "~> 5.1.0", require: false # Simple one-liner tests for common Rails functionality
|
||||
gem "shoulda-matchers", "~> 5.3", require: false # Simple one-liner tests for common Rails functionality
|
||||
gem "simplecov", "~> 0.21.2", require: false # Code coverage with a powerful configuration library and automatic merging of coverage across test suites
|
||||
gem "stackprof", "~> 0.2", require: false, platforms: :ruby # stackprof is a fast sampling profiler for ruby code, with cpu, wallclock and object allocation samplers
|
||||
gem "stripe-ruby-mock", "3.1.0.rc3", require: "stripe_mock" # A drop-in library to test stripe without hitting their servers
|
||||
|
|
|
|||
|
|
@ -805,7 +805,7 @@ GEM
|
|||
semantic_range (3.0.0)
|
||||
sexp_processor (4.16.1)
|
||||
shellany (0.0.1)
|
||||
shoulda-matchers (5.1.0)
|
||||
shoulda-matchers (5.3.0)
|
||||
activesupport (>= 5.2.0)
|
||||
sidekiq (6.5.8)
|
||||
connection_pool (>= 2.2.5, < 3)
|
||||
|
|
@ -1075,7 +1075,7 @@ DEPENDENCIES
|
|||
rubyzip (~> 2.3)
|
||||
s3_direct_upload (~> 0.1)
|
||||
sassc-rails (~> 2.1.2)
|
||||
shoulda-matchers (~> 5.1.0)
|
||||
shoulda-matchers (~> 5.3)
|
||||
sidekiq (~> 6.5.3)
|
||||
sidekiq-cron (~> 1.7)
|
||||
sidekiq-unique-jobs (~> 7.1.27)
|
||||
|
|
|
|||
|
|
@ -1,23 +1,18 @@
|
|||
require "rails_helper"
|
||||
|
||||
RSpec.describe UserSubscription, type: :model do
|
||||
subject { build(:user_subscription) }
|
||||
|
||||
RSpec.describe UserSubscription do
|
||||
let(:subscriber) { create(:user) }
|
||||
let(:source) { create(:article, :with_user_subscription_tag_role_user, with_user_subscription_tag: true) }
|
||||
|
||||
describe "validations" do
|
||||
it { is_expected.to validate_presence_of(:user_subscription_sourceable_type) }
|
||||
it { is_expected.to validate_presence_of(:subscriber_email) }
|
||||
# Disabled to Rails 7 compatibility. See https://github.com/thoughtbot/shoulda-matchers/issues/1433
|
||||
xit { is_expected.to validate_inclusion_of(:user_subscription_sourceable_type).in_array(%w[Article]) }
|
||||
it { is_expected.to validate_inclusion_of(:user_subscription_sourceable_type).in_array(%w[Article]) }
|
||||
|
||||
# rubocop:disable RSpec/NamedSubject
|
||||
it {
|
||||
expect(subject).to validate_uniqueness_of(:subscriber_id)
|
||||
expect(build(:user_subscription)).to validate_uniqueness_of(:subscriber_id)
|
||||
.scoped_to(%i[subscriber_email user_subscription_sourceable_type user_subscription_sourceable_id])
|
||||
}
|
||||
# rubocop:enable RSpec/NamedSubject
|
||||
|
||||
it "validates the source is active" do
|
||||
unpublished_source = create(:article, :with_user_subscription_tag_role_user, with_user_subscription_tag: true,
|
||||
|
|
|
|||
BIN
vendor/cache/shoulda-matchers-5.1.0.gem
vendored
BIN
vendor/cache/shoulda-matchers-5.1.0.gem
vendored
Binary file not shown.
BIN
vendor/cache/shoulda-matchers-5.3.0.gem
vendored
Normal file
BIN
vendor/cache/shoulda-matchers-5.3.0.gem
vendored
Normal file
Binary file not shown.
Loading…
Add table
Reference in a new issue