debian-mirror-gitlab/spec/features/admin/admin_sees_project_statistics_spec.rb

31 lines
912 B
Ruby
Raw Normal View History

2019-09-04 21:01:54 +05:30
# frozen_string_literal: true
require 'spec_helper'
2020-06-23 00:09:42 +05:30
RSpec.describe "Admin > Admin sees project statistics" do
2019-09-04 21:01:54 +05:30
let(:current_user) { create(:admin) }
before do
sign_in(current_user)
2021-02-22 17:27:13 +05:30
gitlab_enable_admin_mode_sign_in(current_user)
2019-09-04 21:01:54 +05:30
visit admin_project_path(project)
end
context 'when project has statistics' do
let(:project) { create(:project, :repository) }
it "shows project statistics" do
2021-12-11 22:18:48 +05:30
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)")
2019-09-04 21:01:54 +05:30
end
end
context 'when project has no statistics' do
2021-04-29 21:17:54 +05:30
let(:project) { create(:project, :repository) { |project| project.statistics.destroy! } }
2019-09-04 21:01:54 +05:30
it "shows 'Storage: Unknown'" do
expect(page).to have_content("Storage: Unknown")
end
end
end