Skip to content

Commit

Permalink
Add secure_image_url and image_size spec.
Browse files Browse the repository at this point in the history
  • Loading branch information
guilhermesimoes committed Jun 24, 2013
1 parent e8c3e29 commit 266a00a
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions spec/omniauth/strategies/twitter_spec.rb
Expand Up @@ -30,6 +30,14 @@
expect(subject.info[:image]).to eq('http://twimg0-a.akamaihd.net/sticky/default_profile_images/default_profile_0.png') expect(subject.info[:image]).to eq('http://twimg0-a.akamaihd.net/sticky/default_profile_images/default_profile_0.png')
end end


it 'should return secure image with size specified' do
@options = { :secure_image_url => 'true', :image_size => 'mini' }
subject.stub(:raw_info).and_return(
{ 'profile_image_url_https' => 'https://twimg0-a.akamaihd.net/sticky/default_profile_images/default_profile_0_normal.png' }
)
expect(subject.info[:image]).to eq('https://twimg0-a.akamaihd.net/sticky/default_profile_images/default_profile_0_mini.png')
end

it 'should return normal image by default' do it 'should return normal image by default' do
subject.stub(:raw_info).and_return( subject.stub(:raw_info).and_return(
{ 'profile_image_url' => 'http://twimg0-a.akamaihd.net/sticky/default_profile_images/default_profile_0_normal.png' } { 'profile_image_url' => 'http://twimg0-a.akamaihd.net/sticky/default_profile_images/default_profile_0_normal.png' }
Expand Down

0 comments on commit 266a00a

Please sign in to comment.