Sha256: 5d2adbf0c6c8f039d217f8d2bb868544ca1ab49cf05dc20c0f98d3e515a99e05

Contents?: true

Size: 1.17 KB

Versions: 3

Compression:

Stored size: 1.17 KB

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

    it "should update contact group" do
      @group = Factory(:member, :receiver => @user.actor).sender_subject
      put :update, :id => @group.to_param,
                   "group" => { "profile_attributes" => { "organization" => "Social Stream" } }

      response.should redirect_to(@group)
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

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