debian-mirror-gitlab/spec/frontend/fixtures/analytics.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

68 lines
1.7 KiB
Ruby
Raw Normal View History

2021-10-27 15:23:28 +05:30
# frozen_string_literal: true
require 'spec_helper'
RSpec.describe 'Analytics (JavaScript fixtures)', :sidekiq_inline do
include_context 'Analytics fixtures shared context'
let_it_be(:value_stream_id) { 'default' }
before do
update_metrics
create_deployment
end
describe Projects::Analytics::CycleAnalytics::StagesController, type: :controller do
render_views
let(:params) { { namespace_id: group, project_id: project, value_stream_id: value_stream_id } }
before do
project.add_developer(user)
sign_in(user)
end
2021-11-18 22:05:49 +05:30
it 'projects/analytics/value_stream_analytics/stages.json' do
2021-10-27 15:23:28 +05:30
get(:index, params: params, format: :json)
expect(response).to be_successful
end
end
describe Projects::CycleAnalytics::EventsController, type: :controller do
render_views
let(:params) { { namespace_id: group, project_id: project, value_stream_id: value_stream_id } }
before do
project.add_developer(user)
sign_in(user)
end
Gitlab::Analytics::CycleAnalytics::DefaultStages.all.each do |stage|
2021-11-18 22:05:49 +05:30
it "projects/analytics/value_stream_analytics/events/#{stage[:name]}.json" do
2021-10-27 15:23:28 +05:30
get(stage[:name], params: params, format: :json)
expect(response).to be_successful
end
end
end
describe Projects::Analytics::CycleAnalytics::SummaryController, type: :controller do
render_views
let(:params) { { namespace_id: group, project_id: project, value_stream_id: value_stream_id } }
before do
project.add_developer(user)
sign_in(user)
end
2021-11-18 22:05:49 +05:30
it "projects/analytics/value_stream_analytics/summary.json" do
2021-10-27 15:23:28 +05:30
get(:show, params: params, format: :json)
expect(response).to be_successful
end
end
end