Update shoulda-matchers to 5.3 (#18905)

This commit is contained in:
Mac Siri 2023-01-05 13:21:38 -05:00 committed by GitHub
parent 4caf9910b6
commit b887b91be2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 6 additions and 11 deletions

View file

@ -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

View file

@ -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)

View file

@ -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,

Binary file not shown.

BIN
vendor/cache/shoulda-matchers-5.3.0.gem vendored Normal file

Binary file not shown.