@@ -60,31 +60,32 @@ def _delete_user
6060
6161 def test_authorize
6262 get "/ontologies"
63- assert last_response . status == 401
63+ assert_equal 401 , last_response . status
64+ get "/ontologies" , { } , { "Authorization" => "bogus auth header" }
65+ assert_equal 401 , last_response . status
6466 get "/ontologies" , { } , { "Authorization" => 'apikey token="' +@apikey +'' +'"' }
65- assert last_response . status == 200
67+ assert_equal 200 , last_response . status
6668 apikey = MultiJson . load ( last_response . body )
6769 assert @apikey . eql? ( apikey )
6870 get "/ontologies" , { } , { "Authorization" => "apikey token=#{ @apikey } " }
69- assert last_response . status == 200
71+ assert_equal 200 , last_response . status
7072 apikey = MultiJson . load ( last_response . body )
71- assert @apikey . eql? ( apikey )
73+ assert_equal @apikey , apikey
7274 get "/ontologies?apikey=#{ @apikey } "
73- assert last_response . status == 200
75+ assert_equal 200 , last_response . status
7476 apikey = MultiJson . load ( last_response . body )
75- assert @apikey . eql? ( apikey )
77+ assert_equal @apikey , apikey
7678 get "/ontologies" , { } , { "Authorization" => 'apikey token="' +@apikey +'&userapikey=' +@userapikey +'"' }
77- assert last_response . status == 200
79+ assert_equal 200 , last_response . status
7880 apikey = MultiJson . load ( last_response . body )
79- assert @userapikey . eql? ( apikey )
81+ assert_equal @userapikey , apikey
8082 get "/ontologies" , { } , { "Authorization" => "apikey token=#{ @apikey } &userapikey=#{ @userapikey } " }
81- assert last_response . status == 200
83+ assert_equal 200 , last_response . status
8284 apikey = MultiJson . load ( last_response . body )
83- assert @userapikey . eql? ( apikey )
85+ assert_equal @userapikey , apikey
8486 get "/ontologies?apikey=#{ @apikey } &userapikey=#{ @userapikey } "
85- assert last_response . status == 200
87+ assert_equal 200 , last_response . status
8688 apikey = MultiJson . load ( last_response . body )
87- assert @userapikey . eql? ( apikey )
89+ assert_equal @userapikey , apikey
8890 end
89-
9091end
0 commit comments