Sha256: 3ab68e24cdeec856d9614d590cccef4b6a257502ef131b733b5214b7de9bc7bf

Contents?: true

Size: 789 Bytes

Versions: 10

Compression:

Stored size: 789 Bytes

Contents

require File.dirname(__FILE__) + '/test_helper.rb'

class TestGoalocB < Test::Unit::TestCase
  def clean_app!
    if defined?(@app)
      @app.models.values.each do |m|
        Object.send(:remove_const, m.to_s.to_sym)
      end
    end
    @app = App.new
  end
  
  context "that routes a highly complex route" do
    setup { clean_app!;  @app.route( [:users, :profiles, [:posts, [:comments, :ratings]], [:pictures, :ratings]]) }
    
    should "have routes on User" do
      assert_equal User.routes, [[User]]
    end
    
    should "have routes on Profiles" do
      assert_equal Profile.routes, [[User, Profile]]
    end
    
    should "have routes on Posts" do
      assert_equal Post.routes, [[User, Post]]  #this breaks for some reason that I don't understand.
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
mattknox-goaloc-0.0.3 test/test_goaloc_b.rb
mattknox-goaloc-0.0.5 test/test_goaloc_b.rb
mattknox-goaloc-0.0.6 test/test_goaloc_b.rb
mattknox-goaloc-0.0.7 test/test_goaloc_b.rb
mattknox-goaloc-0.0.8 test/test_goaloc_b.rb
mattknox-goaloc-0.0.9 test/test_goaloc_b.rb
mattknox-goaloc-0.1.0 test/test_goaloc_b.rb
mattknox-goaloc-0.2.0 test/test_goaloc_b.rb
mattknox-goaloc-0.2.1 test/test_goaloc_b.rb
mattknox-goaloc-0.2.2 test/test_goaloc_b.rb