Enable "zero monkey patching" mode in RSpec (#31614)

This commit is contained in:
Matt Jankowski 2024-09-04 01:12:25 -04:00 committed by GitHub
parent c9ea91f868
commit f1003b2560
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
439 changed files with 441 additions and 439 deletions

View file

@ -1,6 +1,6 @@
# frozen_string_literal: true
shared_examples 'forbidden for wrong scope' do |wrong_scope|
RSpec.shared_examples 'forbidden for wrong scope' do |wrong_scope|
let(:scopes) { wrong_scope }
it 'returns http forbidden' do
@ -11,7 +11,7 @@ shared_examples 'forbidden for wrong scope' do |wrong_scope|
end
end
shared_examples 'forbidden for wrong role' do |wrong_role|
RSpec.shared_examples 'forbidden for wrong role' do |wrong_role|
let(:role) { UserRole.find_by(name: wrong_role) }
it 'returns http forbidden' do

View file

@ -1,6 +1,6 @@
# frozen_string_literal: true
shared_examples 'CLI Command' do
RSpec.shared_examples 'CLI Command' do
it 'configures Thor to exit on failure' do
expect(described_class.exit_on_failure?).to be true
end

View file

@ -1,6 +1,6 @@
# frozen_string_literal: true
shared_examples 'a check available to devops users' do
RSpec.shared_examples 'a check available to devops users' do
describe 'skip?' do
context 'when user can view devops' do
before { allow(user).to receive(:can?).with(:view_devops).and_return(true) }

View file

@ -1,6 +1,6 @@
# frozen_string_literal: true
shared_examples 'localized subject' do |*args, **kwrest|
RSpec.shared_examples 'localized subject' do |*args, **kwrest|
it 'renders subject localized for the locale of the receiver' do
locale = :de
receiver.update!(locale: locale)

View file

@ -1,6 +1,6 @@
# frozen_string_literal: true
shared_examples 'AccountAvatar' do |fabricator|
RSpec.shared_examples 'AccountAvatar' do |fabricator|
describe 'static avatars', :attachment_processing do
describe 'when GIF' do
it 'creates a png static style' do

View file

@ -1,6 +1,6 @@
# frozen_string_literal: true
shared_examples 'AccountHeader' do |fabricator|
RSpec.shared_examples 'AccountHeader' do |fabricator|
describe 'base64-encoded files', :attachment_processing do
let(:base64_attachment) { "data:image/jpeg;base64,#{Base64.encode64(attachment_fixture('attachment.jpg').read)}" }
let(:account) { Fabricate(fabricator, header: base64_attachment) }

View file

@ -1,6 +1,6 @@
# frozen_string_literal: true
shared_examples 'Reviewable' do
RSpec.shared_examples 'Reviewable' do
subject { described_class.new(reviewed_at: reviewed_at, requested_review_at: requested_review_at) }
let(:reviewed_at) { nil }