Sha256: 2871e96e1df6bdf141fbf9acc6e45f4da51f7a45300240a8a5950fe20a9b28da

Contents?: true

Size: 1.32 KB

Versions: 10

Compression:

Stored size: 1.32 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 }, default_hyperdrive_env
    last_response.successful?.must_equal true
  end

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

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

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

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

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

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

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
hyperdrive-0.0.25 spec/hyperdrive/server_spec.rb
hyperdrive-0.0.24 spec/hyperdrive/server_spec.rb
hyperdrive-0.0.23 spec/hyperdrive/server_spec.rb
hyperdrive-0.0.22 spec/hyperdrive/server_spec.rb
hyperdrive-0.0.21 spec/hyperdrive/server_spec.rb
hyperdrive-0.0.20 spec/hyperdrive/server_spec.rb
hyperdrive-0.0.19 spec/hyperdrive/server_spec.rb
hyperdrive-0.0.18 spec/hyperdrive/server_spec.rb
hyperdrive-0.0.17 spec/hyperdrive/server_spec.rb
hyperdrive-0.0.16 spec/hyperdrive/server_spec.rb