Sha256: 0a823a0f1a909e5ffbb0109e0d4ba24cd2fe7a2b666fb03629217cc5265d1005
Contents?: true
Size: 1.59 KB
Versions: 4
Compression:
Stored size: 1.59 KB
Contents
require 'test_helper' require 'rails/generators/test_case' require 'rails/generators/cell/cell_generator' class CellGeneratorTest < Rails::Generators::TestCase tests Rails::Generators::CellGenerator destination File.expand_path('../../tmp', File.dirname(__FILE__)) setup :prepare_destination test 'create the standard assets' do run_generator %w(blog post latest) assert_file 'app/cells/blog_cell.rb', /class BlogCell < Cell::ViewModel/ assert_file 'app/cells/blog_cell.rb', /def post/ assert_file 'app/cells/blog_cell.rb', /def latest/ assert_file 'app/cells/blog/post.haml', %r{app/cells/blog/post\.haml} assert_file 'app/cells/blog/post.haml', %r{<p>} assert_file 'app/cells/blog/latest.haml', %r{app/cells/blog/latest\.haml} end test 'create cell that inherits from custom cell class if specified' do run_generator %w(Blog --parent=ApplicationCell) assert_file 'app/cells/blog_cell.rb', /class BlogCell < ApplicationCell/ end test 'work with namespaces' do run_generator %w(blog/post latest) assert_file 'app/cells/blog/post_cell.rb', /class Blog::PostCell < Cell::ViewModel/ assert_file 'app/cells/blog/post_cell.rb', /def show/ assert_file 'app/cells/blog/post_cell.rb', /def latest/ assert_file 'app/cells/blog/post/latest.haml', %r{app/cells/blog/post/latest\.haml} end test 'work with namespaces and haml' do run_generator %w(blog/post latest) assert_file 'app/cells/blog/post_cell.rb', /class Blog::PostCell < Cell::ViewModel/ assert_file 'app/cells/blog/post/latest.haml', %r{app/cells/blog/post/latest\.haml} end end
Version data entries
4 entries across 4 versions & 1 rubygems
Version | Path |
---|---|
cells-haml-0.0.4 | test/cell_generator_test.rb |
cells-haml-0.0.3 | test/cell_generator_test.rb |
cells-haml-0.0.2 | test/cell_generator_test.rb |
cells-haml-0.0.1 | test/cell_generator_test.rb |