Sha256: a93c307140087cc62e02fcbbe86a6c3ca5b94aae2fd708578b78e1fa5a1fb9fa
Contents?: true
Size: 837 Bytes
Versions: 33
Compression:
Stored size: 837 Bytes
Contents
require File.expand_path(File.dirname(__FILE__) + '/../spec_helper') describe Profile do context "belonging to a user" do before do @profile = Factory(:user).profile end context "accessed by her" do before do @ability = Ability.new(@profile.subject) end it "should allow read" do @ability.should be_able_to(:read, @profile) end it "should allow update" do @ability.should be_able_to(:update, @profile) end end context "accessed by other" do before do u = Factory(:user) @ability = Ability.new(u) end it "should allow read" do @ability.should be_able_to(:read, @profile) end it "should deny update" do @ability.should_not be_able_to(:update, @profile) end end end end
Version data entries
33 entries across 33 versions & 2 rubygems