test/test_tumblr.rb in tumblr-rb-0.1.0 vs test/test_tumblr.rb in tumblr-rb-0.1.1

- old
+ new

@@ -86,9 +86,30 @@ test 'can publish posts to tumblr' do tumbl = Tumblr.new('test@testermcgee.com','dontrevealmysecrets') write = tumbl.post('Hello world') assert write.is_a? Weary::Request end + + test 'can read the dashboard' do + dashboard = Tumblr.new('test@testermcgee.com','dontrevealmysecrets').dashboard + reader = Tumblr::Reader.new('test@testermcgee.com','dontrevealmysecrets').dashboard + assert dashboard.is_a? Weary::Request + assert_equal reader.uri, dashboard.uri + end + + test 'provides a convenience method for reader and writer' do + tumbl = Tumblr.new('test@testermcgee.com','dontrevealmysecrets') + assert tumbl.reader.is_a? Tumblr::Reader + assert tumbl.writer.is_a? Tumblr::Writer + end + + test 'authenticates to get user information' do + tumbl = Tumblr.new('test@testermcgee.com','dontrevealmysecrets') + auth = Tumblr::Authenticator.new('test@testermcgee.com','dontrevealmysecrets').authenticate + assert_respond_to tumbl, :authenticate + assert tumbl.authenticate.is_a? Weary::Request + assert_equal auth.uri, tumbl.authenticate.uri + end end describe 'Reader' do test 'sets up credentials for authentication' do reader = Tumblr::Reader