summaryrefslogtreecommitdiff
path: root/spec/features/admin/admin_conversational_development_index_spec.rb
blob: 739ab907a29adb14afdeecc376a26dfa9654e5f7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
require 'spec_helper'

describe 'Admin Conversational Development Index' do
  before do
    login_as :admin
  end

  context 'when usage ping is disabled' do
    it 'shows empty state' do
      stub_application_setting(usage_ping_enabled: false)

      visit admin_conversational_development_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 admin_conversational_development_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 admin_conversational_development_index_path

      expect(page).to have_content(
        'Issues created per active user 1.2 You 9.3 Lead 13.3%'
      )
    end
  end
end