Disable `without_verify_partial_doubles` in statuses/show view spec (#29132)

pull/2834/head
Matt Jankowski 2024-09-03 11:23:57 -04:00 committed by GitHub
parent 5b595b8a5a
commit 79b1841805
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 17 additions and 10 deletions

View File

@ -8,12 +8,6 @@ RSpec.configure do |config|
config.mock_with :rspec do |mocks| config.mock_with :rspec do |mocks|
mocks.verify_partial_doubles = true mocks.verify_partial_doubles = true
config.around(:example, :without_verify_partial_doubles) do |example|
mocks.verify_partial_doubles = false
example.call
mocks.verify_partial_doubles = true
end
end end
config.before :suite do config.before :suite do

View File

@ -2,14 +2,13 @@
require 'rails_helper' require 'rails_helper'
describe 'statuses/show.html.haml', :without_verify_partial_doubles do describe 'statuses/show.html.haml' do
let(:alice) { Fabricate(:account, username: 'alice', display_name: 'Alice') } let(:alice) { Fabricate(:account, username: 'alice', display_name: 'Alice') }
let(:status) { Fabricate(:status, account: alice, text: 'Hello World') } let(:status) { Fabricate(:status, account: alice, text: 'Hello World') }
before do before do
allow(view).to receive_messages(api_oembed_url: '', site_title: 'example site', site_hostname: 'example.com', full_asset_url: '//asset.host/image.svg', current_account: nil, single_user_mode?: false) view.extend view_helpers
allow(view).to receive(:local_time)
allow(view).to receive(:local_time_ago)
assign(:instance_presenter, InstancePresenter.new) assign(:instance_presenter, InstancePresenter.new)
Fabricate(:media_attachment, account: alice, status: status, type: :video) Fabricate(:media_attachment, account: alice, status: status, type: :video)
@ -40,4 +39,18 @@ describe 'statuses/show.html.haml', :without_verify_partial_doubles do
def header_tags def header_tags
view.content_for(:header_tags) view.content_for(:header_tags)
end end
def view_helpers
Module.new do
def api_oembed_url(_) = ''
def show_landing_strip? = true
def site_title = 'example site'
def site_hostname = 'example.com'
def full_asset_url(_) = '//asset.host/image.svg'
def current_account = nil
def single_user_mode? = false
def local_time = nil
def local_time_ago = nil
end
end
end end