require 'spec_helper' require_generator :controller describe 'helper_generator' do use_helper :controller before :each do setup_generator 'controller_generator' do tests ControllerGenerator end remove_controller :account end after :each do # remove_controller :account end it "should not work without an Account controller file" do remove_controller :account with_generator do |g| g.run_generator :account.args g.should_not generate_controller :account end end it "should decorate an existing Account controller file with a 'control_me' method" do with_generator do |g| create_controller :account do '# controller content' end g.run_generator :account.args g.should generate_controller :account do |content| content.should have_method :control_me end end end end