Commit 7c97e559 authored by Douglas Barbosa Alexandre's avatar Douglas Barbosa Alexandre

Merge branch 'coverage-controller-spec-perf' into 'master'

CoverageReportsController spec optimization

See merge request gitlab-org/gitlab!44657
parents f5588d02 81606d9e
......@@ -3,15 +3,15 @@
require 'spec_helper'
RSpec.describe Groups::Analytics::CoverageReportsController do
let(:user) { create(:user) }
let(:group) { create(:group) }
let(:project) { create(:project, namespace: group) }
let(:ref_path) { 'refs/heads/master' }
let_it_be(:user) { create(:user) }
let_it_be(:group) { create(:group) }
let_it_be(:project) { create(:project, namespace: group) }
let_it_be(:ref_path) { 'refs/heads/master' }
let!(: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(:first_coverage) { create_daily_coverage('rspec', project, 79.0, '2020-03-09') }
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,
start_date: '2020-03-01',
......@@ -21,11 +21,11 @@ RSpec.describe Groups::Analytics::CoverageReportsController do
}
end
context 'without permissions' do
before do
sign_in(user)
end
before do
sign_in(user)
end
context 'without permissions' do
describe 'GET index' do
it 'responds 403' do
get :index, params: valid_request_params
......@@ -38,7 +38,6 @@ RSpec.describe Groups::Analytics::CoverageReportsController do
context 'with permissions' do
before do
group.add_owner(user)
sign_in(user)
end
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