Fix RSpec/StubbedMock
cop (#25552)
Co-authored-by: Claire <claire.github-309c@sitedethib.com>
This commit is contained in:
@ -77,19 +77,17 @@ describe ApplicationHelper do
|
||||
|
||||
describe 'open_registrations?' do
|
||||
it 'returns true when open for registrations' do
|
||||
without_partial_double_verification do
|
||||
expect(Setting).to receive(:registrations_mode).and_return('open')
|
||||
end
|
||||
allow(Setting).to receive(:[]).with('registrations_mode').and_return('open')
|
||||
|
||||
expect(helper.open_registrations?).to be true
|
||||
expect(Setting).to have_received(:[]).with('registrations_mode')
|
||||
end
|
||||
|
||||
it 'returns false when closed for registrations' do
|
||||
without_partial_double_verification do
|
||||
expect(Setting).to receive(:registrations_mode).and_return('none')
|
||||
end
|
||||
allow(Setting).to receive(:[]).with('registrations_mode').and_return('none')
|
||||
|
||||
expect(helper.open_registrations?).to be false
|
||||
expect(Setting).to have_received(:[]).with('registrations_mode')
|
||||
end
|
||||
end
|
||||
|
||||
@ -296,8 +294,9 @@ describe ApplicationHelper do
|
||||
|
||||
it 'returns site title on production environment' do
|
||||
Setting.site_title = 'site title'
|
||||
expect(Rails.env).to receive(:production?).and_return(true)
|
||||
allow(Rails.env).to receive(:production?).and_return(true)
|
||||
expect(helper.title).to eq 'site title'
|
||||
expect(Rails.env).to have_received(:production?)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
Reference in New Issue
Block a user