diff options
Diffstat (limited to 'spec/controllers/projects/service_ping_controller_spec.rb')
-rw-r--r-- | spec/controllers/projects/service_ping_controller_spec.rb | 77 |
1 files changed, 0 insertions, 77 deletions
diff --git a/spec/controllers/projects/service_ping_controller_spec.rb b/spec/controllers/projects/service_ping_controller_spec.rb index 10d4b897564..601dfd9b011 100644 --- a/spec/controllers/projects/service_ping_controller_spec.rb +++ b/spec/controllers/projects/service_ping_controller_spec.rb @@ -42,83 +42,6 @@ RSpec.describe Projects::ServicePingController do end end - describe 'POST #web_ide_clientside_preview' do - subject { post :web_ide_clientside_preview, params: { namespace_id: project.namespace, project_id: project } } - - context 'when web ide clientside preview is enabled' do - before do - stub_application_setting(web_ide_clientside_preview_enabled: true) - end - - it_behaves_like 'counter is not increased' - it_behaves_like 'counter is increased', 'WEB_IDE_PREVIEWS_COUNT' - end - - context 'when web ide clientside preview is not enabled' do - let(:user) { project.first_owner } - - before do - stub_application_setting(web_ide_clientside_preview_enabled: false) - end - - it 'returns 404' do - subject - - expect(response).to have_gitlab_http_status(:not_found) - end - end - end - - describe 'POST #web_ide_clientside_preview_success' do - subject { post :web_ide_clientside_preview_success, params: { namespace_id: project.namespace, project_id: project } } - - context 'when web ide clientside preview is enabled' do - before do - stub_application_setting(web_ide_clientside_preview_enabled: true) - end - - it_behaves_like 'counter is not increased' - it_behaves_like 'counter is increased', 'WEB_IDE_PREVIEWS_SUCCESS_COUNT' - - context 'when the user has access to the project', :snowplow do - let(:user) { project.owner } - - it 'increases the live preview view counter' do - expect(Gitlab::UsageDataCounters::EditorUniqueCounter).to receive(:track_live_preview_edit_action).with(author: user, project: project) - - subject - - expect(response).to have_gitlab_http_status(:ok) - end - - it_behaves_like 'Snowplow event tracking with RedisHLL context' do - let(:project) { create(:project) } - let(:namespace) { project.namespace } - let(:category) { 'Gitlab::UsageDataCounters::EditorUniqueCounter' } - let(:action) { 'ide_edit' } - let(:property) { 'g_edit_by_live_preview' } - let(:label) { 'usage_activity_by_stage_monthly.create.action_monthly_active_users_ide_edit' } - let(:context) { [Gitlab::Tracking::ServicePingContext.new(data_source: :redis_hll, event: event_name).to_context] } - let(:feature_flag_name) { :route_hll_to_snowplow_phase2 } - end - end - end - - context 'when web ide clientside preview is not enabled' do - let(:user) { project.owner } - - before do - stub_application_setting(web_ide_clientside_preview_enabled: false) - end - - it 'returns 404' do - subject - - expect(response).to have_gitlab_http_status(:not_found) - end - end - end - describe 'POST #web_ide_pipelines_count' do subject { post :web_ide_pipelines_count, params: { namespace_id: project.namespace, project_id: project } } |