Commit 548ba319 authored by Heinrich Lee Yu's avatar Heinrich Lee Yu Committed by Eugenia Grieff

Fix user interacted project spec

Create associations explicitly and pass them on when building the model
parent 500437d7
......@@ -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