Sha256: e6bcc68bcf995de306880448d36d0dcd429fea2c3dd2526e17196026faf1e070

Contents?: true

Size: 733 Bytes

Versions: 3

Compression:

Stored size: 733 Bytes

Contents

require 'spec_helper'

RSpec.describe Yaks::Resource::Link do
  subject(:link) { described_class.new(rel, uri, options) }
  let(:rel)      { :foo_rel }
  let(:uri)      { 'http://api.example.org/rel/foo' }
  let(:options)  { {name: 'jimmy', title: 'mr. spectacular' } }

  its(:rel)     { should eql :foo_rel }
  its(:uri)     { should eql 'http://api.example.org/rel/foo' }
  its(:options) { should eql(name: 'jimmy', title: 'mr. spectacular') }

  its(:name)       { should eql('jimmy') }
  its(:title)      { should eql('mr. spectacular') }
  its(:templated?) { should be false }

  context 'with explicit templated option' do
    let(:options) { super().merge(templated: true) }
    its(:templated?) { should be true }
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
yaks-0.4.4 spec/unit/yaks/resource/link_spec.rb
yaks-0.4.3 spec/unit/yaks/resource/link_spec.rb
yaks-0.4.2 spec/unit/yaks/resource/link_spec.rb