Sha256: 639c6c0f56e1c4b3426534501e939f89508caff0008dbf3f200628a5a47c84d0

Contents?: true

Size: 962 Bytes

Versions: 8

Compression:

Stored size: 962 Bytes

Contents

require 'spec_helper'
require 'systemu'

# FIXME this test might break the others if run before them
# started fixing @nbit001
describe Impressionist, :migration do
  fixtures :articles,:impressions,:posts,:profiles
  it "should delete existing migration and generate the migration file" do
    pending
    migrations_dir = "#{Rails.root}/db/migrate"
    impressions_migration = Dir.entries(migrations_dir).grep(/impressions/)[0]
    File.delete("#{migrations_dir}/#{impressions_migration}") unless impressions_migration.blank?
    generator_output = systemu("rails g impressionist")[1]
    migration_name = generator_output.split("migrate/")[1].strip
    Dir.entries(migrations_dir).include?(migration_name).should be_true
  end

  it "should run the migration created in the previous spec" do
    pending
    migrate_output = systemu("rake db:migrate RAILS_ENV=test")
    migrate_output[1].include?("CreateImpressionsTable: migrated").should be_true
  end
end

Version data entries

8 entries across 8 versions & 2 rubygems

Version Path
impressionist-2.0.0 tests/test_app/spec/rails_generators/rails_generators_spec.rb
impressionist-1.6.1 tests/test_app/spec/rails_generators/rails_generators_spec.rb
impressionist-1.6.0 tests/test_app/spec/rails_generators/rails_generators_spec.rb
impressionist-1.5.2 tests/test_app/spec/rails_generators/rails_generators_spec.rb
impressionist2-1.5.5 tests/test_app/spec/rails_generators/rails_generators_spec.rb
impressionist2-1.5.4 tests/test_app/spec/rails_generators/rails_generators_spec.rb
impressionist2-1.5.3 tests/test_app/spec/rails_generators/rails_generators_spec.rb
impressionist2-1.5.1 tests/test_app/spec/rails_generators/rails_generators_spec.rb