Codebase list ruby-omniauth-twitter / 95b6f73
Merge pull request #90 from cllns/increase-test-coverage Increase test coverage Rashmi Yadav 9 years ago
1 changed file(s) with 21 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
3333 { 'profile_image_url' => 'http://twimg0-a.akamaihd.net/sticky/default_profile_images/default_profile_0_normal.png' }
3434 )
3535 expect(subject.info[:image]).to eq('http://twimg0-a.akamaihd.net/sticky/default_profile_images/default_profile_0.png')
36 end
37
38 it 'should return bigger image when bigger size specified' do
39 @options = { :image_size => 'bigger' }
40 allow(subject).to receive(:raw_info).and_return(
41 { 'profile_image_url' => 'http://twimg0-a.akamaihd.net/sticky/default_profile_images/default_profile_0_normal.png' }
42 )
43 expect(subject.info[:image]).to eq('http://twimg0-a.akamaihd.net/sticky/default_profile_images/default_profile_0_bigger.png')
3644 end
3745
3846 it 'should return secure image with size specified' do
8997 expect { subject.request_phase }.to change { subject.options.client_options.authorize_path }.from('/oauth/authenticate').to('/oauth/authorize')
9098 end
9199 end
100
101 context "with no request params set and force_login specified" do
102 before do
103 allow(subject).to receive(:request) do
104 double('Request', {:params => { 'force_login' => true } })
105 end
106 allow(subject).to receive(:old_request_phase) { :whatever }
107 end
108
109 it "should change add force_login=true to authorize_params" do
110 expect { subject.request_phase }.to change {subject.options.authorize_params.force_login}.from(nil).to(true)
111 end
112 end
92113 end
93114 end