Skip to content

Instantly share code, notes, and snippets.

@brunapereira
Created December 14, 2019 22:54
Show Gist options
  • Save brunapereira/dcc9d88fc89976e55372cff79e81a055 to your computer and use it in GitHub Desktop.
Save brunapereira/dcc9d88fc89976e55372cff79e81a055 to your computer and use it in GitHub Desktop.
module Helpers
def enable_toggle(toggle_name)
allow_any_instance_of(Flipper).to receive(:enabled?).with(toggle_name).and_return(true)
end
def disable_toggle(toggle_name)
allow_any_instance_of(Flipper).to receive(:enabled?).with(toggle_name).and_return(false)
end
end
RSpec.configure do |config|
config.include Helpers
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment