Sha256: e076f3f50d807ef216b702fe86c0f03de90ec611b6c04daecbb823a750396d87

Contents?: true

Size: 492 Bytes

Versions: 9

Compression:

Stored size: 492 Bytes

Contents

require "spec_helper"

describe "percentage rollouts" do
  let(:users) { 10.times.collect { User.create } }
  let(:feature) { Detour::Feature.create(name: "foo") }
  let!(:flag) { feature.percentage_flags.create(flaggable_type: "User", percentage: 20) }

  describe "creating a percentage rollout" do
    it "makes the feature available to the given percentage of instances" do
      users.select { |user| feature.match_percentage?(user) }.length.should eq users.length / 5
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
detour-0.0.11 spec/integration/percentage_rollout_spec.rb
detour-0.0.10 spec/integration/percentage_rollout_spec.rb
detour-0.0.9 spec/integration/percentage_rollout_spec.rb
detour-0.0.7 spec/integration/percentage_rollout_spec.rb
detour-0.0.6 spec/integration/percentage_rollout_spec.rb
detour-0.0.5 spec/integration/percentage_rollout_spec.rb
detour-0.0.3 spec/integration/percentage_rollout_spec.rb
detour-0.0.2 spec/integration/percentage_rollout_spec.rb
detour-0.0.1 spec/integration/percentage_rollout_spec.rb