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

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

require 'spec_helper'

RSpec.describe "Admin > Admin sees project statistics", feature_category: :projects do
  let(:current_user) { create(:admin) }

  before do
    sign_in(current_user)
    gitlab_enable_admin_mode_sign_in(current_user)

    visit admin_project_path(project)
  end

  context 'when project has statistics' do
    let(:project) { create(:project, :repository) }

    it "shows project statistics" do
      expect(page).to have_content("Storage: 0 Bytes (Repository: 0 Bytes / Wikis: 0 Bytes / Build Artifacts: 0 Bytes / Pipeline Artifacts: 0 Bytes / LFS: 0 Bytes / Snippets: 0 Bytes / Packages: 0 Bytes / Uploads: 0 Bytes)")
    end
  end

  context 'when project has no statistics' do
    let(:project) { create(:project, :repository) { |project| project.statistics.destroy! } }

    it "shows 'Storage: Unknown'" do
      expect(page).to have_content("Storage: Unknown")
    end
  end
end