diff options
author | Gilbert Roulot <groulot@gitlab.com> | 2019-03-14 12:55:46 +0000 |
---|---|---|
committer | Kamil TrzciĆski <ayufan@ayufan.eu> | 2019-03-14 12:55:46 +0000 |
commit | 6ab102a2f832a15c7aae3e4fa74dde6ad08e15db (patch) | |
tree | cb25cf8c16a62e0c50980657fada9a961c1a9c0b /spec/controllers | |
parent | b5bf179e6994566265cf91c32bcb264875b79249 (diff) | |
download | gitlab-ce-6ab102a2f832a15c7aae3e4fa74dde6ad08e15db.tar.gz |
Security Dashboard as default view for groups
Add a supporting code to separate groups#show
and groups#details which is required for the
proper implementation of the Group Overview
content and Security Dashboard option for it
Diffstat (limited to 'spec/controllers')
-rw-r--r-- | spec/controllers/groups_controller_spec.rb | 37 |
1 files changed, 31 insertions, 6 deletions
diff --git a/spec/controllers/groups_controller_spec.rb b/spec/controllers/groups_controller_spec.rb index 21e5122c06b..b2e6df6060a 100644 --- a/spec/controllers/groups_controller_spec.rb +++ b/spec/controllers/groups_controller_spec.rb @@ -32,21 +32,46 @@ describe GroupsController do end end + shared_examples 'details view' do + it { is_expected.to render_template('groups/show') } + + context 'as atom' do + let!(:event) { create(:event, project: project) } + let(:format) { :atom } + + it { is_expected.to render_template('groups/show') } + + it 'assigns events for all the projects in the group' do + subject + expect(assigns(:events)).to contain_exactly(event) + end + end + end + describe 'GET #show' do before do sign_in(user) project end - context 'as atom' do - it 'assigns events for all the projects in the group' do - create(:event, project: project) + let(:format) { :html } - get :show, params: { id: group.to_param }, format: :atom + subject { get :show, params: { id: group.to_param }, format: format } - expect(assigns(:events)).not_to be_empty - end + it_behaves_like 'details view' + end + + describe 'GET #details' do + before do + sign_in(user) + project end + + let(:format) { :html } + + subject { get :details, params: { id: group.to_param }, format: format } + + it_behaves_like 'details view' end describe 'GET edit' do |