Sha256: 5d09208dfe059b743f87b74f47c7ddd5bacea5653dcadaf4cfb27433138aa1eb

Contents?: true

Size: 901 Bytes

Versions: 5

Compression:

Stored size: 901 Bytes

Contents

require 'test_helper'
require 'rails/generators'
require 'generators/i18n_admin_utils/install_generator'


class InstallGeneratorTest < Rails::Generators::TestCase
  tests I18nAdminUtils::InstallGenerator
  destination File.expand_path('../../tmp', __FILE__)

  setup do
    prepare_destination
    copy_routes
  end

  def copy_routes
    routes = File.expand_path('../../dummy/config/routes.rb', __FILE__)
    destination = File.join(destination_root, 'config')

    FileUtils.mkdir_p(destination)
    FileUtils.cp routes, destination
  end

  test 'Assert routes were properly created' do
    run_generator
    match = /mount I18nAdminUtils::Engine => '\/', as: 'i18n_admin_utils'/
    assert_file 'config/routes.rb', match
  end

  test 'Assert all files are properly created' do
    run_generator
    assert_file 'config/initializers/i18n_admin_utils.rb'
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
i18n_admin_utils-1.1.0 test/generators/install_generator_test.rb
i18n_admin_utils-1.0.0 test/generators/install_generator_test.rb
i18n_admin_utils-0.0.4 test/generators/install_generator_test.rb
i18n_admin_utils-0.0.3 test/generators/install_generator_test.rb
i18n_admin_utils-0.0.2 test/generators/install_generator_test.rb