Sha256: 4ac7b579297b2e8de20057688b07c22d3c916d46c356495d929bb0eaeda3c0cd

Contents?: true

Size: 1.09 KB

Versions: 149

Compression:

Stored size: 1.09 KB

Contents

require 'spec_helper'

describe HomeController do
  include SocialStream::TestHelpers

  render_views

  describe "when Anonymous" do
    it "should redirect to login" do
      get :index
      response.should redirect_to(new_user_session_path)
    end
  end

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

    it "should render" do
      get :index

      response.should be_success
      response.body.should =~ /activities_share_btn/
    end

    context "with a group" do
      before do
        Factory(:friend,
                :contact => Factory(:g2g_contact, :sender => @user.actor))
      end

      it "should render" do
        get :index

        response.should be_success
        response.body.should =~ /activities_share_btn/
      end
    end

    describe "when representing" do
      before do
        @represented = represent(Factory(:group))
      end

      it "should render represented home" do
        get :index

        assert_response :success
        assigns(:current_subject).should == @represented
      end
    end
  end
end

Version data entries

149 entries across 149 versions & 4 rubygems

Version Path
social_stream-1.1.12 base/spec/controllers/home_controller_spec.rb
social_stream-base-1.1.11 spec/controllers/home_controller_spec.rb
social_stream-1.1.11 base/spec/controllers/home_controller_spec.rb
social_stream-base-1.1.10 spec/controllers/home_controller_spec.rb
social_stream-1.1.10 base/spec/controllers/home_controller_spec.rb
social_stream-base-1.1.9 spec/controllers/home_controller_spec.rb
social_stream-1.1.9 base/spec/controllers/home_controller_spec.rb
social_stream-base-1.1.8 spec/controllers/home_controller_spec.rb
social_stream-1.1.8 base/spec/controllers/home_controller_spec.rb
social_stream-base-1.1.7 spec/controllers/home_controller_spec.rb
social_stream-1.1.7 base/spec/controllers/home_controller_spec.rb
social_stream-base-1.1.6 spec/controllers/home_controller_spec.rb
social_stream-1.1.6 base/spec/controllers/home_controller_spec.rb
social_stream-base-1.1.5 spec/controllers/home_controller_spec.rb
social_stream-1.1.5 base/spec/controllers/home_controller_spec.rb
social_stream-base-1.1.4 spec/controllers/home_controller_spec.rb
social_stream-1.1.4 base/spec/controllers/home_controller_spec.rb
social_stream-1.1.3 base/spec/controllers/home_controller_spec.rb
social_stream-base-1.1.3 spec/controllers/home_controller_spec.rb
social_stream-1.1.2 base/spec/controllers/home_controller_spec.rb