gitlab-org--gitlab-foss/spec/factories/commits.rb
2017-08-02 17:47:31 -04:00

22 lines
455 B
Ruby

require_relative '../support/repo_helpers'
FactoryGirl.define do
factory :commit do
git_commit RepoHelpers.sample_commit
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
after(:build) do |commit|
allow(commit).to receive(:author).and_return nil
end
end
end
end