Sha256: 22ac7e56a87511e3288d223cb3cca70ca6c9239be0f3559c365202b229d0a38d

Contents?: true

Size: 499 Bytes

Versions: 2

Compression:

Stored size: 499 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| user.detour_features.include?(feature) }.length.should eq users.length / 5
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
detour-0.0.15 spec/integration/percentage_rollout_spec.rb
detour-0.0.14 spec/integration/percentage_rollout_spec.rb