Sha256: 041785dc516be664d994526da7b41e5f08ed4259c6c291cf64f761f1b5eb0dd9

Contents?: true

Size: 1.47 KB

Versions: 8

Compression:

Stored size: 1.47 KB

Contents

require "helper"

describe Picasa::API::Album do
  describe "#update" do
    it "updates album summary" do
      VCR.use_cassette("album-update") do
        attributes = {:title => "gem-test", :summary => "created from test suite", :access => "protected",
          :location => "Sydney"}
        api = Picasa::API::Album.new(:user_id => "lwoggardner@gmail.com", :authorization_header => AuthHeader)

        album = api.create(attributes)
        original_timestamp = album.timestamp

        album = api.show(album.id)
        assert_equal "created from test suite", album.subtitle

        album = api.update(album.id, :summary => "updated")

        assert_equal "Sydney", album.location
        assert_equal "updated", album.summary
        assert_equal "protected", album.access
        assert_equal  original_timestamp, album.timestamp

        album = api.show(album.id)

        assert_equal "Sydney", album.location
        assert_equal "updated", album.subtitle
        assert_equal "protected", album.access

        new_timestamp = 1385553052
        album = api.update(album.id, :location => "Melbourne", :title => "gem-test-updated", :summary => "updated again",
          :access => "private", :timestamp => new_timestamp)

        assert_equal "Melbourne", album.location
        assert_equal "updated again", album.summary
        assert_equal "private", album.access
        assert_equal  new_timestamp, album.timestamp.to_i

        api.delete(album.id)
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
picasa-0.9.1 test/api/album_update_test.rb
picasa-0.9.0 test/api/album_update_test.rb
picasa-0.8.0 test/api/album_update_test.rb
picasa-0.7.5 test/api/album_update_test.rb
picasa-0.7.4 test/api/album_update_test.rb
picasa-0.7.3 test/api/album_update_test.rb
picasa-0.7.2 test/api/album_update_test.rb
picasa-0.7.1 test/api/album_update_test.rb