Changeset 1218

Show
Ignore:
Timestamp:
11/25/07 15:53:02 (1 year ago)
Author:
sandal
Message:

Mike, I'm a lazy bastard

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • acts_as_reportable/test/acts_as_reportable_test.rb

    r1217 r1218  
     1class Array 
     2  def to_table(columns) 
     3    Table(columns) { |t| each { |r| t << r } }     
     4  end 
     5end 
     6     
     7 
    18#!/usr/bin/env ruby -w 
    29require File.join(File.expand_path(File.dirname(__FILE__)), "helpers") 
     
    172179    def test_include_has_options 
    173180      actual = Team.report_table(:all, :only => 'name', 
    174         :include => { :players => { :only => 'name', :methods => :stats } }) 
    175       expected = [["Testers", "Player 1", "Player 1 stats"], 
    176         ["Testers", "Player 2", "Player 2 stats"], 
    177         ["Others", nil, nil]].to_table(%w[name players.name players.stats]) 
     181        :include => { :players => { :only => 'name' } }) 
     182      expected = [["Testers", "Player 1"], 
     183        ["Testers", "Player 2"], 
     184        ["Others", nil]].to_table(%w[name players.name]) 
    178185      assert_equal expected, actual 
    179186    end