Skip to content
Browse files

pushing up the album spec

  • Loading branch information...
1 parent e23f696 commit 49171565dcace4b4eef41ffc69e68e772f4564a6 @cajun committed Jan 10, 2011
Showing with 41 additions and 0 deletions.
  1. +41 −0 spec/album_spec.rb
View
41 spec/album_spec.rb
@@ -0,0 +1,41 @@
+require File.dirname(__FILE__) + '/spec_helper'
+
+describe Smile do
+ before(:each) do
+ VCR.use_cassette 'login anonymously', :record => :new_episodes do
+ # this resets the config to the base state before every test
+ Smile::Base.clear_config!
+ Smile::Base.configure do |config|
+ config.logger_on = false
+ end
+ @smug = Smile.auth_anonymously
+ @album = @smug.albums(:nick_name => 'kleinpeter').first
+ end
+ end
+
+ describe 'albums' do
+ it 'should have albums on an nickname account' do
+ VCR.use_cassette 'getting albums for a nickname', :record => :new_episodes do
+ @smug.albums( :nick_name => 'kleinpeter' ).wont_be_empty
+ end
+ end
+
+ describe 'have methods' do
+ it 'should be able to be reloaded' do
+ VCR.use_cassette 'reloading album', :record => :new_episodes do
+ old_title = @album.title
+ @album.title = 'foo'
+ @album.reload!
+ @album.title.must_equal old_title
+ end
+ end
+
+ it 'should have photos' do
+ VCR.use_cassette 'checking photos', :record => :new_episodes do
+ @album.photos.wont_be_empty
+ end
+ end
+
+ end
+ end
+end

0 comments on commit 4917156

Please sign in to comment.
Something went wrong with that request. Please try again.