diff options
Diffstat (limited to 'spec/workers/users')
-rw-r--r-- | spec/workers/users/migrate_records_to_ghost_user_in_batches_worker_spec.rb | 4 | ||||
-rw-r--r-- | spec/workers/users/track_namespace_visits_worker_spec.rb | 27 |
2 files changed, 29 insertions, 2 deletions
diff --git a/spec/workers/users/migrate_records_to_ghost_user_in_batches_worker_spec.rb b/spec/workers/users/migrate_records_to_ghost_user_in_batches_worker_spec.rb index 38ea7c43267..fbbfd44bba6 100644 --- a/spec/workers/users/migrate_records_to_ghost_user_in_batches_worker_spec.rb +++ b/spec/workers/users/migrate_records_to_ghost_user_in_batches_worker_spec.rb @@ -34,8 +34,8 @@ RSpec.describe Users::MigrateRecordsToGhostUserInBatchesWorker, feature_category it 'migrates issue to ghost user' do subject - expect(issue.reload.author).to eq(User.ghost) - expect(issue.last_edited_by).to eq(User.ghost) + expect(issue.reload.author).to eq(Users::Internal.ghost) + expect(issue.last_edited_by).to eq(Users::Internal.ghost) end end end diff --git a/spec/workers/users/track_namespace_visits_worker_spec.rb b/spec/workers/users/track_namespace_visits_worker_spec.rb new file mode 100644 index 00000000000..cfb2b7ab5eb --- /dev/null +++ b/spec/workers/users/track_namespace_visits_worker_spec.rb @@ -0,0 +1,27 @@ +# frozen_string_literal: true + +require 'spec_helper' + +RSpec.describe Users::TrackNamespaceVisitsWorker, feature_category: :navigation do + describe '#perform' do + let_it_be(:user) { create(:user) } + + context 'when tracking a group' do + let_it_be(:entity) { create(:group) } + let_it_be(:entity_type) { 'groups' } + let_it_be(:worker) { described_class.new } + let_it_be(:model) { ::Users::GroupVisit } + + it_behaves_like 'namespace visits tracking worker' + end + + context 'when tracking a project' do + let_it_be(:entity) { create(:project) } + let_it_be(:entity_type) { 'projects' } + let_it_be(:worker) { described_class.new } + let_it_be(:model) { ::Users::ProjectVisit } + + it_behaves_like 'namespace visits tracking worker' + end + end +end |