Sha256: ec6c8e7970e1456a0cce24acb5054871f2ab96265ce88c4f183aa8d98610f88d
Contents?: true
Size: 1.69 KB
Versions: 11
Compression:
Stored size: 1.69 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 skip("need to be implemented") 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 skip("need to be implemented") 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 skip("need to be implemented") 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
11 entries across 11 versions & 3 rubygems