Sha256: bda2179d8ad3d9966214d26f185189c001f235ae6167d5ee5e4c93a420a87232

Contents?: true

Size: 809 Bytes

Versions: 2

Compression:

Stored size: 809 Bytes

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_api_get('/listings/1234/videos','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

2 entries across 2 versions & 1 rubygems

Version Path
flexmls_api-0.6.5 spec/unit/flexmls_api/models/video_spec.rb
flexmls_api-0.6.4 spec/unit/flexmls_api/models/video_spec.rb