debian-mirror-gitlab/spec/factories/commits.rb

23 lines
455 B
Ruby
Raw Normal View History

2016-06-02 11:05:42 +05:30
require_relative '../support/repo_helpers'
FactoryGirl.define do
factory :commit do
git_commit RepoHelpers.sample_commit
2017-09-10 17:25:29 +05:30
project
2016-06-02 11:05:42 +05:30
initialize_with do
new(git_commit, project)
end
2017-08-17 22:00:37 +05:30
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
2016-06-02 11:05:42 +05:30
end
end