Sha256: 2dcfd2373b499a42b102bfca2491cc35a474a18df41d2ca5fa51692bc625886c

Contents?: true

Size: 895 Bytes

Versions: 7

Compression:

Stored size: 895 Bytes

Contents

require 'spec_helper'

# Generators are not automatically loaded by Rails
require 'generators/draper/decorator/decorator_generator'

describe Draper::DecoratorGenerator do
  # Tell the generator where to put its output (what it thinks of as Rails.root)
  destination File.expand_path("../../../../../tmp", __FILE__)

  before { prepare_destination }

  describe 'no arguments' do
    before { run_generator %w(products)  }

    describe 'app/decorators/application_decorator.rb' do
      subject { file('app/decorators/application_decorator.rb') }
      it { should exist }
      it { should contain "class ApplicationDecorator < Draper::Base" }
    end

    describe 'app/decorators/products_decorator.rb' do
      subject { file('app/decorators/products_decorator.rb') }
      it { should exist }
      it { should contain "class ProductsDecorator < ApplicationDecorator" }
    end

  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
draper-0.9.5 spec/generators/draper/decorator/decorator_generator_spec.rb
draper-0.9.3 spec/generators/draper/decorator/decorator_generator_spec.rb
draper-0.9.2 spec/generators/draper/decorator/decorator_generator_spec.rb
draper-0.9.1 spec/generators/draper/decorator/decorator_generator_spec.rb
draper-0.9.0 spec/generators/draper/decorator/decorator_generator_spec.rb
draper-0.8.1 spec/generators/draper/decorator/decorator_generator_spec.rb
draper-0.8.0 spec/generators/draper/decorator/decorator_generator_spec.rb