Sha256: 10f6dd615be244d59d2a995de633fa567472ff840054f255ba712cbfacd81aa8

Contents?: true

Size: 1.14 KB

Versions: 3

Compression:

Stored size: 1.14 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', 'foobar')
      p.should be_an Array
      p.length.should == 2
    end

  end




end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
flexmls_api-0.3.6 spec/unit/flexmls_api/models/video_spec.rb
flexmls_api-0.3.3 spec/unit/flexmls_api/models/video_spec.rb
flexmls_api-0.3.2 spec/unit/flexmls_api/models/video_spec.rb