Sha256: a5ef2ab289a41da0f0915325db914cef4be25ec37a9ea40a621f5c691bd76b4c

Contents?: true

Size: 868 Bytes

Versions: 9

Compression:

Stored size: 868 Bytes

Contents

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

describe Hydra::PermissionsController do
  describe "create" do
    it "should create a new permissions entry" do
      @asset = ModsAsset.create
      post :create, :asset_id=>@asset.pid, :permission => {"actor_id"=>"_person_id_","actor_type"=>"person","access_level"=>"read"}      
      ModsAsset.find(@asset.pid).rightsMetadata.individuals.should == {"_person_id_" => "read"}
    end
  end
  describe "update" do
    it "should call Hydra::RightsMetadata properties setter" do
      @asset = ModsAsset.new
      @asset.rightsMetadata.permissions({:group=>"students"})
      @asset.save
      post :update, :asset_id=>@asset.pid, :permission => {"group"=>{"_group_id_"=>"discover"}}
      ModsAsset.find(@asset.pid).rightsMetadata.groups.should == {"_group_id_" => "discover"}
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
hydra-head-4.0.3 test_support/spec/controllers/permissions_controller_spec.rb
hydra-head-4.0.2 test_support/spec/controllers/permissions_controller_spec.rb
hydra-head-4.0.1 test_support/spec/controllers/permissions_controller_spec.rb
hydra-head-4.0.0 test_support/spec/controllers/permissions_controller_spec.rb
hydra-head-4.0.0.rc6 test_support/spec/controllers/permissions_controller_spec.rb
hydra-head-4.0.0.rc5 test_support/spec/controllers/permissions_controller_spec.rb
hydra-head-4.0.0.rc4 test_support/spec/controllers/permissions_controller_spec.rb
hydra-head-4.0.0.rc3 test_support/spec/controllers/permissions_controller_spec.rb
hydra-head-4.0.0.rc2 test_support/spec/controllers/permissions_controller_spec.rb