Sha256: dbfe9b0c52fdaa2e81d545d1cf3cddfb12a3b054790a0d6e2bcc63cd12dc38a2
Contents?: true
Size: 1.05 KB
Versions: 2
Compression:
Stored size: 1.05 KB
Contents
require 'spec_helper' describe ActiveFedora::WithMetadata::MetadataNode do let(:generated_schema) { Class.new(described_class) } let(:file) { ActiveFedora::File.new } let(:node) { generated_schema.new(file) } let(:book) { RDF::URI.new('http://example.com/ns/Book') } describe "#changed_attributes" do subject { node.changed_attributes } context "when type is not set" do it { is_expected.to eq({}) } end context "when type is set" do before do generated_schema.configure type: book end it { is_expected.to eq('type' => true) } end end describe "changes_for_update" do subject { changes_for_update } let(:changes_for_update) { node.send(:changes_for_update) } context "when type is not set" do it { is_expected.to eq({}) } end context "when type is set" do before do generated_schema.configure type: book end it "is expected to have the rdf type statement" do expect(changes_for_update[::RDF.type]).to be_present end end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
active-fedora-11.1.6 | spec/unit/with_metadata/metadata_node_spec.rb |
active-fedora-11.1.5 | spec/unit/with_metadata/metadata_node_spec.rb |