Sha256: 253be00b6b7b6ce23f726b9392c67f4f7842ef56f2be6a870a2261cad0b996ee
Contents?: true
Size: 698 Bytes
Versions: 7
Compression:
Stored size: 698 Bytes
Contents
require 'test_helper' # require 'active_model/serializer/railtie' class ResourceGeneratorTest < Rails::Generators::TestCase destination File.expand_path('../../../tmp/generators', __FILE__) setup :prepare_destination, :copy_routes tests Rails::Generators::ResourceGenerator arguments %w(account) def test_serializer_file_is_generated run_generator assert_file 'app/serializers/account_serializer.rb', /class AccountSerializer < ActiveModel::Serializer/ end private def copy_routes config_dir = File.join(destination_root, 'config') FileUtils.mkdir_p(config_dir) File.write(File.join(config_dir, 'routes.rb'), 'Rails.application.routes.draw { }') end end
Version data entries
7 entries across 7 versions & 2 rubygems