Sha256: 60160e17516b9c4c5fba33ba5d0a403172e076e149286f32bfb647e49fb5f6bf

Contents?: true

Size: 860 Bytes

Versions: 3

Compression:

Stored size: 860 Bytes

Contents

require 'helper'

describe Flipper::UI do
  describe "Initializing middleware with flipper instance" do
    let(:app) { build_app(flipper) }

    it "works" do
      flipper.enable :some_great_feature
      get "/features"
      last_response.status.should be(200)
      last_response.body.should include("some_great_feature")
    end
  end

  describe "Initializing middleware lazily with a block" do
    let(:app) {
      build_app(lambda { flipper })
    }

    it "works" do
      flipper.enable :some_great_feature
      get "/features"
      last_response.status.should be(200)
      last_response.body.should include("some_great_feature")
    end
  end

  describe "Request method unsupported by action" do
    it "raises error" do
      expect {
        head '/features'
      }.to raise_error(Flipper::UI::RequestMethodNotSupported)
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
flipper-ui-0.7.0 spec/flipper/ui_spec.rb
flipper-ui-0.7.0.beta6 spec/flipper/ui_spec.rb
flipper-ui-0.7.0.beta5 spec/flipper/ui_spec.rb