Sha256: 129004826832ce4b71d91d3cafd71327485ad2e40bba4a0a6b8fad9d6b32e2ab

Contents?: true

Size: 1.21 KB

Versions: 22

Compression:

Stored size: 1.21 KB

Contents

require 'helper'

RSpec.describe Flipper::Api::V1::Actions::ClearFeature do
  let(:app) { build_api(flipper) }

  describe 'clear' do
    before do
      Flipper.register(:admins) {}
      actor22 = Flipper::Actor.new('22')

      feature = flipper[:my_feature]
      feature.enable flipper.boolean
      feature.enable flipper.group(:admins)
      feature.enable flipper.actor(actor22)
      feature.enable flipper.actors(25)
      feature.enable flipper.time(45)

      delete '/features/my_feature/clear'
    end

    it 'clears feature' do
      expect(last_response.status).to eq(204)
      expect(flipper[:my_feature].off?).to be_truthy
    end
  end

  describe 'clear feature with slash in name' do
    before do
      Flipper.register(:admins) {}
      actor22 = Flipper::Actor.new('22')

      feature = flipper["my/feature"]
      feature.enable flipper.boolean
      feature.enable flipper.group(:admins)
      feature.enable flipper.actor(actor22)
      feature.enable flipper.actors(25)
      feature.enable flipper.time(45)

      delete '/features/my/feature/clear'
    end

    it 'clears feature' do
      expect(last_response.status).to eq(204)
      expect(flipper["my/feature"].off?).to be_truthy
    end
  end
end

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
flipper-api-0.22.2 spec/flipper/api/v1/actions/clear_feature_spec.rb
flipper-api-0.22.1 spec/flipper/api/v1/actions/clear_feature_spec.rb
flipper-api-0.22.0 spec/flipper/api/v1/actions/clear_feature_spec.rb
flipper-api-0.21.0 spec/flipper/api/v1/actions/clear_feature_spec.rb
flipper-api-0.21.0.rc2 spec/flipper/api/v1/actions/clear_feature_spec.rb
flipper-api-0.21.0.rc1 spec/flipper/api/v1/actions/clear_feature_spec.rb
flipper-api-0.20.4 spec/flipper/api/v1/actions/clear_feature_spec.rb
flipper-api-0.20.3 spec/flipper/api/v1/actions/clear_feature_spec.rb
flipper-api-0.20.2 spec/flipper/api/v1/actions/clear_feature_spec.rb
flipper-api-0.20.1 spec/flipper/api/v1/actions/clear_feature_spec.rb
flipper-api-0.20.0 spec/flipper/api/v1/actions/clear_feature_spec.rb
flipper-api-0.20.0.beta3 spec/flipper/api/v1/actions/clear_feature_spec.rb
flipper-api-0.20.0.beta2 spec/flipper/api/v1/actions/clear_feature_spec.rb
flipper-api-0.20.0.beta1 spec/flipper/api/v1/actions/clear_feature_spec.rb
flipper-api-0.19.1 spec/flipper/api/v1/actions/clear_feature_spec.rb
flipper-api-0.19.0 spec/flipper/api/v1/actions/clear_feature_spec.rb
flipper-api-0.18.0 spec/flipper/api/v1/actions/clear_feature_spec.rb
flipper-api-0.17.2 spec/flipper/api/v1/actions/clear_feature_spec.rb
flipper-api-0.17.1 spec/flipper/api/v1/actions/clear_feature_spec.rb
flipper-api-0.16.2 spec/flipper/api/v1/actions/clear_feature_spec.rb