debian-mirror-gitlab/spec/features/projects/environments/environment_metrics_spec.rb

38 lines
997 B
Ruby
Raw Normal View History

2017-08-17 22:00:37 +05:30
require 'spec_helper'
2018-11-08 19:23:39 +05:30
describe 'Environment > Metrics' do
2017-08-17 22:00:37 +05:30
include PrometheusHelpers
2018-11-08 19:23:39 +05:30
let(:user) { create(:user) }
let(:project) { create(:prometheus_project) }
let(:pipeline) { create(:ci_pipeline, project: project) }
let(:build) { create(:ci_build, pipeline: pipeline) }
let(:environment) { create(:environment, project: project) }
let(:current_time) { Time.now.utc }
2017-08-17 22:00:37 +05:30
2018-11-08 19:23:39 +05:30
before do
2017-08-17 22:00:37 +05:30
project.add_developer(user)
create(:deployment, environment: environment, deployable: build)
stub_all_prometheus_requests(environment.slug)
2017-09-10 17:25:29 +05:30
sign_in(user)
2017-08-17 22:00:37 +05:30
visit_environment(environment)
end
around do |example|
Timecop.freeze(current_time) { example.run }
end
context 'with deployments and related deployable present' do
2018-11-08 19:23:39 +05:30
it 'shows metrics' do
2017-08-17 22:00:37 +05:30
click_link('See metrics')
2017-09-10 17:25:29 +05:30
expect(page).to have_css('div#prometheus-graphs')
2017-08-17 22:00:37 +05:30
end
end
def visit_environment(environment)
2017-09-10 17:25:29 +05:30
visit project_environment_path(environment.project, environment)
2017-08-17 22:00:37 +05:30
end
end