require 'rubygems' require 'test/unit' $:.push(File.dirname(__FILE__) +'/../../test/models') $:.push(File.dirname(__FILE__) +'/../../lib/not_relational') require File.dirname(__FILE__) +'/../../test/models/node.rb' require File.dirname(__FILE__) +'/../../test/models/user.rb' require File.dirname(__FILE__) +'/../../test/models/place.rb' require File.dirname(__FILE__) +'/../../test/models/album.rb' require File.dirname(__FILE__) +'/../../test/models/media_item.rb' require File.dirname(__FILE__) +'/../../test/models/media_file.rb' require File.dirname(__FILE__) +'/../../test/models/tag.rb' require File.dirname(__FILE__) +'/../../test/models/rating.rb' require File.dirname(__FILE__) +'/../../test/models/comment.rb' $repository=nil ENV['NOT_RELATIONAL_ENV']='testing' class AlbumTest < Test::Unit::TestCase def AlbumTest.set_up Album.find(:all).each do |node| node.destroy end Mediaitem.find(:all).each do |node| node.destroy end end def test_item_before_after AlbumTest.set_up node_album=Album.new node_album.user_name='david' node_album.save mediaitems=[] (0..5) .each do |i| mediaitem=Mediaitem.new mediaitem.title="mediaitem #{i}" mediaitem.created_time=Time.now+i*10 mediaitem.save! node_album.connect_mediaitem(mediaitem) mediaitems<