diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-03-08 21:09:12 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-03-08 21:09:12 +0300 |
commit | 0179dc40d71c2549d787d2f5fa7ba6dc6efae376 (patch) | |
tree | 9709db4077ec0f3f471e9b8094b0de67a3ab947c /spec/factories/go_module_commits.rb | |
parent | 770d6dbfa7111324f994f12664a2036c7121602a (diff) |
Add latest changes from gitlab-org/gitlab@master
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 { |