Sha256: 6b0890532c787e6142dbb17ea55d55cbdf58d73b77fbb482ce4d4f4a53d1ff8d

Contents?: true

Size: 681 Bytes

Versions: 8

Compression:

Stored size: 681 Bytes

Contents

require "spec_helper"

describe Flip::Declarable do

  let!(:model_class) do
    Class.new do
      extend Flip::Declarable

      strategy Flip::DeclarationStrategy
      default false

      feature :one
      feature :two, description: "Second one."
      feature :three, default: true
    end
  end

  subject { Flip::FeatureSet.instance }

  describe "the .on? class method" do
    context "with default set to false" do
      it { should_not be_on(:one) }
      it { should be_on(:three) }
    end
    context "with default set to true" do
      before { model_class.send(:default, true) }
      it { should be_on(:one) }
      it { should be_on(:three) }
    end
  end

end

Version data entries

8 entries across 8 versions & 2 rubygems

Version Path
flip2-1.1.3 spec/declarable_spec.rb
flip2-1.1.2 spec/declarable_spec.rb
flip2-1.1.1 spec/declarable_spec.rb
flip-1.1.0 spec/declarable_spec.rb
flip-1.0.1 spec/declarable_spec.rb
flip-1.0.0 spec/declarable_spec.rb
flip-0.2.1 spec/declarable_spec.rb
flip-0.2.0 spec/declarable_spec.rb