Sha256: e984f03c351ab356907abed07cdaad459589aff83d7657915eba559dacf64436

Contents?: true

Size: 507 Bytes

Versions: 1

Compression:

Stored size: 507 Bytes

Contents

require "spec_helper"

describe "percentage rollouts" do
  let(:users) { 10.times.collect { User.create } }
  let(:feature) { ActiveRecord::Rollout::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

1 entries across 1 versions & 1 rubygems

Version Path
active_record_rollout-0.0.1 spec/integration/percentage_rollout_spec.rb