Created
December 22, 2011 13:59
-
-
Save mrnugget/1510383 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#session_spec.rb | |
it "should show songs in the right order" do | |
song1 = @session.songs.create(:file_name => "03.testing.mp3") | |
song2 = @session.songs.create(:file_name => "01.testing.mp3") | |
@session.songs.should == [song2, song1] | |
end | |
#session.rb | |
class Session < ActiveRecord::Base | |
has_many :songs, :order => 'file_name ASC' | |
# | |
# | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment