ruby on rails - Failure/Error: response.should render_template(:new) expecting <"new"> but rendering with <""> -
posts_controller.rb class postscontroller < applicationcontroller respond_to :html, :xml, :json before_filter :authenticate_user!, :except => [:show, :index] before_filter :admin_only, :except => [:show, :index] def new @post = post.new end end spec_helper.rb # file copied spec/ when run 'rails generate rspec:install' env["rails_env"] ||= 'test' require file.expand_path("../../config/environment", __file__) require 'rspec/rails' require 'forgery' require 'populators' # requires supporting ruby files custom matchers , macros, etc, # in spec/support/ , subdirectories. dir[rails.root.join("spec/support/**/*.rb")].each {|f| require f} rspec.configure |config| config.mock_with :rspec # remove line if you're not using activerecord or activerecord fixtures config.fixture_path = "#{::rails.root}/test/fixtures" config.before(:suite) databasecleaner.strategy = :t