BigW Consortium Gitlab

groups_controller_spec.rb 463 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
require 'rails_helper'

describe GroupsController do
  describe 'GET index' do
    context 'as a user' do
      it 'redirects to Groups Dashboard' do
        sign_in(create(:user))

        get :index

        expect(response).to redirect_to(dashboard_groups_path)
      end
    end

    context 'as a guest' do
      it 'redirects to Explore Groups' do
        get :index

        expect(response).to redirect_to(explore_groups_path)
      end
    end
  end
end