debian-mirror-gitlab/spec/controllers/projects/cycle_analytics_controller_spec.rb

37 lines
919 B
Ruby
Raw Normal View History

2019-07-31 22:56:46 +05:30
# frozen_string_literal: true
2017-08-17 22:00:37 +05:30
require 'spec_helper'
2020-06-23 00:09:42 +05:30
RSpec.describe Projects::CycleAnalyticsController do
2017-08-17 22:00:37 +05:30
let(:project) { create(:project, :repository) }
let(:user) { create(:user) }
before do
sign_in(user)
2018-11-18 11:00:15 +05:30
project.add_maintainer(user)
2017-08-17 22:00:37 +05:30
end
2019-10-12 21:52:04 +05:30
context "counting page views for 'show'" do
it 'increases the counter' do
expect(Gitlab::UsageDataCounters::CycleAnalyticsCounter).to receive(:count).with(:views)
get(:show,
params: {
namespace_id: project.namespace,
project_id: project
})
2019-12-04 20:38:33 +05:30
expect(response).to be_successful
2019-10-12 21:52:04 +05:30
end
end
2020-07-28 23:09:34 +05:30
context 'tracking visits to html page' do
it_behaves_like 'tracking unique visits', :show do
let(:request_params) { { namespace_id: project.namespace, project_id: project } }
let(:target_id) { 'p_analytics_valuestream' }
end
end
2020-10-24 23:57:45 +05:30
include_examples GracefulTimeoutHandling
2017-08-17 22:00:37 +05:30
end