diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-03-12 19:26:10 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-03-12 19:26:10 +0300 |
commit | 6653ccc011dec86e5140a5d09ea3b2357eab6714 (patch) | |
tree | 897193f37bcd98152a0ac214f80a3c4cfe1047c5 /spec/factories/go_module_commits.rb | |
parent | bff35a05aed6a31380a73c39113808fd262c2c37 (diff) |
Add latest changes from gitlab-org/gitlab@13-10-stable-eev13.10.0-rc41
Diffstat (limited to 'spec/factories/go_module_commits.rb')
-rw-r--r-- | spec/factories/go_module_commits.rb | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/spec/factories/go_module_commits.rb b/spec/factories/go_module_commits.rb index e42ef6696d1..514a5559344 100644 --- a/spec/factories/go_module_commits.rb +++ b/spec/factories/go_module_commits.rb @@ -7,7 +7,12 @@ FactoryBot.define do transient do files { { 'foo.txt' => 'content' } } message { 'Message' } + # rubocop: disable FactoryBot/InlineAssociation + # We need a persisted project so we can create commits and tags + # in `commit` otherwise linting this factory with `build` strategy + # will fail. project { create(:project, :repository) } + # rubocop: enable FactoryBot/InlineAssociation service do Files::MultiService.new( @@ -44,14 +49,13 @@ FactoryBot.define do trait :files do transient do - files { raise ArgumentError.new("files is required") } message { 'Add files' } end end trait :package do transient do - path { raise ArgumentError.new("path is required") } + path { 'pkg' } message { 'Add package' } files { { "#{path}/b.go" => "package b\nfunc Bye() { println(\"Goodbye world!\") }\n" } } end @@ -64,7 +68,7 @@ FactoryBot.define do host_prefix { "#{::Gitlab.config.gitlab.host}/#{project.path_with_namespace}" } url { name ? "#{host_prefix}/#{name}" : host_prefix } - path { name.to_s + '/' } + path { "#{name}/" } files do { |