Skip to content

Commit

Permalink
Failing test case before migration name change
Browse files Browse the repository at this point in the history
  • Loading branch information
sikachu committed Apr 9, 2012
1 parent 03700c8 commit 1e50b08
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions test/generator_test.rb
Expand Up @@ -14,8 +14,8 @@ class GeneratorTest < Rails::Generators::TestCase
end

should 'create a correct migration file' do
assert_migration 'db/migrate/add_attachment_avatar_to_user.rb' do |migration|
assert_match /class AddAttachmentAvatarToUser/, migration
assert_migration 'db/migrate/add_attachment_avatar_to_users.rb' do |migration|
assert_match /class AddAttachmentAvatarToUsers/, migration

assert_class_method :up, migration do |up|
assert_match /add_column :users, :avatar_file_name, :string/, up
Expand All @@ -40,8 +40,8 @@ class GeneratorTest < Rails::Generators::TestCase
end

should 'create a correct migration file' do
assert_migration 'db/migrate/add_attachment_avatar_photo_to_user.rb' do |migration|
assert_match /class AddAttachmentAvatarPhotoToUser/, migration
assert_migration 'db/migrate/add_attachment_avatar_photo_to_users.rb' do |migration|
assert_match /class AddAttachmentAvatarPhotoToUsers/, migration

assert_class_method :up, migration do |up|
assert_match /add_column :users, :avatar_file_name, :string/, up
Expand Down Expand Up @@ -71,7 +71,7 @@ class GeneratorTest < Rails::Generators::TestCase
context 'without required arguments' do
should 'not create the migration' do
silence_stream(STDERR) { run_generator %w() }
assert_no_migration 'db/migrate/add_attachment_avatar_to_user.rb'
assert_no_migration 'db/migrate/add_attachment_avatar_to_users.rb'
end
end
end
Expand Down

0 comments on commit 1e50b08

Please sign in to comment.