Sha256: 3c36dfb6ce5abd27bde495be1831f0a01b3c38a88dfd549ba5315db4a3650b0a

Contents?: true

Size: 1 KB

Versions: 2

Compression:

Stored size: 1 KB

Contents

require "spec_helper"

describe Vkontakte::Api::Photos do
  it "should be valid" do
    Vkontakte::Api::Photos.should be_a(Module)
  end
  
  context "params" do
    before(:each) do
      @token = '3a3d250e705051b03ed479343c3ec2833783eea3eea29860182716ed1d40319'
      @iframe = Vkontakte::App::Iframe.new
      @iframe.auth = {'access_token' => @token}
    end
    
    it "should be call getAlbums method" do
      response = '{"response":[{"aid":"17071606","thumb_id":"98054577","owner_id":"6492","title":"",
"description":"","created":"1204576880","updated":"1229532461", "size":"3","privacy":"0"}]}'

      FakeWeb.register_uri(:get, 
        "https://api.vkontakte.ru/method/photos.getAlbums?access_token=#{@token}", 
        :body => response)
      
      @iframe.photos.getAlbums.should == {"response" => [{"aid" => "17071606","thumb_id" => "98054577","owner_id" => "6492","title" => "", "description" => "","created" => "1204576880","updated" => "1229532461", "size" => "3","privacy" => "0"}]}
    end
    
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
vkontakte-0.0.2 spec/api/photos_spec.rb
vkontakte-0.0.1 spec/api/photos_spec.rb