Sha256: 4a4892b1b6bddc8ce5f2107c8a57885148ea851e8e2d33e3d808983225ea5e68

Contents?: true

Size: 1001 Bytes

Versions: 18

Compression:

Stored size: 1001 Bytes

Contents

require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')

describe Hydra::ModelMethods do
  
  before :all do
    class TestModel < ActiveFedora::Base
      include Hydra::ModelMixins::CommonMetadata
      include Hydra::ModelMethods
      has_metadata :name => "properties", :type => Hydra::Datastream::Properties
    end
  end

  describe "apply_depositor_metadata" do
    subject {TestModel.new }
    it "should add edit access" do
      subject.apply_depositor_metadata('naomi')
      subject.rightsMetadata.individuals.should == {'naomi' => 'edit'}
    end
    it "should not overwrite people with edit access" do
      subject.rightsMetadata.permissions({:person=>"jessie"}, 'edit')
      subject.apply_depositor_metadata('naomi')
      subject.rightsMetadata.individuals.should == {'naomi' => 'edit', 'jessie' =>'edit'}
    end
    it "should set depositor" do
      subject.apply_depositor_metadata('chris')
      subject.properties.depositor.should == ['chris']
    end
  end
end

Version data entries

18 entries across 18 versions & 2 rubygems

Version Path
hydra-core-5.0.0.pre15 spec/lib/model_methods_spec.rb
hydra-core-5.0.0.pre14 spec/lib/model_methods_spec.rb
hydra-core-5.0.0.pre13 spec/lib/model_methods_spec.rb
hydra-core-5.0.0.pre12 spec/lib/model_methods_spec.rb
hydra-head-4.1.3 test_support/spec/lib/model_methods_spec.rb
hydra-core-5.0.0.pre11 spec/lib/model_methods_spec.rb
hydra-core-5.0.0.pre10 spec/lib/model_methods_spec.rb
hydra-head-4.1.2 test_support/spec/lib/model_methods_spec.rb
hydra-core-5.0.0.pre9 spec/lib/model_methods_spec.rb
hydra-core-5.0.0.pre8 spec/lib/model_methods_spec.rb
hydra-core-5.0.0.pre7 spec/lib/model_methods_spec.rb
hydra-core-5.0.0.pre6 spec/lib/model_methods_spec.rb
hydra-core-5.0.0.pre4 spec/lib/model_methods_spec.rb
hydra-core-5.0.0.pre3 spec/lib/model_methods_spec.rb
hydra-core-5.0.0.pre2 spec/lib/model_methods_spec.rb
hydra-core-5.0.0.pre1 spec/lib/model_methods_spec.rb
hydra-head-4.1.1 test_support/spec/lib/model_methods_spec.rb
hydra-head-4.1.0 test_support/spec/lib/model_methods_spec.rb