diff options
author | Gilbert Roulot <groulot@gitlab.com> | 2019-03-14 15:55:46 +0300 |
---|---|---|
committer | Kamil TrzciĆski <ayufan@ayufan.eu> | 2019-03-14 15:55:46 +0300 |
commit | 6ab102a2f832a15c7aae3e4fa74dde6ad08e15db (patch) | |
tree | cb25cf8c16a62e0c50980657fada9a961c1a9c0b /spec | |
parent | b5bf179e6994566265cf91c32bcb264875b79249 (diff) |
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')
-rw-r--r-- | spec/controllers/groups_controller_spec.rb | 37 | ||||
-rw-r--r-- | spec/routing/group_routing_spec.rb | 4 |
2 files changed, 35 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 diff --git a/spec/routing/group_routing_spec.rb b/spec/routing/group_routing_spec.rb index 71788028cbf..53271550e8b 100644 --- a/spec/routing/group_routing_spec.rb +++ b/spec/routing/group_routing_spec.rb @@ -17,6 +17,10 @@ describe "Groups", "routing" do expect(get("/#{group_path}")).to route_to('groups#show', id: group_path) end + it "to #details" do + expect(get("/groups/#{group_path}/-/details")).to route_to('groups#details', id: group_path) + end + it "to #activity" do expect(get("/groups/#{group_path}/-/activity")).to route_to('groups#activity', id: group_path) end |