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

72 lines
1.8 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(:all) do
clean_frontend_fixtures('projects/analytics/value_stream_analytics/')
end
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
it 'projects/analytics/value_stream_analytics/stages' do
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|
it "projects/analytics/value_stream_analytics/events/#{stage[:name]}" do
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
it "projects/analytics/value_stream_analytics/summary" do
get(:show, params: params, format: :json)
expect(response).to be_successful
end
end
end