Commit 7d3e3cd9 authored by Stan Hu's avatar Stan Hu

Merge branch 'fix-user-interacted-project-spec-to-support-parent-startegy' into 'master'

Refactor User Interacted Project test to support factories parent strategy

See merge request gitlab-org/gitlab!41698
parents 3a1b7980 548ba319
......@@ -3,14 +3,17 @@
require 'spec_helper'
RSpec.describe UserInteractedProject do
let_it_be(:project) { create(:project) }
let_it_be(:author) { project.creator }
describe '.track' do
subject { described_class.track(event) }
let(:event) { build(:event) }
let(:event) { build(:event, project: project, author: author) }
Event.actions.each_key do |action|
context "for all actions (event types)" do
let(:event) { build(:event, action: action) }
let(:event) { build(:event, project: project, author: author, action: action) }
it 'creates a record' do
expect { subject }.to change { described_class.count }.from(0).to(1)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment