Sha256: 09fc5c0c645939d61974c31dd5aca2e5fab1e0324cd161d3603a8bb88743285a

Contents?: true

Size: 1.24 KB

Versions: 2

Compression:

Stored size: 1.24 KB

Contents

require 'spec_helper'

Rails::Migration::Assist.orm = :active_record

describe 'migration' do 
  use_orm :active_record
  use_helpers :migration

  before :each do              
    remove_migration :create_account        
    
    create_migration :create_account do
      %q{
        def self.up
        end

        def self.down
        end
      }
    end    
  end

  after :each do              
    # remove_migration :create_account
  end
    
  it "should have an create_account_migration file that contains an index method and two inserted comments" do
    insert_into_migration :create_account, :content => '# hello'
    insert_into_migration :create_account do
      '# goodbye'
    end
    read_migration(:create_account).should have_comment 'hello'
    puts read_migration(:create_account)

    # puts migration_file_name :create_account

    # puts existing_file_name :create_account, :migration

    root_dir.should have_migration :create_account

    lambda {existing_migration_file :blip}.should raise_error

    root_dir.should have_migration :create_account do |migration_file|
      migration_file.should have_class_method :up
      migration_file.should have_comment 'hello'
      migration_file.should have_comment 'goodbye'
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
rails3_assist-0.2.4 spec/rails3_assist/artifact/migration/migration_spec.rb
rails3_assist-0.2.3 spec/rails3_assist/artifact/migration/migration_spec.rb