require 'ostruct' require 'iremix/video' module Iremix describe Video do it "returns videos" do token = OpenStruct.new(:token => '123abc') response = OpenStruct.new(:parsed => {"videos"=>[{"id"=>7820, "title"=>"Mouse Mantis", "video_url"=>"http://remix-development.s3.amazonaws.com/a0f0bdf33073704d18553f5af88555ff.mp4", "person_id"=>28294, "screenshot_url"=>"http://remix-development.s3.amazonaws.com/a0f0bdf33073704d18553f5af88555ff_2.jpg", "description"=>" mouse mantis ", "tags"=>["mouse mantis"], "group_id"=>nil, "created_at"=>"2012-04-03T15:53:31-05:00", "updated_at"=>"2012-04-03T15:54:12-05:00"}]}) token.should_receive(:get) .with('/api/v1/videos.json', :params => { :access_token => '123abc' }) .and_return(response) videos = Video.all(token) videos.first.id.should == 7820 end end end