Sha256: 014d958758474ca056443b475026d3da8c1b18efe2f236cf4aeb9a793f75d0ff

Contents?: true

Size: 855 Bytes

Versions: 47

Compression:

Stored size: 855 Bytes

Contents

require 'test_helper'
require 'generators/generators_test_helper'
require "generators/angular/controller/controller_generator"

class ControllerGeneratorTest < Rails::Generators::TestCase
  include GeneratorsTestHelper
  tests Angular::Generators::ControllerGenerator
  
  test "simple controller" do
    run_generator %w(Post)
    assert_file "#{angular_path}/controllers/posts.coffee" do |controller|
      controller_class = Regexp.escape("class @PostsController")
      assert_match /#{controller_class}/, controller
    end
    
  end
  
  test "two word model is camelcased" do
    run_generator %w(BlogPost)
    
    assert_file "#{angular_path}/controllers/blog_posts.coffee" do |controller|
      controller_class = Regexp.escape("class @BlogPostsController")
      
      assert_match /#{controller_class}/, controller
    end
    
  end
  
end

Version data entries

47 entries across 47 versions & 2 rubygems

Version Path
angular-gem-1.3.8 test/generators/controller_generator_test.rb
angular-gem-1.3.7 test/generators/controller_generator_test.rb
angular-gem-1.3.6 test/generators/controller_generator_test.rb
angular-gem-1.3.5 test/generators/controller_generator_test.rb
angular-gem-1.3.4 test/generators/controller_generator_test.rb
angular-gem-1.3.2 test/generators/controller_generator_test.rb
angular-gem-1.3.1 test/generators/controller_generator_test.rb
angular-gem-1.3.0 test/generators/controller_generator_test.rb
angular-gem-1.2.26 test/generators/controller_generator_test.rb
angular-gem-1.2.25 test/generators/controller_generator_test.rb
angular-gem-1.2.24 test/generators/controller_generator_test.rb
angular-gem-1.2.23 test/generators/controller_generator_test.rb
angular-gem-1.2.22 test/generators/controller_generator_test.rb
angular-gem-1.2.21 test/generators/controller_generator_test.rb
angular-gem-1.2.20 test/generators/controller_generator_test.rb
angular-gem-1.2.19 test/generators/controller_generator_test.rb
angular-gem-1.2.18.1 test/generators/controller_generator_test.rb
angular-gem-1.2.18 test/generators/controller_generator_test.rb
angular-gem-1.2.16 test/generators/controller_generator_test.rb
angular-gem-1.2.15 test/generators/controller_generator_test.rb