diff --git a/lib/t/set.rb b/lib/t/set.rb index 67ac79d7..a89f8014 100644 --- a/lib/t/set.rb +++ b/lib/t/set.rb @@ -68,5 +68,12 @@ def website(uri) client.update_profile(url: uri) say "@#{@rcfile.active_profile[0]}'s website has been updated." end + + desc 'profile link color', 'Sets a hex value that controls the color scheme of links used on the + 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 link color has been updated." + end end end diff --git a/spec/set_spec.rb b/spec/set_spec.rb index a819545b..85f56484 100644 --- a/spec/set_spec.rb +++ b/spec/set_spec.rb @@ -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