2019-12-21 20:55:43 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2016-09-13 17:45:13 +05:30
|
|
|
require 'spec_helper'
|
|
|
|
|
|
|
|
describe 'admin/dashboard/index.html.haml' do
|
2016-11-03 12:29:30 +05:30
|
|
|
include Devise::Test::ControllerHelpers
|
2016-09-13 17:45:13 +05:30
|
|
|
|
|
|
|
before do
|
2018-11-08 19:23:39 +05:30
|
|
|
counts = Admin::DashboardController::COUNTED_ITEMS.each_with_object({}) do |item, hash|
|
|
|
|
hash[item] = 100
|
|
|
|
end
|
|
|
|
|
|
|
|
assign(:counts, counts)
|
2017-09-10 17:25:29 +05:30
|
|
|
assign(:projects, create_list(:project, 1))
|
2016-09-13 17:45:13 +05:30
|
|
|
assign(:users, create_list(:user, 1))
|
|
|
|
assign(:groups, create_list(:group, 1))
|
|
|
|
|
|
|
|
allow(view).to receive(:admin?).and_return(true)
|
2018-03-17 18:26:18 +05:30
|
|
|
allow(view).to receive(:current_application_settings).and_return(Gitlab::CurrentSettings.current_application_settings)
|
2019-12-21 20:55:43 +05:30
|
|
|
allow(view).to receive(:show_license_breakdown?).and_return(false)
|
2016-09-13 17:45:13 +05:30
|
|
|
end
|
|
|
|
|
|
|
|
it "shows version of GitLab Workhorse" do
|
|
|
|
render
|
|
|
|
|
|
|
|
expect(rendered).to have_content 'GitLab Workhorse'
|
|
|
|
expect(rendered).to have_content Gitlab::Workhorse.version
|
|
|
|
end
|
2018-10-15 14:42:47 +05:30
|
|
|
|
|
|
|
it "includes revision of GitLab" do
|
|
|
|
render
|
|
|
|
|
|
|
|
expect(rendered).to have_content "#{Gitlab::VERSION} (#{Gitlab.revision})"
|
|
|
|
end
|
2016-09-13 17:45:13 +05:30
|
|
|
end
|