summaryrefslogtreecommitdiff
path: root/spec/models/packages/package_file_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/models/packages/package_file_spec.rb')
-rw-r--r--spec/models/packages/package_file_spec.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/spec/models/packages/package_file_spec.rb b/spec/models/packages/package_file_spec.rb
index 7f2f22c815c..ee0aeb26d50 100644
--- a/spec/models/packages/package_file_spec.rb
+++ b/spec/models/packages/package_file_spec.rb
@@ -5,6 +5,7 @@ RSpec.describe Packages::PackageFile, type: :model do
let_it_be(:project) { create(:project) }
let_it_be(:package_file1) { create(:package_file, :xml, file_name: 'FooBar') }
let_it_be(:package_file2) { create(:package_file, :xml, file_name: 'ThisIsATest') }
+ let_it_be(:package_file3) { create(:package_file, :xml, file_name: 'formatted.zip') }
let_it_be(:debian_package) { create(:debian_package, project: project) }
describe 'relationships' do
@@ -36,6 +37,12 @@ RSpec.describe Packages::PackageFile, type: :model do
it { is_expected.to match_array([package_file1]) }
end
+
+ describe '.with_format' do
+ subject { described_class.with_format('zip') }
+
+ it { is_expected.to contain_exactly(package_file3) }
+ end
end
context 'updating project statistics' do