Sha256: 8c89783e46cdc2be75d365739491e92bcb7ad064f767d4805670863c137fce7e
Contents?: true
Size: 994 Bytes
Versions: 12
Compression:
Stored size: 994 Bytes
Contents
module Ddr::Auth RSpec.describe LegacyRoles do subject { described_class.new(obj) } let(:obj) { FactoryGirl.build(:component) } before do @deprecation_behavior = Deprecation.default_deprecation_behavior Deprecation.default_deprecation_behavior = :silence obj.adminMetadata.downloader = ["bob@example.com", "Downloaders"] end after do Deprecation.default_deprecation_behavior = @deprecation_behavior end it "should convert the legacy roles to new roles" do expect(subject.to_roles) .to eq(Roles::DetachedRoleSet.new( [ Roles::Role.build(type: "Downloader", agent: "Downloaders", scope: "resource"), Roles::Role.build(type: "Downloader", agent: "bob@example.com", scope: "resource") ] )) end it "should clear the legacy roles" do expect { subject.clear }.to change(obj.adminMetadata.downloader, :empty?).from(false).to(true) end end end
Version data entries
12 entries across 12 versions & 1 rubygems