Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/diaspora/diaspora.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorIlya Zhitomirskiy <iz268@nyu.edu>2011-10-23 05:34:47 +0400
committerIlya Zhitomirskiy <iz268@nyu.edu>2011-10-24 22:00:00 +0400
commit8b3c4f4cf22957a949270a1eeab087084fdb382b (patch)
tree5acc914ed64ffdb63cdf38801309ec7eefab11e1 /spec
parentd51516fff3226a44a08da081787cd3aff8f5aa51 (diff)
checking on the attribute not the method
Diffstat (limited to 'spec')
-rw-r--r--spec/controllers/services_controller_spec.rb10
1 files changed, 7 insertions, 3 deletions
diff --git a/spec/controllers/services_controller_spec.rb b/spec/controllers/services_controller_spec.rb
index 7f81b0410..b60321f1a 100644
--- a/spec/controllers/services_controller_spec.rb
+++ b/spec/controllers/services_controller_spec.rb
@@ -87,8 +87,10 @@ describe ServicesController do
request.env['omniauth.auth'] = omniauth_auth
end
- it 'does not queue a job if the profile photo is not updated' do
- @user.person.profile.stub(:image_url).and_return("/some/image_url.jpg")
+ it 'does not queue a job if the profile photo is set' do
+ profile = @user.person.profile
+ profile[:image_url] = "/non/default/image.jpg"
+ profile.save
Resque.should_not_receive(:enqueue)
@@ -96,7 +98,9 @@ describe ServicesController do
end
it 'queues a job to save user photo if the photo does not exist' do
- @user.person.profile.stub(:image_url).and_return(nil)
+ profile = @user.person.profile
+ profile[:image_url] = nil
+ profile.save
Resque.should_receive(:enqueue).with(Jobs::FetchProfilePhoto, @user.id, anything(), "https://service.com/fallback_lowres.jpg")