Sha256: 9cb1cb0e487f8cf78ccc3f75783814c6170f0e7cb9b40f864a21fc84c3f19d9a

Contents?: true

Size: 778 Bytes

Versions: 1

Compression:

Stored size: 778 Bytes

Contents

require "spec_helper"

describe Subjoin::Identifier do
  before :each do
    data = JSON.parse(ARTICLE)['data']['relationships']['author']
    @id = Subjoin::Identifier.
          new(data['data']['type'], data['data']['id'], data['meta'])
  end

  it "has a type" do
    expect(@id.type).to eq "people"
  end

  it "has an id" do
    expect(@id.id).to eq "9"
  end

  it "has a Meta object" do
    expect(@id.meta).to be_an_instance_of Subjoin::Meta
  end

  describe "equality" do
    it "is equal if #type and #id are the same" do
      other = Subjoin::Identifier.new("people", "9")
      expect(@id == other).to be true
    end

    it "is other not equal" do
      other = Subjoin::Identifier.new("schmeople", "9")
      expect(@id == other).to be false
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
subjoin-0.2.1 spec/identifier_spec.rb