Sha256: 0391df9d0e4d74512113a290405c43c2ca0c3b6d2f2f551405901c9cf20e58e7

Contents?: true

Size: 705 Bytes

Versions: 8

Compression:

Stored size: 705 Bytes

Contents

require 'spec_helper'

describe 'Api::Deprecated', type: :controller do
  before do
    routes.draw { get :action1, to: "anonymous#action" }

    get :action
  end

  context "with deprecated action" do
    controller do
      include ::Api::Deprecated

      deprecate :action

      def action
        head :ok
      end
    end

    it { expect(response.status).to eq(200) }
    it { expect(response.headers["Deprecated"]).to eq(true) }
  end

  context "with deprecated action" do
    controller do
      include ::Api::Deprecated

      def action
        head :ok
      end
    end

    it { expect(response.status).to eq(200) }
    it { expect(response.headers["Deprecated"]).to be_nil }
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
power_api-2.1.1 spec/dummy/app/controllers/concerns/api/deprecated_spec.rb
power_api-2.1.0 spec/dummy/app/controllers/concerns/api/deprecated_spec.rb
power_api-2.0.2 spec/dummy/app/controllers/concerns/api/deprecated_spec.rb
power_api-2.0.1 spec/dummy/app/controllers/concerns/api/deprecated_spec.rb
power_api-2.0.0 spec/dummy/app/controllers/concerns/api/deprecated_spec.rb
power_api-1.0.0 spec/dummy/app/controllers/concerns/api/deprecated_spec.rb
power_api-0.2.0 spec/dummy/app/controllers/concerns/api/deprecated_spec.rb
power_api-0.1.0 spec/dummy/app/controllers/concerns/api/deprecated_spec.rb