Sha256: 7a34738676705e6659eb676f06877a557cdc3abe484036cd94ea18c0be91f921
Contents?: true
Size: 1022 Bytes
Versions: 20
Compression:
Stored size: 1022 Bytes
Contents
require 'spec_helper' describe ActiveFedora::Base do before do class Foo < ActiveFedora::Base has_metadata "foostream", type: ActiveFedora::SimpleDatastream do |m| m.field "foostream", :string end has_metadata 'dcstream', type: ActiveFedora::QualifiedDublinCoreDatastream end class Bar < ActiveFedora::Base has_metadata 'barstream', type: ActiveFedora::SimpleDatastream do |m| m.field "barfield", :string end end end it "doesn't overwrite stream specs" do f = Foo.new expect(f.attached_files.size).to eq 2 streams = f.attached_files.values.map { |x| x.class.to_s }.sort expect(streams.pop).to eq "ActiveFedora::SimpleDatastream" expect(streams.pop).to eq "ActiveFedora::QualifiedDublinCoreDatastream" end it "works for multiple types" do b = Foo.new f = Bar.new expect(b.class.ds_specs).to_not eq f.class.ds_specs end after do Object.send(:remove_const, :Bar) Object.send(:remove_const, :Foo) end end
Version data entries
20 entries across 20 versions & 1 rubygems