combination_steps.rb revision e568cc4d63d7d940acafc114bc74287b9cc0e480
97758b9192048e1cfcd47106cfba6852b1486eddTim Reddehase @api_key = FactoryGirl.create :api_key, :invalid
5836ee88700245635cd096f27bdc6279178f4583Tim ReddehaseGiven(/^I have a repository with path: "([^"]+)"$/) do |path|
5836ee88700245635cd096f27bdc6279178f4583Tim Reddehase FactoryGirl.create :permission, subject: @user
5836ee88700245635cd096f27bdc6279178f4583Tim ReddehaseGiven(/^I know of a repository with path: "([^"]+)"$/) do |path|
5836ee88700245635cd096f27bdc6279178f4583Tim Reddehase @repository = FactoryGirl.create :repository, path: path
5836ee88700245635cd096f27bdc6279178f4583Tim ReddehaseWhen(/^I create a combination via the API of these ontologies$/) do
5836ee88700245635cd096f27bdc6279178f4583Tim Reddehase header Api::V1::Base::API_KEY_HEADER, @api_key.try(:key)
5836ee88700245635cd096f27bdc6279178f4583Tim Reddehase request "/#{@repository.path}///combinations",\
34bd7b34347e21e8c06cf28bafea5f390830d4caTim ReddehaseWhen(/^I create a combination via the API with these:$/) do |table|
34bd7b34347e21e8c06cf28bafea5f390830d4caTim Reddehase header Api::V1::Base::API_KEY_HEADER, @api_key.try(:key)
34bd7b34347e21e8c06cf28bafea5f390830d4caTim Reddehase request "/#{@repository.path}///combinations",\
5836ee88700245635cd096f27bdc6279178f4583Tim ReddehaseThen(/^I should get a (\d+) response$/) do |number|
5836ee88700245635cd096f27bdc6279178f4583Tim Reddehase expect(last_response.status).to eq(number.to_i)
5836ee88700245635cd096f27bdc6279178f4583Tim ReddehaseThen(/^a location\-header to the combination\-ontology$/) do
5836ee88700245635cd096f27bdc6279178f4583Tim Reddehase expect(last_response.headers["Location"]).to eq(Ontology.last.locid)
34bd7b34347e21e8c06cf28bafea5f390830d4caTim ReddehaseThen(/^the body should be valid for a (\d+) combination-response/) do |status|
34bd7b34347e21e8c06cf28bafea5f390830d4caTim Reddehase VCR.use_cassette "api/json-schemata/repository/combinations/#{status}" do