Sha256: e282b802e358764b99c2ccae0fda30c30902ee5c9e5faaf26d663405d57eea77
Contents?: true
Size: 1.26 KB
Versions: 28
Compression:
Stored size: 1.26 KB
Contents
require 'spec_helper' describe ActiveFedora::SparqlInsert do let(:change_set) { ActiveFedora::ChangeSet.new(base, base.resource, base.changed_attributes.keys) } subject { described_class.new(change_set.changes) } context "with a changed object" do before do class Library < ActiveFedora::Base end class Book < ActiveFedora::Base belongs_to :library, predicate: ActiveFedora::RDF::Fcrepo::RelsExt.hasConstituent property :title, predicate: ::RDF::Vocab::DC.title end base.library_id = 'foo' base.title = ['bar'] end after do Object.send(:remove_const, :Library) Object.send(:remove_const, :Book) end let(:base) { Book.create } it "returns the string" do expect(subject.build).to eq "DELETE { <> <info:fedora/fedora-system:def/relations-external#hasConstituent> ?change . }\n WHERE { <> <info:fedora/fedora-system:def/relations-external#hasConstituent> ?change . } ;\nDELETE { <> <http://purl.org/dc/terms/title> ?change . }\n WHERE { <> <http://purl.org/dc/terms/title> ?change . } ;\nINSERT { \n<> <info:fedora/fedora-system:def/relations-external#hasConstituent> <#{ActiveFedora.fedora.host}/test/foo> .\n<> <http://purl.org/dc/terms/title> \"bar\" .\n}\n WHERE { }" end end end
Version data entries
28 entries across 28 versions & 1 rubygems