Sha256: ecd8711a8c2f895436193aa416a4a813fc6528837992c8b23a891b4b742ed207

Contents?: true

Size: 875 Bytes

Versions: 5

Compression:

Stored size: 875 Bytes

Contents

require 'spec_helper'

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

describe Rspec::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 'spec/decorators/application_decorator_spec.rb' do
      subject { file('spec/decorators/application_decorator_spec.rb') }
      it { should exist }
      it { should contain "describe ApplicationDecorator do" }
    end

    describe 'spec/decorators/products_decorator_spec.rb' do
      subject { file('spec/decorators/products_decorator_spec.rb') }
      it { should exist }
      it { should contain "describe ProductsDecorator" }
    end

  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
draper-0.9.5 spec/generators/rspec/decorator_generator_spec.rb
draper-0.9.3 spec/generators/rspec/decorator_generator_spec.rb
draper-0.9.2 spec/generators/rspec/decorator_generator_spec.rb
draper-0.9.1 spec/generators/rspec/decorator_generator_spec.rb
draper-0.9.0 spec/generators/rspec/decorator_generator_spec.rb