This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
describe 'aggregates' do | |
it "should be empty array if we haven't set it" do | |
expect(subject.aggregates).to match_array([]) | |
end | |
it "should be set to a URI producing an ActiveTriple::Resource" do | |
subject.aggregates = RDF::URI("http://example.org/b1") | |
expect(subject.aggregates.first).to be_a ActiveTriples::Resource | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
describe "set_value" do | |
it "should add a single value when none exist a priori" do | |
vals = subject.get_values('aggregates') | |
vals << "foo" | |
subject.set_value('aggregates',vals) | |
expect(subject.get_values('aggregates')).to eq ["foo"] | |
end | |
it "should add a single value when one value exists a priority" do | |
subject.aggregates = "foo" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Array | |
def move(from,to) | |
insert(to, delete_at(from)) | |
end | |
end | |
def gen_list(max_items) | |
items = [] | |
header_info = {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'spec_helper' | |
describe ActiveTriples::Resource do | |
describe '#destroy' do | |
before do | |
class DummyResource < ActiveTriples::Resource | |
configure :type => RDF::URI('http://example.org/SomeClass'), | |
:base_uri => 'http://example.org/dummy/', | |
:repository => :default |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
t = file.metadata_node.get_values(:type) | |
t << RDFVocabularies::WorksTerms.Thumbnail | |
file.metadata_node.set_value(:type,t) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Hydra::PCDM | |
class Order < ActiveFedora::Base | |
include Hydra::PCDM::OrderBehavior | |
end | |
end | |
module Hydra::PCDM | |
module OrderBehavior | |
extend ActiveSupport::Concern | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# MODIFICATIONS to object code | |
module Hydra::PCDM | |
class ObjectBehavior | |
# pcdm:hasMember objects | |
aggregates :members, predicate: RDFVocabularies::PCDMTerms.hasMember, | |
class_name: "ActiveFedora::Base" | |
# ore:aggregates related objects | |
indirectly_contains :related_objects, has_member_relation: RDF::Vocab::ORE.aggregates, | |
inserted_content_relation: RDF::Vocab::ORE.proxyFor, class_name: "ActiveFedora::Base", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'spec_helper' | |
describe Hydra::PCDM::Object do | |
describe '#objects=, +=, <<' do | |
context 'with acceptable child objects' do | |
let(:object1) { described_class.new } | |
let(:object2) { described_class.new } | |
let(:object3) { described_class.new } | |
let(:object4) { described_class.new } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
describe "delete fails" do | |
before do | |
image.child_objects = [test_object] | |
expect( image.child_objects ).to eq [test_object] # FAILS when using this line | |
image.child_objects.delete(test_object) | |
end | |
subject { image.child_objects } | |
it { is_expected.to eq [] } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'spec_helper' | |
describe 'generic_files/new.html.erb', type: :view do | |
let(:user_collection) { | |
default_option = SolrDocument.new(id: -1, title_tesim: "Select collection...") | |
col1 = SolrDocument.new(id: "1", title_tesim: "col1") | |
col2 = SolrDocument.new(id: "2", title_tesim: "col2") | |
[default_option, col1, col2] | |
} |
OlderNewer