fixing add bitstream for an item spec

parent f80b76f6
# Contributor Code of Conduct
As contributors and maintainers of this project, we pledge to respect all people who contribute through reporting issues, posting feature requests, updating documentation, submitting pull requests or patches, and other activities.
We are committed to making participation in this project a harassment-free experience for everyone, regardless of level of experience, gender, gender identity and expression, sexual orientation, disability, personal appearance, body size, race, ethnicity, age, or religion.
Examples of unacceptable behavior by participants include the use of sexual language or imagery, derogatory comments or personal attacks, trolling, public or private harassment, insults, or other unprofessional conduct.
Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct. Project maintainers who do not follow the Code of Conduct may be removed from the project team.
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by opening an issue or contacting one or more of the project maintainers.
This Code of Conduct is adapted from the [Contributor Covenant](http://contributor-covenant.org), version 1.0.0, available at [http://contributor-covenant.org/version/1/0/0/](http://contributor-covenant.org/version/1/0/0/)
# Mark
Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/mark`. To experiment with that code, run `bin/console` for an interactive prompt.
TODO: Delete this and the text above, and describe your gem
# DSpace REST Client
## Installation
Add this line to your application's Gemfile:
```ruby
gem 'mark'
gem 'dspace_rest_client'
```
And then execute:
......@@ -18,19 +14,32 @@ And then execute:
Or install it yourself as:
$ gem install mark
$ gem install dspace_rest_client
## Usage
## Get started
TODO: Write usage instructions here
Some requests requires user authentication.
## Development
```ruby
require 'dspace'
client = Dspace::Client.new(dspace_api: 'https://demo.dspace.org/')
if !client.is_running?
raise 'Can\'t connect to DSpace API.'
end
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
# authenticate
client.login 'dspacedemo+admin@gmail.com', 'dspace'
# create an community
client.communities.create(Dspace::Community.new({'name' => 'Testando'}))
```
## Development
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rspec spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
## Contributing
Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/mark. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](contributor-covenant.org) code of conduct.
Bug reports and pull requests are welcome. This project is intended to be a safe, welcoming space for collaboration.
......@@ -36,8 +36,8 @@ RSpec.describe Dspace::Resources::ItemResource, resource_kit: true do
end
it 'add item bitstreams' do
expect(resource).to have_action(:add_bitstream).that_handles(200, 201).at_path('/rest/items/:id/bitstreams').with_verb(:post) do |handled|
expect(handled).to eq(true)
expect(resource).to have_action(:add_bitstream).that_handles(200).at_path('/rest/items/:id/bitstreams').with_verb(:post) do |handled|
expect(handled).to be_kind_of(Dspace::Bitstream)
end
end
......@@ -66,4 +66,4 @@ RSpec.describe Dspace::Resources::ItemResource, resource_kit: true do
end
end
end
\ No newline at end of file
end
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