summaryrefslogtreecommitdiff
path: root/spec/features/instance_statistics/instance_statistics.rb
blob: d03e6e68075dc204f62beaf22962ff73b40e856b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
require 'rails_helper'

describe 'Cohorts page', :js do
  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