Sha256: afb1b5190d3dd48830c68585f74937aab81b82ebb6a301e0c12c0c6e0075245d

Contents?: true

Size: 1.61 KB

Versions: 9

Compression:

Stored size: 1.61 KB

Contents

require 'test_helper'

class SmileTest < Test::Unit::TestCase
  def setup
    @smug = Smile::Smug.new
    @smug.auth_anonymously
  end
  
  def test_auth
    assert_not_nil( @smug.auth_anonymously )
  end
  
  def test_have_albums
    assert_nothing_raised(Exception) do
      assert_not_nil( @smug.albums( :NickName => 'kleinpeter' ) )
    end
  end
  
  def test_have_photos
    assert_nothing_raised(Exception) do
      album = @smug.albums( :NickName => 'kleinpeter' ).first
      assert_not_nil( album.photos )
    end
  end
  
  def test_photo_has_album
    assert_nothing_raised(Exception) do
      album = @smug.albums( :NickName => 'kleinpeter' ).first
      photo = album.photos.first
      assert_equal( album.album_id, photo.album.album_id )
      assert_equal( album.key, photo.album.key )
    end
  end
  
  def test_photo_has_album_has_photo
    assert_nothing_raised(Exception) do
      album = @smug.albums( :NickName => 'kleinpeter' ).first
      photo = album.photos.first
      alt_photo = photo.album.photos.first
      
      assert_equal( photo.image_id, alt_photo.image_id )
    end
  end
  
  # NOTE have to be logged in to test this one
  # def test_album_stats
  #   assert_nothing_raised(Exception) do
  #     album = @smug.albums( :NickName => 'kleinpeter' ).first
  #     assert_not_nil( album.stats )
  #   end
  # end
  
  def test_photo_extras
    assert_nothing_raised(Exception) do
      album = @smug.albums( :NickName => 'kleinpeter' ).first
      photo = album.photos.first
      
      assert_not_nil( photo.details )
      assert_not_nil( photo.info )
      assert_not_nil( photo.urls )
    end
  end
end

Version data entries

9 entries across 9 versions & 2 rubygems

Version Path
cajun-smile-0.1.2 test/smile_test.rb
cajun-smile-0.1.3 test/smile_test.rb
cajun-smile-0.2.0 test/smile_test.rb
cajun-smile-0.2.1 test/smile_test.rb
cajun-smile-0.3.0 test/smile_test.rb
smile-0.3.0 test/smile_test.rb
smile-0.2.1 test/smile_test.rb
smile-0.2.0 test/smile_test.rb
smile-0.1.3 test/smile_test.rb