Sha256: 3cab05802131a27c1de3a990ba4771a928f2acec4c1af2d36f9e1650f56cfd4f

Contents?: true

Size: 870 Bytes

Versions: 3

Compression:

Stored size: 870 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::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::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

3 entries across 3 versions & 1 rubygems

Version Path
cells-3.11.3 test/concept_generator_test.rb
cells-3.11.2 test/concept_generator_test.rb
cells-3.11.1 test/concept_generator_test.rb