Sha256: 82295f874933847b8fe1edbbe7434afa5d6c9cd4dae9383231bb56db21868521
Contents?: true
Size: 790 Bytes
Versions: 231
Compression:
Stored size: 790 Bytes
Contents
require '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
231 entries across 231 versions & 4 rubygems