Welcome to mirror list, hosted at ThFree Co, Russian Federation.

admin_cohorts_spec.rb « admin « features « spec - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: f91446ed222f991997d0167aa24c13e1b2184a3e (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
# frozen_string_literal: true

require 'spec_helper'

RSpec.describe 'Cohorts page' do
  before do
    sign_in(create(:admin))
  end

  context 'with usage ping enabled' do
    it 'shows users count per month' do
      stub_application_setting(usage_ping_enabled: true)

      create_list(:user, 2)

      visit admin_cohorts_path

      expect(page).to have_content("#{Time.now.strftime('%b %Y')} 3 0")
    end
  end

  context 'with usage ping disabled' do
    it 'shows empty state', :js do
      stub_application_setting(usage_ping_enabled: false)

      visit admin_cohorts_path

      expect(page).to have_selector(".js-empty-state")
    end
  end
end