diff options
author | Bob Van Landuyt <bob@vanlanduyt.co> | 2018-12-14 16:27:26 +0300 |
---|---|---|
committer | Bob Van Landuyt <bob@vanlanduyt.co> | 2018-12-14 16:35:05 +0300 |
commit | 2e8d0153cd6bed87fa55255ef11fda7152b2bcaf (patch) | |
tree | 4a6718e41521154cf9f9a85d60794d5e8336a77d /spec/lib/constraints | |
parent | 744f6ed12bf1ce543b4c903d27cfd8362e91795d (diff) |
Pass on arguments passed to the FeatureConstrainer
All arguments passed to the `FeatureConstrainer` will be passed on to
the `Feature.enabled?` check.
Diffstat (limited to 'spec/lib/constraints')
-rw-r--r-- | spec/lib/constraints/feature_constrainer_spec.rb | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/spec/lib/constraints/feature_constrainer_spec.rb b/spec/lib/constraints/feature_constrainer_spec.rb new file mode 100644 index 00000000000..42efc164f81 --- /dev/null +++ b/spec/lib/constraints/feature_constrainer_spec.rb @@ -0,0 +1,11 @@ +require 'spec_helper' + +describe Constraints::FeatureConstrainer do + describe '#matches' do + it 'calls Feature.enabled? with the correct arguments' do + expect(Feature).to receive(:enabled?).with(:feature_name, "an object", default_enabled: true) + + described_class.new(:feature_name, "an object", default_enabled: true).matches?(double('request')) + end + end +end |