Permalink
Browse files

test case to reveal bug fixed by theirix

  • Loading branch information...
1 parent 422a6f8 commit f0c77f401165f6e3be80bf5b222a86b3332dc33f @davetron5000 committed Jan 18, 2011
Showing with 20 additions and 0 deletions.
  1. +20 −0 test/tc_auth.rb
View
@@ -5,6 +5,16 @@
require 'string_rtmize'
include RTM
+class MockEndpoint
+ attr_reader :method
+ attr_reader :params
+ attr_reader :endpoint
+ def url_for(method,params,endpoint)
+ @method = method
+ @params = params
+ @endpoint = endpoint
+ end
+end
class TC_testAuth < TestBase
def test_get_set_frob
@@ -16,6 +26,16 @@ def test_get_set_frob
assert_equal frob,auth.frob
end
+ def test_respect_perms
+ mock_endpoint = MockEndpoint.new
+ auth = RTMAuth.new(mock_endpoint)
+ auth = auth.url(:read,:web)
+ assert_nil mock_endpoint.method
+ assert_nil mock_endpoint.params['frob']
+ assert_equal 'auth',mock_endpoint.endpoint
+ assert_equal 'read',mock_endpoint.params['perms']
+ end
+
def test_bad_check_token_call
rtm = get_rtm
assert_raises RuntimeError do

0 comments on commit f0c77f4

Please sign in to comment.