Skip to content

Instantly share code, notes, and snippets.

@mrnugget
Created December 22, 2011 13:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mrnugget/1510383 to your computer and use it in GitHub Desktop.
Save mrnugget/1510383 to your computer and use it in GitHub Desktop.
#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