Commit 4c83c6ad authored by Mauricio Giacomini Girardello's avatar Mauricio Giacomini Girardello
Browse files

remove comments

parent 75fd8633
......@@ -8,6 +8,7 @@ require_relative "dspace/version"
require_relative "dspace/resources/community_resource"
require_relative "dspace/resources/collection_resource"
require_relative "dspace/resources/authentication_resource"
require_relative "dspace/resources/bitstream_resource"
require_relative "dspace/resources/status_resource"
require_relative "dspace/resources/item_resource"
require_relative "dspace/builders/hash_builder"
......
require 'spec_helper'
RSpec.describe Dspace::Resources::BitstreamResource, resource_kit: true do
subject(:resource) { Dspace::Resources::BitstreamResource }
it 'get all bitstreams' do
expect(resource).to have_action(:all).that_handles(200).at_path('/rest/bitstreams').with_verb(:get) do |handled|
expect(handled).to all(be_kind_of(Dspace::Bitstream))
end
end
it 'find bitstream by id' do
expect(resource).to have_action(:find).that_handles(200).at_path('/rest/bitstreams/:id').with_verb(:get) do |handled|
expect(handled).to be_kind_of(Dspace::Bitstream)
end
end
it 'Delete bitstream' do
expect(resource).to have_action(:delete).that_handles(200).at_path('/rest/bitstreams/:id').with_verb(:delete) do |handled|
expect(handled).to eq(true)
end
end
context 'Bitstream scope' do
it 'find bitstream policy' do
expect(resource).to have_action(:policy).that_handles(200).at_path('/rest/bitstreams/:id/policy').with_verb(:get) do |handled|
expect(handled).to be_kind_of(Dspace::Policy)
end
end
it 'delete bitstream policy' do
expect(resource).to have_action(:delete_policy).that_handles(200, 201, 204).at_path('/rest/bitstreams/:id/policy/:policy_id').with_verb(:delete) do |handled|
expect(handled).to eq(true)
end
end
end
end
\ No newline at end of file
......@@ -3,15 +3,6 @@ require 'spec_helper'
RSpec.describe Dspace::Resources::CollectionResource, resource_kit: true do
subject(:resource) { Dspace::Resources::CollectionResource }
# > GET /collections - Return all collections of DSpace in array.
# > GET /collections/{collectionId} - Return collection with id.
# > GET /collections/{collectionId}/items - Return all items of collection. Use the limit parameter to control items per response (default 100) and offset for paging.
# > POST /collections/{collectionId}/items - Create posted item in collection. You must post an Item
# > POST /collections/find-collection - Find collection by passed name.
# > PUT /collections/{collectionId} - Update collection. You must put Collection.
# > DELETE /collections/{collectionId} - Delete collection from DSpace.
# > DELETE /collections/{collectionId}/items/{itemId} - Delete item in collection.
it 'get all collection' do
expect(resource).to have_action(:all).that_handles(200).at_path('/rest/collections').with_verb(:get) do |handled|
expect(handled).to all(be_kind_of(Dspace::Collection))
......@@ -43,13 +34,13 @@ RSpec.describe Dspace::Resources::CollectionResource, resource_kit: true do
end
end
it 'Create an item' do
it 'create an item' do
expect(resource).to have_action(:create_item).that_handles(200).at_path('/rest/collections/:id/items').with_verb(:post) do |handled|
expect(handled).to eq(true)
end
end
it 'Delete item by id' do
it 'delete item by id' do
expect(resource).to have_action(:delete_item).that_handles(200).at_path('/rest/collections/:id/items/:item_id').with_verb(:delete) do |handled|
expect(handled).to eq(true)
end
......
......@@ -3,18 +3,6 @@ require 'spec_helper'
RSpec.describe Dspace::Resources::ItemResource, resource_kit: true do
subject(:resource) { Dspace::Resources::ItemResource }
# > GET /items - Return list of items.
# > GET /items/{item id} - Return item.
# > GET /items/{item id}/metadata - Return item metadata.
# > GET /items/{item id}/bitstreams - Return item bitstreams. Use the limit parameter to control items per response (default 100) and offset for paging.
# POST /items/find-by-metadata-field - Find items by metadata entry. You must post a MetadataEntry. DS-2501 - wrong SQL in REST /items/find-by-metadata-field CLOSED
# > POST /items/{item id}/metadata - Add metadata to item. You must post an array of MetadataEntry
# > POST /items/{item id}/bitstreams - Add bitstream to item. You must post a Bitstream
# PUT /items/{item id}/metadata - Update metadata in item. You must put a MetadataEntry
# > DELETE /items/{item id} - Delete item.
# > DELETE /items/{item id}/metadata - Clear item metadata.
# > DELETE /items/{item id}/bitstreams/{bitstream id} - Delete item bitstream.
it 'get all items' do
expect(resource).to have_action(:all).that_handles(200).at_path('/rest/items').with_verb(:get) do |handled|
expect(handled).to all(be_kind_of(Dspace::Item))
......@@ -71,5 +59,11 @@ RSpec.describe Dspace::Resources::ItemResource, resource_kit: true do
end
end
it 'update metadata' do
expect(resource).to have_action(:update_metadata).that_handles(200, 201).at_path('/rest/items/:id/metadata').with_verb(:put) do |handled|
expect(handled).to eq(true)
end
end
end
end
\ No newline at end of file
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