2016-04-13 05:25:42 -04:00
|
|
|
require_relative '../support/repo_helpers'
|
|
|
|
|
|
|
|
FactoryGirl.define do
|
|
|
|
factory :commit do
|
|
|
|
git_commit RepoHelpers.sample_commit
|
2017-08-02 15:55:11 -04:00
|
|
|
project
|
2016-04-13 05:25:42 -04:00
|
|
|
|
|
|
|
initialize_with do
|
|
|
|
new(git_commit, project)
|
|
|
|
end
|
2017-01-18 05:38:59 -05:00
|
|
|
|
2017-07-17 15:26:41 -04:00
|
|
|
after(:build) do |commit|
|
|
|
|
allow(commit).to receive(:author).and_return build(:author)
|
|
|
|
end
|
|
|
|
|
2017-01-18 05:38:59 -05:00
|
|
|
trait :without_author do
|
2017-07-17 15:26:41 -04:00
|
|
|
after(:build) do |commit|
|
|
|
|
allow(commit).to receive(:author).and_return nil
|
|
|
|
end
|
2017-01-18 05:38:59 -05:00
|
|
|
end
|
2016-04-13 05:25:42 -04:00
|
|
|
end
|
|
|
|
end
|