2019-10-12 21:52:04 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2019-02-15 15:39:39 +05:30
|
|
|
require 'spec_helper'
|
|
|
|
|
|
|
|
describe Constraints::FeatureConstrainer do
|
|
|
|
describe '#matches' do
|
|
|
|
it 'calls Feature.enabled? with the correct arguments' do
|
2020-06-23 00:09:42 +05:30
|
|
|
gate = stub_feature_flag_gate("an object")
|
2019-02-15 15:39:39 +05:30
|
|
|
|
2020-06-23 00:09:42 +05:30
|
|
|
expect(Feature).to receive(:enabled?)
|
|
|
|
.with(:feature_name, gate, default_enabled: true)
|
|
|
|
|
|
|
|
described_class.new(:feature_name, gate, default_enabled: true).matches?(double('request'))
|
2019-02-15 15:39:39 +05:30
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|