test: fix deprecated any_instance and stub old syntax
This commit is contained in:
parent
edb47d94f7
commit
610b808d32
2 changed files with 3 additions and 4 deletions
|
@ -53,7 +53,7 @@ RSpec.describe Manager::AdministrateurConfirmationsController, type: :controller
|
|||
|
||||
describe 'edge cases' do
|
||||
context 'when the environment is development' do
|
||||
before { Rails.env.stub(development?: true) }
|
||||
before { allow(Rails.env).to receive(:development?).and_return(true) }
|
||||
|
||||
context 'when the current admin is the inviter' do
|
||||
before { sign_in inviter_super_admin }
|
||||
|
@ -130,7 +130,7 @@ RSpec.describe Manager::AdministrateurConfirmationsController, type: :controller
|
|||
|
||||
describe 'edge cases' do
|
||||
context 'when the environment is development' do
|
||||
before { Rails.env.stub(development?: true) }
|
||||
before { allow(Rails.env).to receive(:development?).and_return(true) }
|
||||
|
||||
context 'when the current admin is the inviter' do
|
||||
before { sign_in inviter_super_admin }
|
||||
|
|
|
@ -7,8 +7,7 @@ describe 'users/dossiers/brouillon', type: :view do
|
|||
before do
|
||||
sign_in dossier.user
|
||||
assign(:dossier, dossier)
|
||||
# allow(view) doesn't work because method is called inside partial
|
||||
ActionView::Base.any_instance.stub(:administrateur_signed_in?).and_return(profile == :administrateur)
|
||||
allow_any_instance_of(ActionView::Base).to receive(:administrateur_signed_in?).and_return(profile == :administrateur)
|
||||
end
|
||||
|
||||
subject! { render }
|
||||
|
|
Loading…
Reference in a new issue