Sha256: 8115f32ff867becdce80c64724eab5a46fcabf31a8d14ec8c3f604c482a621c8
Contents?: true
Size: 1.94 KB
Versions: 17
Compression:
Stored size: 1.94 KB
Contents
require 'spec_helper' describe Hydra::Datastream::RightsMetadata do before :all do class RightsTest < ActiveFedora::Base include Hydra::AccessControls::Permissions end end after :all do Object.send(:remove_const,:RightsTest) end describe "rightsMetadata" do let!(:thing) {RightsTest.new} [:discover,:read, :edit].each do |mode| describe "##{mode}_users" do let(:get_method) {"#{mode}_users".to_sym} let(:set_method) {"#{mode}_users=".to_sym} before :each do thing.send(set_method, ['locutus@borg.collective.mil']) thing.save end it "should persist initial setting" do thing.reload.send(get_method).should == ['locutus@borg.collective.mil'] end it "should persist changes" do thing.send(set_method, ['locutus@borg.collective.mil','sevenofnine@borg.collective.mil']) thing.save thing.reload.send(get_method).should =~ ['locutus@borg.collective.mil','sevenofnine@borg.collective.mil'] end it "should persist emptiness" do thing.send(set_method, []) thing.save thing.reload.send(get_method).should == [] end end describe "##{mode}_groups" do let(:get_method) {"#{mode}_groups".to_sym} let(:set_method) {"#{mode}_groups=".to_sym} before :each do thing.send(set_method, ['borg']) thing.save end it "should persist initial setting" do thing.reload.send(get_method).should == ['borg'] end it "should persist changes" do thing.send(set_method, ['borg','federation']) thing.save thing.reload.send(get_method).should =~ ['borg','federation'] end it "should persist emptiness" do thing.send(set_method, []) thing.save thing.reload.send(get_method).should == [] end end end end end
Version data entries
17 entries across 17 versions & 1 rubygems