summaryrefslogtreecommitdiff
path: root/spec/features/instance_statistics
diff options
context:
space:
mode:
authorLuke Bennett <lukeeeebennettplus@gmail.com>2018-07-18 01:37:58 +0100
committerBob Van Landuyt <bob@vanlanduyt.co>2018-07-27 15:54:26 +0200
commit602a1c34e33d75940c7acbf4a31a65e187dbbfde (patch)
tree580e136cf3a00cd15ade56447928ece7ad127f2c /spec/features/instance_statistics
parented81ee9ba2b5a0b68996ccb238bfa4c69a6df062 (diff)
downloadgitlab-ce-602a1c34e33d75940c7acbf4a31a65e187dbbfde.tar.gz
Create instance_statistics namespace and move convdev index and cohorts to it
Diffstat (limited to 'spec/features/instance_statistics')
-rw-r--r--spec/features/instance_statistics/cohorts_spec.rb15
-rw-r--r--spec/features/instance_statistics/conversational_development_index_spec.rb40
2 files changed, 55 insertions, 0 deletions
diff --git a/spec/features/instance_statistics/cohorts_spec.rb b/spec/features/instance_statistics/cohorts_spec.rb
new file mode 100644
index 00000000000..81fc5eff980
--- /dev/null
+++ b/spec/features/instance_statistics/cohorts_spec.rb
@@ -0,0 +1,15 @@
+require 'rails_helper'
+
+describe 'Cohorts page' do
+ before do
+ sign_in(create(:admin))
+ end
+
+ it 'See users count per month' do
+ 2.times { create(:user) }
+
+ visit instance_statistics_cohorts_path
+
+ expect(page).to have_content("#{Time.now.strftime('%b %Y')} 3 0")
+ end
+end
diff --git a/spec/features/instance_statistics/conversational_development_index_spec.rb b/spec/features/instance_statistics/conversational_development_index_spec.rb
new file mode 100644
index 00000000000..d441a7a5af9
--- /dev/null
+++ b/spec/features/instance_statistics/conversational_development_index_spec.rb
@@ -0,0 +1,40 @@
+require 'spec_helper'
+
+describe 'Conversational Development Index' do
+ before do
+ sign_in(create(:admin))
+ end
+
+ context 'when usage ping is disabled' do
+ it 'shows empty state' do
+ stub_application_setting(usage_ping_enabled: false)
+
+ visit instance_statistics_conversational_development_index_index_path
+
+ expect(page).to have_content('Usage ping is not enabled')
+ end
+ end
+
+ context 'when there is no data to display' do
+ it 'shows empty state' do
+ stub_application_setting(usage_ping_enabled: true)
+
+ visit instance_statistics_conversational_development_index_index_path
+
+ 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)
+ create(:conversational_development_index_metric)
+
+ visit instance_statistics_conversational_development_index_index_path
+
+ expect(page).to have_content(
+ 'Issues created per active user 1.2 You 9.3 Lead 13.3%'
+ )
+ end
+ end
+end