debian-mirror-gitlab/spec/features/instance_statistics/dev_ops_score_spec.rb

61 lines
1.5 KiB
Ruby
Raw Normal View History

2019-09-04 21:01:54 +05:30
# frozen_string_literal: true
2017-09-10 17:25:29 +05:30
require 'spec_helper'
2020-06-23 00:09:42 +05:30
RSpec.describe 'DevOps Score' do
2017-09-10 17:25:29 +05:30
before do
sign_in(create(:admin))
end
2018-11-18 11:00:15 +05:30
it 'has dismissable intro callout', :js do
2020-01-01 13:55:28 +05:30
visit instance_statistics_dev_ops_score_index_path
2018-11-18 11:00:15 +05:30
2020-01-01 13:55:28 +05:30
expect(page).to have_content 'Introducing Your DevOps Score'
2018-11-18 11:00:15 +05:30
find('.js-close-callout').click
2020-01-01 13:55:28 +05:30
expect(page).not_to have_content 'Introducing Your DevOps Score'
2018-11-18 11:00:15 +05:30
end
2017-09-10 17:25:29 +05:30
context 'when usage ping is disabled' do
2018-11-20 20:47:30 +05:30
before do
2017-09-10 17:25:29 +05:30
stub_application_setting(usage_ping_enabled: false)
2018-11-20 20:47:30 +05:30
end
2017-09-10 17:25:29 +05:30
2018-11-20 20:47:30 +05:30
it 'shows empty state' do
2020-01-01 13:55:28 +05:30
visit instance_statistics_dev_ops_score_index_path
2017-09-10 17:25:29 +05:30
expect(page).to have_content('Usage ping is not enabled')
end
2018-11-20 20:47:30 +05:30
it 'hides the intro callout' do
2020-01-01 13:55:28 +05:30
visit instance_statistics_dev_ops_score_index_path
2018-11-20 20:47:30 +05:30
2020-01-01 13:55:28 +05:30
expect(page).not_to have_content 'Introducing Your DevOps Score'
2018-11-20 20:47:30 +05:30
end
2017-09-10 17:25:29 +05:30
end
context 'when there is no data to display' do
it 'shows empty state' do
stub_application_setting(usage_ping_enabled: true)
2020-01-01 13:55:28 +05:30
visit instance_statistics_dev_ops_score_index_path
2017-09-10 17:25:29 +05:30
expect(page).to have_content('Data is still calculating')
end
end
context 'when there is data to display' do
it 'shows numbers for each metric' do
stub_application_setting(usage_ping_enabled: true)
2020-01-01 13:55:28 +05:30
create(:dev_ops_score_metric)
2017-09-10 17:25:29 +05:30
2020-01-01 13:55:28 +05:30
visit instance_statistics_dev_ops_score_index_path
2017-09-10 17:25:29 +05:30
expect(page).to have_content(
'Issues created per active user 1.2 You 9.3 Lead 13.3%'
)
end
end
end