Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Removes double occurence of features in feature list.

  • Loading branch information...
commit 2bb0fd0e7e74880fc336e4d394e6da50d5cb9a8a 1 parent ace39e7
@ayrton ayrton authored
Showing with 12 additions and 4 deletions.
  1. +1 −1  lib/rollout.rb
  2. +11 −3 spec/rollout_spec.rb
View
2  lib/rollout.rb
@@ -180,7 +180,7 @@ def with_feature(feature)
def save(feature)
@storage.set(key(feature.name), feature.serialize)
- @storage.set(features_key, (features + [feature.name]).join(","))
+ @storage.set(features_key, (features | [feature.name]).join(","))
end
def migrate?
View
14 spec/rollout_spec.rb
@@ -206,9 +206,17 @@
end
end
- it "keeps a list of features" do
- @rollout.activate(:chat)
- @rollout.features.should be_include(:chat)
+ describe "keeps a list of features" do
+ it "saves the feature" do
+ @rollout.activate(:chat)
+ @rollout.features.should be_include(:chat)
+ end
+
+ it "does not contain doubles" do
+ @rollout.activate(:chat)
+ @rollout.activate(:chat)
+ @rollout.features.size.should == 1
+ end
end
describe "#get" do
Please sign in to comment.
Something went wrong with that request. Please try again.