Sha256: 0a30b27d956b56be608fa781cb4a6d4b9346c90f39e60946f02ef5de9d18c15e

Contents?: true

Size: 934 Bytes

Versions: 8

Compression:

Stored size: 934 Bytes

Contents

#
# Testing rufus-verbs
#
# jmettraux@gmail.com
#
# Sun Jan 13 12:33:03 JST 2008
#

require 'test/unit'
require 'testbase'

require 'rufus/verbs'


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

    include Rufus::Verbs

    #
    # Using an items server with the authentication on.
    #
    def setup

        @server = ItemServer.new :auth => :basic
        @server.start
    end


    def test_0

        #res = get :uri => "http://localhost:7777/items"
        #assert_equal 200, res.code.to_i
        #assert_equal "{}", res.body.strip
        expect 401, nil, get(:uri => "http://localhost:7777/items")

        expect 401, nil, get(
            :uri => "http://localhost:7777/items", 
            :http_basic_authentication => [ "toto", "wrong" ])

        expect 200, {}, get(
            :uri => "http://localhost:7777/items?a", 
            :http_basic_authentication => [ "toto", "toto" ])
    end
end

Version data entries

8 entries across 8 versions & 1 rubygems

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