2016-07-18 07:58:08 -04:00
|
|
|
require 'spec_helper'
|
|
|
|
|
|
|
|
describe 'admin/dashboard/index.html.haml' do
|
2016-09-21 19:06:33 -04:00
|
|
|
include Devise::Test::ControllerHelpers
|
2016-07-18 07:58:08 -04:00
|
|
|
|
|
|
|
before do
|
2018-05-25 17:28:16 -04:00
|
|
|
counts = Admin::DashboardController::COUNTED_ITEMS.each_with_object({}) do |item, hash|
|
|
|
|
hash[item] = 100
|
|
|
|
end
|
|
|
|
|
|
|
|
assign(:counts, counts)
|
2017-08-02 15:55:11 -04:00
|
|
|
assign(:projects, create_list(:project, 1))
|
2016-07-18 07:58:08 -04:00
|
|
|
assign(:users, create_list(:user, 1))
|
|
|
|
assign(:groups, create_list(:group, 1))
|
|
|
|
|
|
|
|
allow(view).to receive(:admin?).and_return(true)
|
2017-08-31 05:47:03 -04:00
|
|
|
allow(view).to receive(:current_application_settings).and_return(Gitlab::CurrentSettings.current_application_settings)
|
2016-07-18 07:58:08 -04:00
|
|
|
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-04-11 23:33:38 -04:00
|
|
|
|
|
|
|
it "includes revision of GitLab" do
|
|
|
|
render
|
|
|
|
|
2018-05-24 03:57:54 -04:00
|
|
|
expect(rendered).to have_content "#{Gitlab::VERSION} (#{Gitlab.revision})"
|
2018-04-11 23:33:38 -04:00
|
|
|
end
|
2016-07-18 07:58:08 -04:00
|
|
|
end
|