diff options
author | Ilya Zhitomirskiy <iz268@nyu.edu> | 2011-10-23 05:34:47 +0400 |
---|---|---|
committer | Ilya Zhitomirskiy <iz268@nyu.edu> | 2011-10-24 22:00:00 +0400 |
commit | 8b3c4f4cf22957a949270a1eeab087084fdb382b (patch) | |
tree | 5acc914ed64ffdb63cdf38801309ec7eefab11e1 /spec | |
parent | d51516fff3226a44a08da081787cd3aff8f5aa51 (diff) |
checking on the attribute not the method
Diffstat (limited to 'spec')
-rw-r--r-- | spec/controllers/services_controller_spec.rb | 10 |
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") |