Sha256: cb724114a0acca63c66de4a0b4b9f01c28cdc58a85051c51b194f674e6e3027d

Contents?: true

Size: 893 Bytes

Versions: 7

Compression:

Stored size: 893 Bytes

Contents

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

describe GroupsController 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(:group).to_param

      assert_response :success
    end
  end

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

      sign_in @user
    end

    it "should render index" do
      get :index

      assert_response :success
    end

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

      assert_response :success
    end

    it "should render other group" do
      get :show, :id => Factory(:group).to_param

      assert_response :success
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
social_stream-0.3.6 spec/controllers/groups_controller_spec.rb
social_stream-0.3.5 spec/controllers/groups_controller_spec.rb
social_stream-0.3.4 spec/controllers/groups_controller_spec.rb
social_stream-0.3.3 spec/controllers/groups_controller_spec.rb
social_stream-0.3.2 spec/controllers/groups_controller_spec.rb
social_stream-0.3.1 spec/controllers/groups_controller_spec.rb
social_stream-0.3.0 spec/controllers/groups_controller_spec.rb