2017-09-10 17:25:29 +05:30
|
|
|
require 'spec_helper'
|
|
|
|
|
2018-11-18 11:00:15 +05:30
|
|
|
describe 'Conversational Development Index' 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
|
|
|
|
visit instance_statistics_conversational_development_index_index_path
|
|
|
|
|
|
|
|
expect(page).to have_content 'Introducing Your Conversational Development Index'
|
|
|
|
|
|
|
|
find('.js-close-callout').click
|
|
|
|
|
|
|
|
expect(page).not_to have_content 'Introducing Your Conversational Development Index'
|
|
|
|
end
|
|
|
|
|
2017-09-10 17:25:29 +05:30
|
|
|
context 'when usage ping is disabled' do
|
|
|
|
it 'shows empty state' do
|
|
|
|
stub_application_setting(usage_ping_enabled: false)
|
|
|
|
|
2018-11-18 11:00:15 +05:30
|
|
|
visit instance_statistics_conversational_development_index_index_path
|
2017-09-10 17:25:29 +05:30
|
|
|
|
|
|
|
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)
|
|
|
|
|
2018-11-18 11:00:15 +05:30
|
|
|
visit instance_statistics_conversational_development_index_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)
|
|
|
|
create(:conversational_development_index_metric)
|
|
|
|
|
2018-11-18 11:00:15 +05:30
|
|
|
visit instance_statistics_conversational_development_index_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
|