Sha256: 02d9c8020eca3b6b6e1f2955fb7508bc6b591d9547186050af0aab7aa31ce1cd

Contents?: true

Size: 956 Bytes

Versions: 24

Compression:

Stored size: 956 Bytes

Contents

require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')

describe PermissionsController do
  include SocialStream::TestHelpers::Controllers

  render_views

  describe "when authenticated" do
    before do
      @user = Factory(:user)

      sign_in @user
    end

    context "with an existing relation" do
      before do
        @relation = Factory(:relation_custom, :actor_id => @user.actor_id)
      end

      it "should render index" do
        get :index, :relation_id => @relation.id, :format => "js"

        response.should be_success
      end
    end

    context "a external relation" do
      before do
        @relation = Factory(:relation_custom)
      end

      it "should not render index" do
        begin
          get :index, :relation_id => @relation.id, :format => "js"

          assert false
        rescue CanCan::AccessDenied
          assigns(:permissions).should be_nil
        end
      end
    end
  end
end


Version data entries

24 entries across 24 versions & 1 rubygems

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