test/smile_test.rb in smile-0.4.0 vs test/smile_test.rb in smile-0.4.1
- old
+ new
@@ -5,11 +5,11 @@
before do
# this resets the config to the base state before every test
Smile::Base.clear_config!
Smile::Base.configure do |config|
- # config.logger_on = true
+ # config.logger_on = true
end
@smug = Smile::Smug.new
@smug.auth_anonymously
end
@@ -32,21 +32,36 @@
tests 'album and photo checks' do
test( 'checking to see if we have some albums', ['album']) do
@smug.albums( :nick_name => 'kleinpeter' )
end
- test( 'we can reload albums from the site', ['album'])
-
+ test( 'we can reload albums from the site', ['album']) do
+ album = @smug.albums( :nick_name => 'kleinpeter' ).first
+ old_title = album.title
+ album.title = 'foo'
+ album.reload!
+ old_title == album.title
+ end
+
test 'checking to see if we have photos in the albums', ['album'] do
album = @smug.albums( :nick_name => 'kleinpeter' ).first
!album.photos.empty?
end
test 'a photo is connected to its album', ['photo'] do
album = @smug.albums( :nick_name => 'kleinpeter' ).first
photo = album.photos.first
album.album_id == photo.album.album_id &&
album.key == photo.album.key
+ end
+
+ test( 'we can reload photos from the site', ['photo']) do
+ album = @smug.albums( :nick_name => 'kleinpeter' ).first
+ photo = album.photos.first
+ old_url = photo.tinyurl
+ photo.tinyurl = 'foo'
+ photo.reload!
+ old_url == photo.tinyurl
end
end
tests 'confirm configuration settings', ['config'] do
test 'there is a default api key' do