diff options
author | elijah <elijah@riseup.net> | 2012-12-24 16:25:39 -0800 |
---|---|---|
committer | elijah <elijah@riseup.net> | 2012-12-24 16:25:39 -0800 |
commit | 8a70059fed66daa00dd9f8558748255735c91846 (patch) | |
tree | 47d22bb1719d389f4c1cc9b3a91d7cdb94fdee84 /test | |
parent | 8b5cd59867b00829dfe9d38531d44f1fdf4edbdc (diff) |
added nickserver daemon
Diffstat (limited to 'test')
-rw-r--r-- | test/unit/server_test.rb | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/test/unit/server_test.rb b/test/unit/server_test.rb index e4c2dc6..5a6bd8d 100644 --- a/test/unit/server_test.rb +++ b/test/unit/server_test.rb @@ -2,6 +2,9 @@ require File.expand_path('test_helper', File.dirname(__FILE__)) class ServerTest < MiniTest::Unit::TestCase + # + # this test works because http requests to localhost are not stubbed, but requests to other domains are. + # def test_server uid = 'cloudadmin@leap.se' key_id = 'E818C478D3141282F7590D29D041EB11B1647490' @@ -9,19 +12,19 @@ class ServerTest < MiniTest::Unit::TestCase stub_get_response(key_id, :body => file_content(:leap_public_key)) EM.run do - EM.start_server '0.0.0.0', Nickserver::Config.port, Nickserver::Server - + Nickserver::Server.start params = {:query => {}, :path => "key/#{CGI.escape(uid)}"} http = EventMachine::HttpRequest.new("http://localhost:#{Nickserver::Config.port}").get(params) http.callback { assert_equal file_content(:leap_public_key), http.response EM.stop + return }.errback { - puts http.error + flunk http.error EM.stop } end + flunk 'should not get here' end end - |