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

Version Path
social_stream-base-0.9.5 spec/models/profile_spec.rb
social_stream-base-0.9.4 spec/models/profile_spec.rb
social_stream-base-0.9.3 spec/models/profile_spec.rb
social_stream-base-0.9.2 spec/models/profile_spec.rb
social_stream-base-0.9.1 spec/models/profile_spec.rb
social_stream-base-0.9.0 spec/models/profile_spec.rb
social_stream-base-0.8.2 spec/models/profile_spec.rb
social_stream-base-0.8.1 spec/models/profile_spec.rb
social_stream-base-0.8.0 spec/models/profile_spec.rb
social_stream-base-0.7.11 spec/models/profile_spec.rb
social_stream-base-0.7.10 spec/models/profile_spec.rb
social_stream-base-0.7.9 spec/models/profile_spec.rb
social_stream-base-0.7.8 spec/models/profile_spec.rb
social_stream-base-0.7.7 spec/models/profile_spec.rb
social_stream-base-0.7.6 spec/models/profile_spec.rb
social_stream-base-0.7.5 spec/models/profile_spec.rb
social_stream-base-0.7.4 spec/models/profile_spec.rb
social_stream-base-0.7.3 spec/models/profile_spec.rb
social_stream-base-0.7.2 spec/models/profile_spec.rb
social_stream-base-0.7.1 spec/models/profile_spec.rb