Sha256: 9a7cbdbd7d2ebe606fa5a790d2b7aab2fd679c0421ca5ea2d633c1b003a95b56
Contents?: true
Size: 908 Bytes
Versions: 4
Compression:
Stored size: 908 Bytes
Contents
require 'spec_helper' describe 'YoutubeUpdateSpec' do it 'updates a video on youtube' do access_token = double('access_token') oauth_token = 'oauth_token' x_gdata_key = 'x_gdata_key' video_uid = 'video_uid' user_name = 'user_name' update_xml = IO.read(SimpleYoutube::ROOT + '/spec/fixture/video_update.xml') RestClient.should_receive(:put).with( "http://gdata.youtube.com/feeds/api/users/#{user_name}/uploads/#{video_uid}", update_xml, { 'Authorization' => "Bearer #{oauth_token}", 'Content-Type' => 'application/atom+xml', 'GData-Version' => '2', 'X-GData-Key' => "key=#{x_gdata_key}" }). and_return(Net::HTTPResponse.new(1.1, 200, 'OK')) response = Youtube::Video.update( video_uid, user_name, update_xml, oauth_token, x_gdata_key) response.code.should == 200 end end
Version data entries
4 entries across 4 versions & 1 rubygems