summaryrefslogtreecommitdiff
path: root/spec/factories/commits.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/factories/commits.rb')
-rw-r--r--spec/factories/commits.rb11
1 files changed, 8 insertions, 3 deletions
diff --git a/spec/factories/commits.rb b/spec/factories/commits.rb
index 36b9645438a..f4f12a095fc 100644
--- a/spec/factories/commits.rb
+++ b/spec/factories/commits.rb
@@ -3,15 +3,20 @@ require_relative '../support/repo_helpers'
FactoryGirl.define do
factory :commit do
git_commit RepoHelpers.sample_commit
- project factory: :empty_project
- author { build(:author) }
+ project
initialize_with do
new(git_commit, project)
end
+ after(:build) do |commit|
+ allow(commit).to receive(:author).and_return build(:author)
+ end
+
trait :without_author do
- author nil
+ after(:build) do |commit|
+ allow(commit).to receive(:author).and_return nil
+ end
end
end
end