Sha256: 24b100e7f9c974eba438531dcc644e1644d57ca854612e5a6a2026e90f1ed2e7

Contents?: true

Size: 687 Bytes

Versions: 9

Compression:

Stored size: 687 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(:all) { model_class.send(:default, true) }
      it { should be_on(:one) }
      it { should be_on(:three) }
    end
  end

end

Version data entries

9 entries across 9 versions & 2 rubygems

Version Path
flip_fork-0.2.0 spec/declarable_spec.rb
flip_fork-0.1.1 spec/declarable_spec.rb
flip_fork-0.1.0 spec/declarable_spec.rb
flip-0.1.0 spec/declarable_spec.rb
flip-0.0.4 spec/declarable_spec.rb
flip-0.0.3 spec/declarable_spec.rb
flip-0.0.2 spec/declarable_spec.rb
flip-0.0.1 spec/declarable_spec.rb
flip-0.0.1.alpha2 spec/declarable_spec.rb