2019-10-12 21:52:04 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2019-12-04 20:38:33 +05:30
|
|
|
require 'spec_helper'
|
2018-11-20 20:47:30 +05:30
|
|
|
|
2020-06-23 00:09:42 +05:30
|
|
|
RSpec.describe 'Cohorts page', :js do
|
2018-11-20 20:47:30 +05:30
|
|
|
before do
|
|
|
|
sign_in(create(:admin))
|
|
|
|
end
|
|
|
|
|
|
|
|
it 'hides cohorts nav button when usage ping is disabled' do
|
|
|
|
stub_application_setting(usage_ping_enabled: false)
|
|
|
|
|
|
|
|
visit instance_statistics_root_path
|
|
|
|
|
|
|
|
expect(find('.nav-sidebar')).not_to have_content('Cohorts')
|
|
|
|
end
|
|
|
|
|
|
|
|
it 'shows cohorts nav button when usage ping is enabled' do
|
|
|
|
stub_application_setting(usage_ping_enabled: true)
|
|
|
|
|
|
|
|
visit instance_statistics_root_path
|
|
|
|
|
|
|
|
expect(find('.nav-sidebar')).to have_content('Cohorts')
|
|
|
|
end
|
|
|
|
end
|