diff --git a/modules/storages/lib/api/v3/file_links/file_link_relation_representer.rb b/modules/storages/lib/api/v3/file_links/file_link_relation_representer.rb index f373be81cdda..58b725ad70eb 100644 --- a/modules/storages/lib/api/v3/file_links/file_link_relation_representer.rb +++ b/modules/storages/lib/api/v3/file_links/file_link_relation_representer.rb @@ -45,18 +45,6 @@ module FileLinkRelationRepresenter method: :post } end - - property :file_links, - embedded: true, - exec_context: :decorator, - if: ->(*) { embed_links && current_user.allowed_in_project?(:view_file_links, represented.project) }, - uncacheable: true - - def file_links - ::API::V3::FileLinks::FileLinkCollectionRepresenter.new(represented.file_links, - self_link: api_v3_paths.file_links(represented.id), - current_user:) - end end end end diff --git a/spec/requests/api/v3/work_packages/create_resource_spec.rb b/spec/requests/api/v3/work_packages/create_resource_spec.rb index cc6ff6015d5a..de07c44385a5 100644 --- a/spec/requests/api/v3/work_packages/create_resource_spec.rb +++ b/spec/requests/api/v3/work_packages/create_resource_spec.rb @@ -113,7 +113,7 @@ end it "creates a work package" do - expect(WorkPackage.all.count).to eq(1) + expect(WorkPackage.count).to eq(1) end it "uses the given parameters" do @@ -152,7 +152,7 @@ it_behaves_like "multiple errors", 422 it "does not create a work package" do - expect(WorkPackage.all.count).to eq(0) + expect(WorkPackage.count).to eq(0) end end @@ -176,7 +176,7 @@ end it "does not create a work package" do - expect(WorkPackage.all.count).to eq(0) + expect(WorkPackage.count).to eq(0) end end @@ -227,7 +227,7 @@ end it "does not create a work package" do - expect(WorkPackage.all.count).to eq(0) + expect(WorkPackage.count).to eq(0) end end @@ -310,7 +310,7 @@ expect(last_response.body).to be_json_eql( api_v3_paths.file_links(work_package.id).to_json ).at_path("_links/fileLinks/href") - expect(last_response.body).to be_json_eql("1").at_path("_embedded/fileLinks/total") + expect(last_response.body).to have_json_path("_links/addFileLink") end end end