Sha256: 5bfd577e55a741be2340ab936229f630eddc27e4478ef613ce294f13f69025d1

Contents?: true

Size: 895 Bytes

Versions: 7

Compression:

Stored size: 895 Bytes

Contents

require 'spec_helper'

describe SearchKit::Models::Keys do
  let(:creator_key) do
    SearchKit::Models::Key.new(
      attributes: {
        privilege: 'creator',
        token:     creator_token
      }
    )
  end

  let(:consumer_key) do
    SearchKit::Models::Key.new(
      attributes: {
        privilege: 'consumer',
        token:     consumer_token
      }
    )
  end

  let(:creator_token)  { "12345" }
  let(:consumer_token) { "67890" }
  let(:keys)           { [ creator_key, consumer_key ] }
  let(:model)          { described_class.new(keys) }

  subject { model }

  describe "#creator" do
    subject { model.creator }
    it { is_expected.to be_instance_of described_class }
    it { is_expected.to match described_class.new([creator_key]) }
  end

  describe "#tokens" do
    subject { model.tokens }
    it { is_expected.to match [creator_token, consumer_token] }
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
search-kit-0.0.10 spec/search_kit/models/keys_spec.rb
search-kit-0.0.9 spec/search_kit/models/keys_spec.rb
search-kit-0.0.8 spec/search_kit/models/keys_spec.rb
search-kit-0.0.7 spec/search_kit/models/keys_spec.rb
search-kit-0.0.6 spec/search_kit/models/keys_spec.rb
search-kit-0.0.5 spec/search_kit/models/keys_spec.rb
search-kit-0.0.4 spec/search_kit/models/keys_spec.rb