Skip to content

Commit

Permalink
Fixed broken migrations tests: added assert_equal. [rails#1704 state:…
Browse files Browse the repository at this point in the history
…resolved]

Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
  • Loading branch information
marcenuc authored and lifo committed Mar 7, 2009
1 parent 20d3892 commit dfcf1e4
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions activerecord/test/cases/migration_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -945,20 +945,20 @@ def test_migrator_one_up_with_exception_and_rollback

def test_finds_migrations
migrations = ActiveRecord::Migrator.new(:up, MIGRATIONS_ROOT + "/valid").migrations
[['1', 'people_have_last_names'],
['2', 'we_need_reminders'],
['3', 'innocent_jointable']].each_with_index do |pair, i|
migrations[i].version == pair.first
migrations[1].name == pair.last

[[1, 'PeopleHaveLastNames'], [2, 'WeNeedReminders'], [3, 'InnocentJointable']].each_with_index do |pair, i|
assert_equal migrations[i].version, pair.first
assert_equal migrations[i].name, pair.last
end
end

def test_finds_pending_migrations
ActiveRecord::Migrator.up(MIGRATIONS_ROOT + "/interleaved/pass_2", 1)
migrations = ActiveRecord::Migrator.new(:up, MIGRATIONS_ROOT + "/interleaved/pass_2").pending_migrations

assert_equal 1, migrations.size
migrations[0].version == '3'
migrations[0].name == 'innocent_jointable'
assert_equal migrations[0].version, 3
assert_equal migrations[0].name, 'InnocentJointable'
end

def test_only_loads_pending_migrations
Expand Down

0 comments on commit dfcf1e4

Please sign in to comment.