Sha256: c4231eba2f11cc5b4bdd6e7d28a601aac72d839515b7626a8ff98a99681bc089

Contents?: true

Size: 592 Bytes

Versions: 7

Compression:

Stored size: 592 Bytes

Contents

require 'spec_helper'

describe SearchKit::Models::Key do
  let(:model) { described_class.new }

  subject { model }

  it { is_expected.to be_instance_of SearchKit::Models::Key }
  it { is_expected.to respond_to :uri }
  it { is_expected.to respond_to :token }
  it { is_expected.to respond_to :name }

  describe '#creator?' do
    subject { model.creator? }
    
    context 'when #privilege is set to "creator"' do
      before { model.privilege = 'creator' }
      it { is_expected.to be true }
    end

    context 'otherwise' do
      it { is_expected.to be false }
    end
  end

end

Version data entries

7 entries across 7 versions & 1 rubygems

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