Sha256: 6da804c072ef75514d71ee8a8774a9c0f02ab24d2d48ca0bb68d41335162e806

Contents?: true

Size: 690 Bytes

Versions: 7

Compression:

Stored size: 690 Bytes

Contents

describe ConfigScripts::MigrationsGenerator, type: :generator do
  destination File.expand_path("../../../tmp", __FILE__)

  describe "create_migrations" do
    before do
      prepare_destination
      run_generator
    end

    it "creates a migration for adding the config scripts table" do
      assert_file "db/migrate/#{Time.now.to_s(:number)}_create_config_scripts.rb", /create_table :config_scripts/
    end

    context "when running repeatedly" do
      it "says that it has skipped it" do
        output = capture :stderr do
          run_generator
        end
        expect(output).to be =~ /Another migration is already named create_config_scripts/
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
config_scripts-0.4.7 spec/generators/migrations_spec.rb
config_scripts-0.4.6 spec/generators/migrations_spec.rb
config_scripts-0.4.5 spec/generators/migrations_spec.rb
config_scripts-0.4.4 spec/generators/migrations_spec.rb
config_scripts-0.4.3 spec/generators/migrations_spec.rb
config_scripts-0.4.2 spec/generators/migrations_spec.rb
config_scripts-0.4.1 spec/generators/migrations_spec.rb