Skip to content

Commit

Permalink
Tweak percentage of actor specs based on hashing of id change.
Browse files Browse the repository at this point in the history
  • Loading branch information
jnunemaker committed Nov 14, 2012
1 parent 47613b8 commit a251bae
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions spec/integration_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,6 @@ def enable_percentage_of_random(percentage)

it "enables feature for actor within percentage" do
enabled = (1..100).select { |i| subject.enabled?(Flipper::Types::Actor.new(i)) }.length

enabled.should be_within(2).of(5)
end

Expand Down Expand Up @@ -189,7 +188,8 @@ def enable_percentage_of_random(percentage)
end

it "disables actor in percentage of actors" do
subject.enabled?(pitt).should be_false
enabled = (1..100).select { |i| subject.enabled?(Flipper::Types::Actor.new(i)) }.length
enabled.should be(0)
end

it "disables percentage of random" do
Expand Down Expand Up @@ -254,12 +254,9 @@ def enable_percentage_of_random(percentage)
subject.disable(five_percent_of_actors)
end

it "disables feature for actor within percentage" do
subject.enabled?(pitt).should be_false
end

it "disables feature for actors not within percentage" do
subject.enabled?(clooney).should be_false
it "disables feature" do
enabled = (1..100).select { |i| subject.enabled?(Flipper::Types::Actor.new(i)) }.length
enabled.should be(0)
end

it "adds feature to set of features" do
Expand Down

0 comments on commit a251bae

Please sign in to comment.