From 97153ad08bef9d961174ec769a22eef97a8269fa Mon Sep 17 00:00:00 2001 From: Benjamin Neff Date: Mon, 8 Jun 2015 03:25:24 +0200 Subject: [PATCH] update tests for new twitter client closes #6083 --- Changelog.md | 1 + spec/models/services/twitter_spec.rb | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/Changelog.md b/Changelog.md index bd05b6a0d..961ca4906 100644 --- a/Changelog.md +++ b/Changelog.md @@ -27,6 +27,7 @@ * Make used post title lengths more consistent [#6022](https://github.com/diaspora/diaspora/pull/6022) * Improved logging source [#6041](https://github.com/diaspora/diaspora/pull/6041) * Gracefully handle duplicate entry while receiving share-visibility in parallel [#6068](https://github.com/diaspora/diaspora/pull/6068) +* Update twitter gem to get rid of deprecation warnings [#6083](https://github.com/diaspora/diaspora/pull/6083) ## Bug fixes * Disable auto follow back on aspect deletion [#5846](https://github.com/diaspora/diaspora/pull/5846) diff --git a/spec/models/services/twitter_spec.rb b/spec/models/services/twitter_spec.rb index c111f6c34..982b42afa 100644 --- a/spec/models/services/twitter_spec.rb +++ b/spec/models/services/twitter_spec.rb @@ -12,11 +12,11 @@ describe Services::Twitter, :type => :model do describe '#post' do before do - allow_any_instance_of(Twitter::Client).to receive(:update) { Twitter::Tweet.new(id: "1234") } + allow_any_instance_of(Twitter::REST::Client).to receive(:update) { Twitter::Tweet.new(id: "1234") } end it 'posts a status message to twitter' do - expect_any_instance_of(Twitter::Client).to receive(:update).with(instance_of(String)) + expect_any_instance_of(Twitter::REST::Client).to receive(:update).with(instance_of(String)) @service.post(@post) end @@ -27,7 +27,7 @@ describe Services::Twitter, :type => :model do it 'swallows exception raised by twitter always being down' do skip - expect_any_instance_of(Twitter::Client).to receive(:update).and_raise(StandardError) + expect_any_instance_of(Twitter::REST::Client).to receive(:update).and_raise(StandardError) @service.post(@post) end @@ -141,7 +141,7 @@ describe Services::Twitter, :type => :model do it 'returns the original profile photo url' do user_double = double expect(user_double).to receive(:profile_image_url_https).with("original").and_return("http://a2.twimg.com/profile_images/uid/avatar.png") - expect_any_instance_of(Twitter::Client).to receive(:user).with("joindiaspora").and_return(user_double) + expect_any_instance_of(Twitter::REST::Client).to receive(:user).with("joindiaspora").and_return(user_double) @service.nickname = "joindiaspora" expect(@service.profile_photo_url).to eq("http://a2.twimg.com/profile_images/uid/avatar.png") -- GitLab