Sha256: a0e0cf9768818af1f7e0db4b4e126eb5b1bf010cfa356017201af8a3c980b99b

Contents?: true

Size: 615 Bytes

Versions: 4

Compression:

Stored size: 615 Bytes

Contents

require 'spec_helper'

describe Yaks::Mapper::Association do
  describe 'self_link' do
    context 'without a :self link' do
      subject { described_class.new(nil, nil, nil, Yaks::List(Yaks::Mapper::Link.new(:alternate, '/foo')), {}) }

      it 'should be nil' do
        expect(subject.self_link).to be_nil
      end
    end
  end

  context 'with a self link' do
    subject { described_class.new(nil, nil, nil, Yaks::List(Yaks::Mapper::Link.new(:self, '/self')), {}) }

    it 'should resolve to the self link' do
      expect(subject.self_link).to eq Yaks::Mapper::Link.new(:self, '/self')
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
yaks-0.3.1 spec/yaks/mapper/association_spec.rb
yaks-0.3.0 spec/yaks/mapper/association_spec.rb
yaks-0.2.0 spec/yaks/mapper/association_spec.rb
yaks-0.1.0 spec/yaks/mapper/association_spec.rb