2017-05-24 06:25:44 -04:00
|
|
|
require 'spec_helper'
|
|
|
|
|
2018-07-27 09:12:35 -04:00
|
|
|
describe 'Admin Conversational Development Index' do
|
2017-05-24 06:25:44 -04:00
|
|
|
before do
|
2017-06-21 19:44:10 -04:00
|
|
|
sign_in(create(:admin))
|
2017-05-24 06:25:44 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
context 'when usage ping is disabled' do
|
|
|
|
it 'shows empty state' do
|
|
|
|
stub_application_setting(usage_ping_enabled: false)
|
|
|
|
|
2018-07-27 09:12:35 -04:00
|
|
|
visit admin_conversational_development_index_path
|
2017-05-24 06:25:44 -04:00
|
|
|
|
|
|
|
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-07-27 09:12:35 -04:00
|
|
|
visit admin_conversational_development_index_path
|
2017-05-24 06:25:44 -04:00
|
|
|
|
|
|
|
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-07-27 09:12:35 -04:00
|
|
|
visit admin_conversational_development_index_path
|
2017-05-24 06:25:44 -04:00
|
|
|
|
|
|
|
expect(page).to have_content(
|
|
|
|
'Issues created per active user 1.2 You 9.3 Lead 13.3%'
|
|
|
|
)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|