spec/auth/roles/role_set_spec.rb in ddr-models-1.13.2 vs spec/auth/roles/role_set_spec.rb in ddr-models-1.14.0
- old
+ new
@@ -17,11 +17,11 @@
let(:person) { FactoryGirl.build(:person) }
describe "#grant" do
let(:role1) { Role.build(type: "Editor", agent: "bob@example.com", scope: "resource") }
let(:role2) { Role.build(type: "Curator", agent: "sue@example.com", scope: "policy") }
- describe "by attributes" do
+ describe "by attributes" do
it "should be able to grant a role by type, agent name and (optionally) scope" do
subject.grant type: "Editor", agent: "bob@example.com", scope: "resource"
expect(subject.first).to eq(role1)
end
it "should not grant duplicate roles" do
@@ -107,16 +107,16 @@
before do
subject.grant role1, role2
end
it "should revoke all roles" do
expect { subject.revoke_all }.to change(subject, :size).from(2).to(0)
- end
+ end
end
describe "#to_a" do
let(:role1) { Role.build(type: "Editor", agent: "bob@example.com", scope: "resource") }
- let(:role2) { Role.build(type: "Curator", agent: "sue@example.com", scope: "policy") }
+ let(:role2) { Role.build(type: "Curator", agent: "sue@example.com", scope: "policy") }
before do
subject.grant role1, role2
end
it "should return a plain array containing the roles" do
result = subject.to_a
@@ -143,8 +143,8 @@
it "should be a Query object" do
expect(subject.where(type: "Contributor")).to be_a(Query)
end
end
- end
+ end
end
end