Sha256: a1b08baa3a908b88ed46da18fd021481f706e21e010548b6b30aa22625e657a6

Contents?: true

Size: 1.02 KB

Versions: 10

Compression:

Stored size: 1.02 KB

Contents

#
# Testing rufus-verbs
#
# jmettraux@gmail.com
#
# Sun Jan 13 20:02:25 JST 2008
#

require 'test/unit'
require 'testbase'

require 'rufus/verbs'


class BlockTest < Test::Unit::TestCase
    include TestBaseMixin

    include Rufus::Verbs


    def test_0

        res = post :uri => "http://localhost:7777/items/0" do
            "Fedor" +
            "Fedorovitch"
        end
        assert_equal 201, res.code.to_i
        assert_equal "http://localhost:7777/items/0", res['Location']


        expect(
            200, 
            { 0 => "FedorFedorovitch" }, 
            get(:uri => "http://localhost:7777/things"))

        res = post :uri => "http://localhost:7777/items/1" do |req|
            # do whatever with the request [headers]
            "John"
        end
        assert_equal 201, res.code.to_i
        assert_equal "http://localhost:7777/items/1", res['Location']

        expect(
            200, 
            { 0 => "FedorFedorovitch", 1 => "John" }, 
            get(:uri => "http://localhost:7777/things"))
    end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
rufus-verbs-0.4 test/block_test.rb
rufus-verbs-0.6 test/block_test.rb
rufus-verbs-0.3 test/block_test.rb
rufus-verbs-0.7 test/block_test.rb
rufus-verbs-0.5 test/block_test.rb
rufus-verbs-0.1 test/block_test.rb
rufus-verbs-0.8 test/block_test.rb
rufus-verbs-0.10 test/block_test.rb
rufus-verbs-0.2 test/block_test.rb
rufus-verbs-0.9 test/block_test.rb