Sha256: 05e2beea1fbce02c9d21e4b8ae9ec833a5e054ed46a9a7dd0ed5d0401d23013c

Contents?: true

Size: 916 Bytes

Versions: 4

Compression:

Stored size: 916 Bytes

Contents

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

describe UsersController do
  render_views

  describe "when Anonymous" do
    it "should render index" do
      get :index

      assert_response :success
    end

    it "should render show" do
      get :show, :id => Factory(:friend, :receiver => Factory(:group).actor).sender_subject.to_param

      assert_response :success
    end
  end

  describe "when authenticated" do
    before do
      @user = Factory(:friend, :receiver => Factory(:group).actor).sender_subject

      sign_in @user
    end

    it "should render index" do
      get :index

      assert_response :success
    end

    it "should render self page" do
      get :show, :id => @user.to_param

      assert_response :success
    end

    it "should render self page" do
      get :show, :id => Factory(:user).to_param

      assert_response :success
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
social_stream-0.4.3 spec/controllers/users_controller_spec.rb
social_stream-0.4.2 spec/controllers/users_controller_spec.rb
social_stream-0.4.1 spec/controllers/users_controller_spec.rb
social_stream-0.4.0 spec/controllers/users_controller_spec.rb