Sha256: e7f5fe582a466e923d369ccef7aa20f6fbfa25dbd44b3cc172472d52eb1627a1
Contents?: true
Size: 1.54 KB
Versions: 7
Compression:
Stored size: 1.54 KB
Contents
require_relative "../test_helper" require_relative "../../lib/generators/comfy/scaffold/scaffold_generator" class ScaffoldGeneratorTest < Rails::Generators::TestCase tests Comfy::Generators::ScaffoldGenerator def test_generator run_generator %w[Foo bar:string] assert_migration "db/migrate/create_foos.rb", read_file("scaffold/migration.rb") assert_file "app/models/foo.rb", read_file("scaffold/model.rb") assert_file "test/models/foo_test.rb", read_file("scaffold/tests/model.rb") assert_file "test/fixtures/foos.yml", read_file("scaffold/tests/fixture") assert_file "app/controllers/admin/foos_controller.rb", read_file("scaffold/controller.rb") assert_file "test/controllers/admin/foos_controller_test.rb", read_file("scaffold/tests/controller.rb") assert_file "app/views/admin/foos/index.html.haml", read_file("scaffold/views/index.haml") assert_file "app/views/admin/foos/show.html.haml", read_file("scaffold/views/show.haml") assert_file "app/views/admin/foos/new.html.haml", read_file("scaffold/views/new.haml") assert_file "app/views/admin/foos/edit.html.haml", read_file("scaffold/views/edit.haml") assert_file "app/views/admin/foos/_form.html.haml", read_file("scaffold/views/_form.haml") assert_file "config/routes.rb", read_file("scaffold/routes.rb") assert_file "app/views/comfy/admin/cms/partials/_navigation_inner.html.haml" do |file| assert_match "%li.nav-item\n = active_link_to 'Foos', admin_foos_path, class: 'nav-link'", file end end end
Version data entries
7 entries across 7 versions & 1 rubygems