Sha256: b9de03a0da7990db74adfe85e909a966246ee805187e0ea33cbd96d5b2d87f98

Contents?: true

Size: 841 Bytes

Versions: 29

Compression:

Stored size: 841 Bytes

Contents

RSpec.describe Flipper::Api::V1::Decorators::Feature do
  describe "#as_json" do
    context "with exclude_gates set to true" do
      subject { described_class.new(flipper[:my_feature]).as_json(exclude_gates: true) }

      it "returns json WITHOUT feature gate data" do
        expect(subject.keys).to_not include("gates")
      end
    end

    context "with exclude_gates set to false" do
      subject { described_class.new(flipper[:my_feature]).as_json(exclude_gates: false) }

      it "returns json WITH feature gate data" do
        expect(subject.keys).to include("gates")
      end
    end

    context "without exclude_gates set" do
      subject { described_class.new(flipper[:my_feature]).as_json }

      it "returns json WITH feature gate data" do
        expect(subject.keys).to include("gates")
      end
    end
  end
end

Version data entries

29 entries across 29 versions & 1 rubygems

Version Path
flipper-api-1.3.2 spec/flipper/api/v1/decorators/feature_spec.rb
flipper-api-1.3.1 spec/flipper/api/v1/decorators/feature_spec.rb
flipper-api-1.3.0 spec/flipper/api/v1/decorators/feature_spec.rb
flipper-api-1.3.0.pre spec/flipper/api/v1/decorators/feature_spec.rb
flipper-api-1.2.2 spec/flipper/api/v1/decorators/feature_spec.rb
flipper-api-1.2.1 spec/flipper/api/v1/decorators/feature_spec.rb
flipper-api-1.2.0 spec/flipper/api/v1/decorators/feature_spec.rb
flipper-api-1.1.2 spec/flipper/api/v1/decorators/feature_spec.rb
flipper-api-1.1.1 spec/flipper/api/v1/decorators/feature_spec.rb
flipper-api-1.1.0 spec/flipper/api/v1/decorators/feature_spec.rb
flipper-api-1.0.0 spec/flipper/api/v1/decorators/feature_spec.rb
flipper-api-1.0.0.pre spec/flipper/api/v1/decorators/feature_spec.rb
flipper-api-0.28.3 spec/flipper/api/v1/decorators/feature_spec.rb
flipper-api-0.28.2 spec/flipper/api/v1/decorators/feature_spec.rb
flipper-api-0.28.1 spec/flipper/api/v1/decorators/feature_spec.rb
flipper-api-0.28.0 spec/flipper/api/v1/decorators/feature_spec.rb
flipper-api-0.27.1 spec/flipper/api/v1/decorators/feature_spec.rb
flipper-api-0.27.0 spec/flipper/api/v1/decorators/feature_spec.rb
flipper-api-0.26.2 spec/flipper/api/v1/decorators/feature_spec.rb
flipper-api-0.26.1 spec/flipper/api/v1/decorators/feature_spec.rb