Sha256: f87472c30cf2fef06bdcf3cf477305a6f209563e3c621072c4bbcc408ba5b7ec

Contents?: true

Size: 933 Bytes

Versions: 3

Compression:

Stored size: 933 Bytes

Contents

require 'spec_helper'

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

describe TestUnit::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 'test/decorators/application_decorator_test.rb' do
      subject { file('test/decorators/application_decorator_test.rb') }
      it { should exist }
      it { should contain "class ApplicationDecoratorTest < ActiveSupport::TestCase" }
    end

    describe 'test/decorators/products_decorator_test.rb' do
      subject { file('test/decorators/products_decorator_test.rb') }
      it { should exist }
      it { should contain "class ProductsDecoratorTest < ActiveSupport::TestCase" }
    end

  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
draper-0.9.5 spec/generators/test_unit/decorator_generator_spec.rb
draper-0.9.3 spec/generators/test_unit/decorator_generator_spec.rb
draper-0.9.2 spec/generators/test_unit/decorator_generator_spec.rb