Commit 3fbcba73 authored by Lin Jen-Shin's avatar Lin Jen-Shin

Make sure we're looking at the right package_file

If we create a new package, the factory will also create a corresponding
package file, which will share the same name as the package file we're
creating explicitly, and it only has file_sha1 defined therefore if
PostgreSQL happens to load the package file sharing the same name from
the package, then it will fail.

This make sure we don't create a new package thus avoid having an extra
package file which will conflict with the package file we're testing
here.
parent f376fed8
...@@ -4,10 +4,10 @@ require 'spec_helper' ...@@ -4,10 +4,10 @@ require 'spec_helper'
RSpec.describe Packages::Rubygems::CreateGemspecService do RSpec.describe Packages::Rubygems::CreateGemspecService do
include RubygemsHelpers include RubygemsHelpers
let_it_be(:package) { create(:rubygems_package) }
let_it_be(:package_file) { create(:package_file, :gem) } let_it_be(:package_file) { create(:package_file, :gem) }
let_it_be(:gem) { gem_from_file(package_file.file) } let_it_be(:gem) { gem_from_file(package_file.file) }
let_it_be(:gemspec) { gem.spec } let_it_be(:gemspec) { gem.spec }
let_it_be(:package) { package_file.package }
let(:service) { described_class.new(package, gemspec) } let(:service) { described_class.new(package, gemspec) }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment