Commit 81606d9e authored by drew cimino's avatar drew cimino

CoverageReportsController spec optimization

parent b4b7d577
...@@ -3,15 +3,15 @@ ...@@ -3,15 +3,15 @@
require 'spec_helper' require 'spec_helper'
RSpec.describe Groups::Analytics::CoverageReportsController do RSpec.describe Groups::Analytics::CoverageReportsController do
let(:user) { create(:user) } let_it_be(:user) { create(:user) }
let(:group) { create(:group) } let_it_be(:group) { create(:group) }
let(:project) { create(:project, namespace: group) } let_it_be(:project) { create(:project, namespace: group) }
let(:ref_path) { 'refs/heads/master' } let_it_be(:ref_path) { 'refs/heads/master' }
let!(:first_coverage) { create_daily_coverage('rspec', project, 79.0, '2020-03-09') } let_it_be(:first_coverage) { create_daily_coverage('rspec', project, 79.0, '2020-03-09') }
let!(:last_coverage) { create_daily_coverage('karma', project, 95.0, '2020-03-10') } let_it_be(:last_coverage) { create_daily_coverage('karma', project, 95.0, '2020-03-10') }
let(:valid_request_params) do let_it_be(:valid_request_params) do
{ {
group_id: group.name, group_id: group.name,
start_date: '2020-03-01', start_date: '2020-03-01',
...@@ -21,11 +21,11 @@ RSpec.describe Groups::Analytics::CoverageReportsController do ...@@ -21,11 +21,11 @@ RSpec.describe Groups::Analytics::CoverageReportsController do
} }
end end
context 'without permissions' do
before do before do
sign_in(user) sign_in(user)
end end
context 'without permissions' do
describe 'GET index' do describe 'GET index' do
it 'responds 403' do it 'responds 403' do
get :index, params: valid_request_params get :index, params: valid_request_params
...@@ -38,7 +38,6 @@ RSpec.describe Groups::Analytics::CoverageReportsController do ...@@ -38,7 +38,6 @@ RSpec.describe Groups::Analytics::CoverageReportsController do
context 'with permissions' do context 'with permissions' do
before do before do
group.add_owner(user) group.add_owner(user)
sign_in(user)
end end
context 'without a license' do context 'without a license' do
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment