alexrothenberg/ammeter — Issue #3: migration_file in subject
Author: EppO
Created: 2011-10-12 14:58:47+00:00
State: open

It would be nice to have a migration_file method in a subject to test the content of the migration file, something like

describe ActiveRecord::Generators::MigrationGenerator do
destination File.expand_path("../../tmp", __FILE__)

before do
prepare_destination
run_generator %w(create_posts)
end
subject { migration_file('db/migrate/create_posts.rb') }
it { should exist }
it { should contain 'class CreatePosts < ActiveRecord::Migration' }
end

cheers.