Sha256: 7f9b8b902653263b426f6b5d506f740c50c7573d664e5229350504eb9e016a59

Contents?: true

Size: 897 Bytes

Versions: 2

Compression:

Stored size: 897 Bytes

Contents

require "spec_helper" 

require "generators/angular_velocity/controller/controller_generator"

describe AngularVelocity::Generators::ControllerGenerator do

  include GeneratorSpec::TestCase
  include GenSpecHelpers 
  include AngularVelocity::Generators::AngularConfig
  
  destination File.expand_path("../../tmp", __FILE__)

  before(:each) do 
    prepare_destination
    run_generator ["post"] 
  end
  

  it "should generate a controller" do
    ("#{angular_path}/controllers/post_controller.coffee").should be_a_file_containing_text(%{angular.module('AngularVelocityApp').controller( 'PostCtrl', [ '$scope', PostController ])})
  end

  it "should generate a post controller spec" do
    controller_spec_path = "#{angular_spec_path}/controllers/post_controller_spec.coffee" 
    controller_spec_path.should be_a_file_containing_text(%{describe "Controller: PostCtrl", () ->})
  end

  
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
angular_velocity-1.0.0 spec/controller/controller_generator_spec.rb
angular_velocity-0.0.6alpha spec/controller/controller_generator_spec.rb