test/test_tumblr.rb in tumblr-rb-1.2.0 vs test/test_tumblr.rb in tumblr-rb-1.3.0
- old
+ new
@@ -116,11 +116,11 @@
assert include_theme.with.split('&').include?("include-theme=1")
end
test 'executes' do
cred = {:email => 'test@testermcgee.com', :password => 'dontrevealmysecrets'}
- response = VCR.with_cassette('write/write') do
+ response = VCR.use_cassette('write/write') do
Tumblr.execute(cred, 'Hello World.')
end
assert response.is_a? Weary::Response
assert response.success?
end
@@ -251,11 +251,11 @@
assert_equal link.first['reblog_key'], link_post.reblog_key
end
test 'gets all the posts for a username' do
reader = Tumblr::Reader.new('test@testermcgee.com','dontrevealmysecrets')
- posts = VCR.with_cassette('read/authenticated') do
+ posts = VCR.use_cassette('read/authenticated') do
reader.get_all_posts('mwunsch')
end
assert_equal 66, posts.count
end
@@ -307,10 +307,18 @@
post = {:'post-id' => "431830023"}
response = hijack! publisher.delete(post), 'write/delete'
assert response.success?
assert_equal 'Deleted', response.body
end
+
+ test 'reblogs a post' do
+ assert_respond_to Tumblr::Writer.new, :reblog
+ publisher = Tumblr::Writer.new('test@testermcgee.com','dontrevealmysecrets')
+ post = {:'post-id' => "507998507", :'reblog-key' => 'DifhdmQI'}
+ response = hijack! publisher.reblog(post), 'write/reblog'
+ assert_equal 201, response.code
+ end
end
describe 'Authenticator' do
test 'sets up credentials for authentication' do
user = Tumblr::Authenticator
@@ -465,9 +473,15 @@
end
test 'deletes itself' do
post = Tumblr::Post.new(123)
assert post.delete('test@testermcgee.com','dontrevealmysecrets').is_a? Weary::Request
+ end
+
+ test 'reblogs itself' do
+ post = Tumblr::Post.new(123)
+ post.reblog_key = '0U812'
+ assert post.reblog('test@testermcgee.com','dontrevealmysecrets').is_a? Weary::Request
end
test 'likes itself' do
post = Tumblr::Post.new(445597771)
post.reblog_key = "DLVWOpfh"