Merge pull request #90 from cllns/increase-test-coverage
Increase test coverage
Rashmi Yadav
9 years ago
33 | 33 | { 'profile_image_url' => 'http://twimg0-a.akamaihd.net/sticky/default_profile_images/default_profile_0_normal.png' } |
34 | 34 | ) |
35 | 35 | 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') | |
36 | 44 | end |
37 | 45 | |
38 | 46 | it 'should return secure image with size specified' do |
89 | 97 | expect { subject.request_phase }.to change { subject.options.client_options.authorize_path }.from('/oauth/authenticate').to('/oauth/authorize') |
90 | 98 | end |
91 | 99 | 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 | |
92 | 113 | end |
93 | 114 | end |