Sha256: 6b6ad3c6becc3ecfd05d08e1e2b294acd29dc59ce8509f340677a2f5c04c8035
Contents?: true
Size: 1.81 KB
Versions: 171
Compression:
Stored size: 1.81 KB
Contents
require 'spec_helper' describe Relation do context "authorization" do before(:all) do @tie = Factory(:friend) @relation = @tie.relation end describe ", receiver" do before do @s = @tie.receiver end it "creates activity" do Relation.allow(@s, 'create', 'activity').should include(@relation) end it "reads activity" do Relation.allow(@s, 'read', 'activity').should include(@relation) end end describe ", acquaintance" do before do @s = Factory(:acquaintance, :contact => Factory(:contact, :sender => @tie.sender)).receiver end it "creates activity" do Relation.allow(@s, 'create', 'activity').should_not include(@relation) end it "reads activity" do Relation.allow(@s, 'read', 'activity').should_not include(@relation) end end describe ", alien" do before do @s = Factory(:user) end it "creates activity" do Relation.allow(@s, 'create', 'activity').should_not include(@relation) end it "reads activity" do Relation.allow(@s, 'read', 'activity').should_not include(@relation) end end end describe "member" do before do @tie = Factory(:member) @relation = @tie.relation end describe ", member" do before do @s = Factory(:member, :contact => Factory(:contact, :sender => @tie.sender)).receiver end it "creates activity" do Relation.allow(@s, 'create', 'activity').should include(@relation) end it "reads activity" do Relation.allow(@s, 'read', 'activity').should include(@relation) end it "updates activity" do Relation.allow(@s, 'update', 'activity').should_not include(@relation) end end end end
Version data entries
171 entries across 171 versions & 4 rubygems