Sha256: f6166b3fa7fed3b2c26e9ae6d235f01b4b6dab178b7dbdf48bd9b0cc80b85497
Contents?: true
Size: 1.62 KB
Versions: 1
Compression:
Stored size: 1.62 KB
Contents
# frozen_string_literal: true require 'test_helper' require 'rails/generators/test_case' require 'generators/upgrow/record/record_generator' module Upgrow module Generators class RecordGeneratorTest < Rails::Generators::TestCase tests RecordGenerator destination File.expand_path('tmp') setup :prepare_destination test 'generate Record file' do run_generator(['article']) assert_file 'app/records/article_record.rb', <<~RUBY # frozen_string_literal: true class ArticleRecord < ApplicationRecord end RUBY end test 'generate Record when suffix is specified' do run_generator(['ArticleRecord']) assert_file 'app/records/article_record.rb', <<~RUBY # frozen_string_literal: true class ArticleRecord < ApplicationRecord end RUBY end test 'generate namespaced Record file' do run_generator(['articles/article']) assert_file 'app/records/articles/article_record.rb', <<~RUBY # frozen_string_literal: true module Articles class ArticleRecord < ApplicationRecord end end RUBY end test 'generate namespaced Record file with many layers' do run_generator(['users/articles/article']) assert_file 'app/records/users/articles/article_record.rb', <<~RUBY # frozen_string_literal: true module Users module Articles class ArticleRecord < ApplicationRecord end end end RUBY end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
upgrow-0.0.5 | test/upgrow/generators/record_generator_test.rb |