Sha256: 434eeb1236dcadaf1ba1b4c96d7e9a51639d6a38a6a97c7fd7ff3a4f734310eb

Contents?: true

Size: 1.09 KB

Versions: 3

Compression:

Stored size: 1.09 KB

Contents

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

describe Hydra::PermissionsController do
  before :all do
    @behavior = Hydra::PermissionsController.deprecation_behavior
    Hydra::PermissionsController.deprecation_behavior = :silence
  end

  after :all do
    Hydra::PermissionsController.deprecation_behavior = @behavior 
  end
  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

3 entries across 3 versions & 1 rubygems

Version Path
hydra-head-4.1.2 test_support/spec/controllers/permissions_controller_spec.rb
hydra-head-4.1.1 test_support/spec/controllers/permissions_controller_spec.rb
hydra-head-4.1.0 test_support/spec/controllers/permissions_controller_spec.rb