Sha256: 9c54b25651b4be65ce9b7c6bf035e2e5f47ac84105aa3b22cd81015530b88392

Contents?: true

Size: 1.14 KB

Versions: 3

Compression:

Stored size: 1.14 KB

Contents

require 'test_helper'
require 'roar/representer/feature/transport'

class TransportTest < MiniTest::Spec
  describe "Transport" do
    before do
      @transport = Roar::Representer::Feature::Transport
    end
    
    it "#get_uri returns response" do
      assert_equal "<method>get</method>",  @transport.get_uri("http://localhost:9999/method", "application/xml").body
    end
    
    it "#post_uri returns response" do
      assert_equal "<method>post</method>",  @transport.post_uri("http://localhost:9999/method", "booty", "application/xml").body
    end
    
    it "#put_uri returns response" do
      assert_equal "<method>put</method>",  @transport.put_uri("http://localhost:9999/method", "booty", "application/xml").body
    end
    
    it "#delete_uri returns response" do
      assert_equal "<method>delete</method>",  @transport.delete_uri("http://localhost:9999/method", "application/xml").body
    end
    
    # TODO: how to get PATCH into Sinatra?
    #it "#patch_uri returns Restfulie response" do
    #  assert_equal "<method>patch</method>",  @o.patch_uri("http://localhost:9999/method", "booty", "application/xml").body
    #end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
roar-0.9.2 test/transport_test.rb
roar-0.9.1 test/transport_test.rb
roar-0.9.0 test/transport_test.rb