Sha256: ab60e3e38645f44ce1354bfbd7d6cf1e674c074ba4ade3c5f902bffad8e19192

Contents?: true

Size: 1.49 KB

Versions: 21

Compression:

Stored size: 1.49 KB

Contents

require File.dirname(__FILE__) + '/../spec_helper'

describe Flickr::Photosets do
  before :all do
    @get_list_xml = File.read(File.dirname(__FILE__) +
        "/../fixtures/flickr/photosets/get_list-0.xml")
    @get_photos_xml = File.read(File.dirname(__FILE__) +
        "/../fixtures/flickr/photosets/get_photos-0.xml")
  end
    
  before :each do
    @flickr = SpecHelper.flickr
  end

  
  describe ".get_list" do
    it "should call flickr.photosets.getList" do
      @flickr.should_receive(:send_request).with("flickr.photosets.getList", {})       
      @flickr.photosets.get_list
    end
    
    it "should return an array of photoset objects" do
      @flickr.stub!(:request_over_http).and_return(@get_list_xml)  
      photosets = @flickr.photosets.get_list
      
      photosets[0].should be_an_instance_of(Flickr::Photosets::Photoset)      
      photosets[0].title.should == 'Test'
    end
  end
  
  describe ".get_photos" do
    before :each do
      @photoset = Flickr::Photosets::Photoset.new(@flickr,{:id=>4})
    end
    
    it "should call flickr.photosets.getPhotos" do
      @flickr.should_receive(:send_request).with("flickr.photosets.getPhotos",{:photoset_id=>4})       
      @photoset.get_photos
    end
    
    it "should return an array of photo objects" do
      @flickr.stub!(:request_over_http).and_return(@get_photos_xml)  
      photos = @photoset.get_photos
      
      photos.should_not be_nil
      photos[0].should be_an_instance_of(Flickr::Photos::Photo)    
    end
  end
end

Version data entries

21 entries across 21 versions & 10 rubygems

Version Path
commonthread-flickr_fu-0.3.0 spec/flickr/photosets_spec.rb
maciej-flickr_fu-0.3.0 spec/flickr/photosets_spec.rb
rmm5t-flickr_fu-0.3.1 spec/flickr/photosets_spec.rb
rschenk-flickr_fu-0.3.2 spec/flickr/photosets_spec.rb
fotonauts-flickr_fu-0.3.4 spec/flickr/photosets_spec.rb
fotonauts-flickr_fu-0.3.3 spec/flickr/photosets_spec.rb
fotonauts-flickr_fu-0.3.2 spec/flickr/photosets_spec.rb
flickr_fu-0.3.1 spec/flickr/photosets_spec.rb
tomk32-flickr_fu-0.3.4.1 spec/flickr/photosets_spec.rb
userharmony-flickr_fu-0.3.6 spec/flickr/photosets_spec.rb
tomk32-flickr_fu-0.3.3 spec/flickr/photosets_spec.rb
tomk32-flickr_fu-0.3.2 spec/flickr/photosets_spec.rb
tomk32-flickr_fu-0.3.1 spec/flickr/photosets_spec.rb
robsharp-flickr_fu-0.3.0 spec/flickr/photosets_spec.rb
mrpunkin-flickr_fu-0.3.0 spec/flickr/photosets_spec.rb
flickr_fu-0.3.0 spec/flickr/photosets_spec.rb
tomk32-flickr_fu-0.3.0 spec/flickr/photosets_spec.rb
rmm5t-flickr_fu-0.3.5 spec/flickr/photosets_spec.rb
rmm5t-flickr_fu-0.3.4 spec/flickr/photosets_spec.rb
rmm5t-flickr_fu-0.3.3 spec/flickr/photosets_spec.rb