Sha256: 8e1b59a3fc37a3a75ddd5144e5bd1a06e00c360f0b44f75c77f85b31a871f975

Contents?: true

Size: 601 Bytes

Versions: 5

Compression:

Stored size: 601 Bytes

Contents

# frozen_string_literal: true

RSpec.describe 'ActiveRecord Schema', :integration do
  let(:connection) { ActiveRecord::Base.connection }
  let(:stream)     { StringIO.new }

  subject do
    ActiveRecord::SchemaDumper.dump(connection, stream)
    stream.rewind
    stream.read.split("\n").map { |line| line.gsub(/\s+/, ' ').strip }
  end

  it 'includes `create_enum` statements' do
    expect(subject).to include('create_enum :shirt_size, ["small", "medium", "large"]')
  end

  it 'includes `t.enum` statements' do
    expect(subject).to include('t.enum "size", enum_type: "shirt_size"')
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
enum_kit-0.3.1 spec/active_record/schema_spec.rb
enum_kit-0.3.0 spec/active_record/schema_spec.rb
enum_kit-0.2.3 spec/active_record/schema_spec.rb
enum_kit-0.2.2 spec/active_record/schema_spec.rb
enum_kit-0.2.1 spec/active_record/schema_spec.rb