Sha256: 8caa50b40d04828bc9d3a5309ebc1cef9abe104a493f973cb55752efac2871e4

Contents?: true

Size: 959 Bytes

Versions: 4

Compression:

Stored size: 959 Bytes

Contents

require File.expand_path('../../../test_helper', __FILE__)
require File.expand_path('../../../fixtures/active_record', __FILE__)

class RequestTest < ActionDispatch::IntegrationTest

  def test_get
    get '/posts'
    assert_equal 200, status
  end

  def test_put_single
    put '/posts/3', {"posts" => {"id" => "3", "title" => "A great new Post", "links" => { "tags" => [3,4] }}}
    assert_equal 200, status
  end

  # def test_put_links
  #   put '/posts/3/links/tags', {"tags" => [1,4] }
  #   assert_equal 200, status
  # end

  # def test_patch_create
  #   patch '/posts',
  #       {"op" => "add",
  #       "path" => "/-",
  #       "value" => {"title" => "Another great new Post", "body" => "saasd", "links" => { "author" => 3 }}}
  #   assert_equal 200, status
  # end

  def test_destroy_single
    delete '/posts/7'
    assert_equal 204, status
  end

  def test_destroy_multiple
    delete '/posts/8,9'
    assert_equal 204, status
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
jsonapi-resources-0.0.4 test/integration/requests/request_test.rb
jsonapi-resources-0.0.3 test/integration/requests/request_test.rb
jsonapi-resources-0.0.2 test/integration/requests/request_test.rb
jsonapi-resources-0.0.1 test/integration/requests/request_test.rb