diff options
author | Lin Jen-Shin <godfat@godfat.org> | 2017-07-17 22:26:41 +0300 |
---|---|---|
committer | Lin Jen-Shin <godfat@godfat.org> | 2017-07-17 22:26:41 +0300 |
commit | 042cf15b6f6dae6a6e3f760f93a3ad0f7ff486ea (patch) | |
tree | 05a60edfa9a708f83c1e4eb640961c404c065ad2 /spec/factories | |
parent | 4d03873cd105507195c58c94a02a18e0f086173a (diff) |
Cache Note#notable for commits and fix tests
Diffstat (limited to 'spec/factories')
-rw-r--r-- | spec/factories/commits.rb | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/spec/factories/commits.rb b/spec/factories/commits.rb index 36b9645438a..89e260cf65b 100644 --- a/spec/factories/commits.rb +++ b/spec/factories/commits.rb @@ -4,14 +4,19 @@ FactoryGirl.define do factory :commit do git_commit RepoHelpers.sample_commit project factory: :empty_project - author { build(:author) } 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 |