summaryrefslogtreecommitdiff
path: root/spec/requests/api/package_files_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/requests/api/package_files_spec.rb')
-rw-r--r--spec/requests/api/package_files_spec.rb18
1 files changed, 9 insertions, 9 deletions
diff --git a/spec/requests/api/package_files_spec.rb b/spec/requests/api/package_files_spec.rb
index 7a6b1599154..a7e6a97fd0e 100644
--- a/spec/requests/api/package_files_spec.rb
+++ b/spec/requests/api/package_files_spec.rb
@@ -114,14 +114,14 @@ RSpec.describe API::PackageFiles do
let(:user) { nil }
it 'returns 403 for non authenticated user', :aggregate_failures do
- expect { api_request }.not_to change { package.package_files.count }
+ expect { api_request }.not_to change { package.package_files.pending_destruction.count }
expect(response).to have_gitlab_http_status(:forbidden)
end
end
it 'returns 403 for a user without access to the project', :aggregate_failures do
- expect { api_request }.not_to change { package.package_files.count }
+ expect { api_request }.not_to change { package.package_files.pending_destruction.count }
expect(response).to have_gitlab_http_status(:forbidden)
end
@@ -131,7 +131,7 @@ RSpec.describe API::PackageFiles do
let_it_be_with_refind(:project) { create(:project, :private) }
it 'returns 404 for a user without access to the project', :aggregate_failures do
- expect { api_request }.not_to change { package.package_files.count }
+ expect { api_request }.not_to change { package.package_files.pending_destruction.count }
expect(response).to have_gitlab_http_status(:not_found)
end
@@ -139,7 +139,7 @@ RSpec.describe API::PackageFiles do
it 'returns 403 for a user without enough permissions', :aggregate_failures do
project.add_developer(user)
- expect { api_request }.not_to change { package.package_files.count }
+ expect { api_request }.not_to change { package.package_files.pending_destruction.count }
expect(response).to have_gitlab_http_status(:forbidden)
end
@@ -147,7 +147,7 @@ RSpec.describe API::PackageFiles do
it 'returns 204', :aggregate_failures do
project.add_maintainer(user)
- expect { api_request }.to change { package.package_files.count }.by(-1)
+ expect { api_request }.to change { package.package_files.pending_destruction.count }.by(1)
expect(response).to have_gitlab_http_status(:no_content)
end
@@ -156,7 +156,7 @@ RSpec.describe API::PackageFiles do
let(:user) { nil }
it 'returns 404 for non authenticated user', :aggregate_failures do
- expect { api_request }.not_to change { package.package_files.count }
+ expect { api_request }.not_to change { package.package_files.pending_destruction.count }
expect(response).to have_gitlab_http_status(:not_found)
end
@@ -168,7 +168,7 @@ RSpec.describe API::PackageFiles do
it 'returns 404 when the package file does not exist', :aggregate_failures do
project.add_maintainer(user)
- expect { api_request }.not_to change { package.package_files.count }
+ expect { api_request }.not_to change { package.package_files.pending_destruction.count }
expect(response).to have_gitlab_http_status(:not_found)
end
@@ -182,7 +182,7 @@ RSpec.describe API::PackageFiles do
end
it 'can not be accessed', :aggregate_failures do
- expect { api_request }.not_to change { package.package_files.count }
+ expect { api_request }.not_to change { package.package_files.pending_destruction.count }
expect(response).to have_gitlab_http_status(:not_found)
end
@@ -193,7 +193,7 @@ RSpec.describe API::PackageFiles do
end
it 'can be accessed', :aggregate_failures do
- expect { api_request }.to change { package.package_files.count }.by(-1)
+ expect { api_request }.not_to change { package.package_files.pending_destruction.count }
expect(response).to have_gitlab_http_status(:no_content)
end