Sha256: 9297b2b872c275b610ce65714e3a8605b6161da85615aebd9d91c5428a739b77

Contents?: true

Size: 814 Bytes

Versions: 3

Compression:

Stored size: 814 Bytes

Contents

require 'spec_helper'

require 'generators/rom/mapper_generator'

describe ROM::Generators::MapperGenerator do
  destination File.expand_path('../../../../tmp', __FILE__)

  before(:all) do
    prepare_destination
    run_generator ['users']
  end

  specify do
    expect(destination_root).to have_structure {
      directory 'app' do
        directory 'mappers' do
          file 'user_mapper.rb' do
            contains <<-CONTENT.strip_heredoc
              class UserMapper < ROM::Mapper
                relation :users
              
                # specify model and attributes ie
                #
                # model User
                #
                # attribute :name
                # attribute :email
              end
            CONTENT
          end
        end
      end
    }
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
rom-rails-0.3.1 spec/lib/generators/mapper_generator_spec.rb
rom-rails-0.3.0 spec/lib/generators/mapper_generator_spec.rb
rom-rails-0.3.0.rc1 spec/lib/generators/mapper_generator_spec.rb