Sha256: 74a1f829633abc57f204327335a8ee55eb0684307a2c1f943c188a011e749945

Contents?: true

Size: 1.27 KB

Versions: 11

Compression:

Stored size: 1.27 KB

Contents

require 'spec_helper'

# Rails3::Migration::Assist.orm = :active_record

describe 'migration' do 
  # use_orm :active_record
  use_helpers :app, :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
    existing_migration_file_name = existing_file_name :create_account, :migration
    FileUtils.mv existing_migration_file_name, existing_migration_file_name.gsub(/\d+_/, '001_')

    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

    root_dir.should have_migration :create_account

    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

11 entries across 11 versions & 1 rubygems

Version Path
rails-app-spec-0.5.0 spec/rails_app_spec/matchers/artifact/migration/migration_simple_number_spec.rb
rails-app-spec-0.4.0 spec/rails_app_spec/matchers/artifact/migration/migration_simple_number_spec.rb
rails-app-spec-0.3.3 spec/rails_app_spec/matchers/artifact/migration/migration_simple_number_spec.rb
rails-app-spec-0.3.2 spec/rails_app_spec/matchers/artifact/migration/migration_simple_number_spec.rb
rails-app-spec-0.3.1 spec/rails_app_spec/matchers/artifact/migration/migration_simple_number_spec.rb
rails-app-spec-0.3.0 spec/rails_app_spec/matchers/artifact/migration/migration_simple_number_spec.rb
rails-app-spec-0.2.16 spec/rails_app_spec/matchers/artifact/migration/migration_simple_number_spec.rb
rails-app-spec-0.2.15 spec/rails_app_spec/matchers/artifact/migration/migration_simple_number_spec.rb
rails-app-spec-0.2.14 spec/rails_app_spec/matchers/artifact/migration/migration_simple_number_spec.rb
rails-app-spec-0.2.13 spec/rails_app_spec/matchers/artifact/migration/migration_simple_number_spec.rb
rails-app-spec-0.2.12 spec/rails_app_spec/matchers/artifact/migration/migration_simple_number_spec.rb