Sha256: 63e8bebca99721361d7394fddeb8867e3bc14f228709e71f7481506c0e269568

Contents?: true

Size: 992 Bytes

Versions: 1

Compression:

Stored size: 992 Bytes

Contents

require 'test_helper'
require 'generators/rails/concept_generator'

class ConceptGeneratorTest < Rails::Generators::TestCase
  destination File.join(Rails.root, "tmp")
  setup :prepare_destination
  tests ::Rails::Generators::ConceptGenerator

  test "[erb] standard assets, show view" do
    run_generator %w(Song)

    assert_file "app/concepts/song/cell.rb", /class Song::Cell < Cell::Rails/
    assert_file "app/concepts/song/cell.rb", /include Concept/
    assert_file "app/concepts/song/cell.rb", /def show/
    assert_file "app/concepts/song/views/show.erb", %r(app/concepts/song/views/show\.erb)
  end

  test "[haml] standard assets, show view" do
    run_generator %w(Song -e haml)

    assert_file "app/concepts/song/cell.rb", /class Song::Cell < Cell::Rails/
    assert_file "app/concepts/song/cell.rb", /include Concept/
    assert_file "app/concepts/song/cell.rb", /def show/
    assert_file "app/concepts/song/views/show.haml", %r(app/concepts/song/views/show\.haml)
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
cells-3.11.0 test/concept_generator_test.rb