Sha256: 1d076f6af090df86102780fc55f42d3eac898729c9b84bcc378e13770ce876ad

Contents?: true

Size: 686 Bytes

Versions: 3

Compression:

Stored size: 686 Bytes

Contents

require_relative "../spec_helper"

describe Kong::Plugin do
  let(:valid_attribute_names) do
    %w(id api_id name config enabled consumer_id)
  end

  describe 'ATTRIBUTE_NAMES' do
    it 'contains valid names' do
      expect(subject.class::ATTRIBUTE_NAMES).to eq(valid_attribute_names)
    end
  end

  describe 'API_END_POINT' do
    it 'contains valid end point' do
      expect(subject.class::API_END_POINT).to eq('/plugins/')
    end
  end

  describe '#init_attributes' do
    it 'uses correct api end point if api_id is present' do
      subject = described_class.new({ api_id: ':api_id' })
      expect(subject.api_end_point).to eq('/apis/:api_id/plugins/')
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
kong-0.1.2 spec/kong/plugin_spec.rb
kong-0.1.1 spec/kong/plugin_spec.rb
kong-0.1.0 spec/kong/plugin_spec.rb