Sha256: 58fc69b90d9468b509731ed3fd4bd4b146fce8e106ec0c8ada4794ca0519e1e7

Contents?: true

Size: 1.15 KB

Versions: 10

Compression:

Stored size: 1.15 KB

Contents

# encoding: utf-8

require 'spec_helper'

describe Hyperdrive::Server do
  def app
    Hyperdrive::Server
  end

  before do
    sample_api
  end

  after do
    hyperdrive.send(:reset!)
  end

  it "responds to GET requests successfully" do
    get '/things', { parent_id: 42 }
    last_response.successful?.must_equal true
  end

  it "responds to HEAD requests successfully" do
    head '/things', { parent_id: 42 }
    last_response.successful?.must_equal true
  end

  it "responds to OPTIONS requests successfully" do
    options '/things'
    last_response.successful?.must_equal true
  end

  it "responds to POST requests successfully" do
    post '/things', { name: 'bender' }
    last_response.successful?.must_equal true
  end

  it "responds to PUT requests successfully" do
    put '/things', { id: 1, name: 'bender' }
    last_response.successful?.must_equal true
  end

  it "responds to PATCH requests successfully" do
    patch '/things', { id: 1, name: 'bender' }
    last_response.successful?.must_equal true
  end

  it "responds to DELETE requests successfully" do
    delete '/things', { id: 1 }
    last_response.successful?.must_equal true
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
hyperdrive-0.0.15 spec/hyperdrive/server_spec.rb
hyperdrive-0.0.14 spec/hyperdrive/server_spec.rb
hyperdrive-0.0.13 spec/hyperdrive/server_spec.rb
hyperdrive-0.0.12 spec/hyperdrive/server_spec.rb
hyperdrive-0.0.11 spec/hyperdrive/server_spec.rb
hyperdrive-0.0.10 spec/hyperdrive/server_spec.rb
hyperdrive-0.0.9 spec/hyperdrive/server_spec.rb
hyperdrive-0.0.8 spec/hyperdrive/server_spec.rb
hyperdrive-0.0.7 spec/hyperdrive/server_spec.rb
hyperdrive-0.0.6 spec/hyperdrive/server_spec.rb