Skip to content

Commit

Permalink
Use instance_double instead of the use discouraged ...
Browse files Browse the repository at this point in the history
allow_any_instance_of
  • Loading branch information
eduardoj committed Oct 30, 2023
1 parent f3e05cc commit 2adb3fb
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/api/spec/controllers/trigger_controller_spec.rb
Expand Up @@ -10,10 +10,9 @@
render_views

before do
# FIXME: fix the rubocop complain
# rubocop:disable RSpec/AnyInstance
allow_any_instance_of(TriggerControllerService::TokenExtractor).to receive(:call).and_return(token)
# rubocop:enable RSpec/AnyInstance
token_extractor = instance_double(TriggerControllerService::TokenExtractor)
allow(TriggerControllerService::TokenExtractor).to receive(:new).and_return(token_extractor)
allow(token_extractor).to receive(:call).and_return(token)
package
end

Expand Down

0 comments on commit 2adb3fb

Please sign in to comment.