Sha256: aea956cadfe4c954ea23cfdfb0bbffa5f4127953ed7e4ba5d98087d460e2baab
Contents?: true
Size: 704 Bytes
Versions: 14
Compression:
Stored size: 704 Bytes
Contents
require "spec_helper" describe Shamu::JsonApi::RelationshipBuilder do let( :context ) { Shamu::JsonApi::Context.new } let( :builder ) { Shamu::JsonApi::RelationshipBuilder.new( context ) } before( :each ) do builder.identifier "example", 1 end describe "#compile" do it "fails if identifier has not been specified" do expect do Shamu::JsonApi::RelationshipBuilder.new( context ).compile end.to raise_error Shamu::JsonApi::IncompleteResourceError end end describe "#identifier" do it "writes type and id" do builder.identifier "spec", 5 expect( builder.compile ).to include data: hash_including( type: "spec", id: "5" ) end end end
Version data entries
14 entries across 14 versions & 1 rubygems