-
-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
6 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,11 @@ | ||
require "rails_helper" | ||
RSpec.describe Feature do | ||
subject(:Feature) { Feature } | ||
describe ".enabled?(feature_name)" do | ||
it "is only true when the feature name is set to 'true' in the ENV" do | ||
stub_const("ENV", "FEATURE_FOO" => "true", "FEATURE_BAR" => "yes") | ||
before { stub_const("ENV", "FEATURE_FOO" => "true", "FEATURE_BAR" => "yes") } | ||
|
||
expect(Feature.enabled?(:foo)).to be_truthy | ||
expect(Feature.enabled?(:bar)).not_to be_truthy | ||
expect(Feature.enabled?(:baz)).not_to be_truthy | ||
end | ||
it { is_expected.to be_enabled(:foo) } | ||
it { is_expected.not_to be_enabled(:bar) } | ||
it { is_expected.not_to be_enabled(:baz) } | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters