diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-07-20 09:55:51 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-07-20 09:55:51 +0000 |
commit | e8d2c2579383897a1dd7f9debd359abe8ae8373d (patch) | |
tree | c42be41678c2586d49a75cabce89322082698334 /spec/helpers/analytics | |
parent | fc845b37ec3a90aaa719975f607740c22ba6a113 (diff) | |
download | gitlab-ce-e8d2c2579383897a1dd7f9debd359abe8ae8373d.tar.gz |
Add latest changes from gitlab-org/gitlab@14-1-stable-eev14.1.0-rc42
Diffstat (limited to 'spec/helpers/analytics')
-rw-r--r-- | spec/helpers/analytics/unique_visits_helper_spec.rb | 34 |
1 files changed, 0 insertions, 34 deletions
diff --git a/spec/helpers/analytics/unique_visits_helper_spec.rb b/spec/helpers/analytics/unique_visits_helper_spec.rb deleted file mode 100644 index b4b370c169d..00000000000 --- a/spec/helpers/analytics/unique_visits_helper_spec.rb +++ /dev/null @@ -1,34 +0,0 @@ -# frozen_string_literal: true - -require "spec_helper" - -RSpec.describe Analytics::UniqueVisitsHelper do - include Devise::Test::ControllerHelpers - - describe '#track_visit' do - let(:target_id) { 'p_analytics_valuestream' } - let(:current_user) { create(:user) } - - it 'does not track visit if user is not logged in' do - expect_any_instance_of(Gitlab::Analytics::UniqueVisits).not_to receive(:track_visit) - - helper.track_visit(target_id) - end - - it 'tracks visit if user is logged in' do - sign_in(current_user) - - expect_any_instance_of(Gitlab::Analytics::UniqueVisits).to receive(:track_visit) - - helper.track_visit(target_id) - end - - it 'tracks visit if user is not logged in, but has the cookie already' do - helper.request.cookies[:visitor_id] = { value: SecureRandom.uuid, expires: 24.months } - - expect_any_instance_of(Gitlab::Analytics::UniqueVisits).to receive(:track_visit) - - helper.track_visit(target_id) - end - end -end |