Skip to content

Commit

Permalink
Test cases for set profile link color[sferik#333]
Browse files Browse the repository at this point in the history
  • Loading branch information
Shwetakale committed Jun 29, 2016
1 parent 9fd58c4 commit 5088985
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/t/set.rb
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ def website(uri)
authenticating user’s profile page on twitter.com. '
def profile_link_color(color_code)
client.update_profile(profile_link_color: color_code)
say "@#{@rcfile.active_profile[0]}'s profile color code has been updated."
say "@#{@rcfile.active_profile[0]}'s profile link color has been updated."
end
end
end
15 changes: 15 additions & 0 deletions spec/set_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -149,4 +149,19 @@
expect($stdout.string.chomp).to eq "@testcli's website has been updated."
end
end

describe 'profile_link_color' do
before do
@set.options = @set.options.merge('profile' => fixture_path + '/.trc')
stub_post('/1.1/account/update_profile.json').with(body: {profile_link_color: '0084B4'}).to_return(body: fixture('sferik.json'), headers: {content_type: 'application/json; charset=utf-8'})
end
it 'requests the correct resource' do
@set.profile_link_color('0084B4')
expect(a_post('/1.1/account/update_profile.json').with(body: {profile_link_color: '0084B4'})).to have_been_made
end
it 'has the correct output' do
@set.profile_link_color('0084B4')
expect($stdout.string.chomp).to eq "@testcli's profile link color has been updated."
end
end
end

0 comments on commit 5088985

Please sign in to comment.