Sha256: e87057bc7a1673b822cbbd98822cbbdab9533bff015ed9a9d39737268b3f049c
Contents?: true
Size: 1.13 KB
Versions: 1
Compression:
Stored size: 1.13 KB
Contents
require './spec/spec_helper' describe Video do it "responds to" do Video.should respond_to(:find_by_listing_key) Video.new.should respond_to(:branded?) Video.new.should respond_to(:unbranded?) end it "has a type" do Video.new(:Type => "branded").branded?.should == true Video.new(:Type => "unbranded").branded?.should == false Video.new(:Type => "unbranded").unbranded?.should == true Video.new(:Type => "branded").unbranded?.should == false end describe "find videos by listing id" do before do stub_auth_request stub_request(:get, "#{FlexmlsApi.endpoint}/#{FlexmlsApi.version}/listings/1234/videos"). with(:query => { :ApiSig => "c95bfef766128b91a2643fcc2fa40dfc", :AuthToken => "c401736bf3d3f754f07c04e460e09573", :ApiUser => "foobar" }). to_return(:body => fixture('listing_videos_index.json')) end it "should get an array of videos" do p = Video.find_by_listing_key('1234') p.should be_an(Array) p.length.should == 2 end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
flexmls_api-0.4.5 | spec/unit/flexmls_api/models/video_spec.rb |