Project

General

Profile

« Previous | Next » 

Revision 6f0fc8f1

Added by Ohad Levy over 12 years ago

  • ID 6f0fc8f191f2fc3e19d8b595dbddc92ef0749890

fixes a couple of broken tests + show full error trace in development mode.

View differences:

app/controllers/application_controller.rb
class ApplicationController < ActionController::Base
protect_from_forgery # See ActionController::RequestForgeryProtection for details
rescue_from ScopedSearch::QueryNotSupported, :with => :invalid_search_query
rescue_from Exception, :with => :generic_exception
rescue_from Exception, :with => :generic_exception if Rails.env.production?
rescue_from ActiveRecord::RecordNotFound, :with => :not_found
# standard layout to all controllers
test/functional/hosts_controller_test.rb
assert_response :ok
end
test "externalNodes should render 404 when no params are given" do
User.current = nil
get :externalNodes, {}, set_session_user
assert_response :missing
assert_template 'common/404'
end
test "externalNodes should render correctly when format text/html is given" do
get :externalNodes, {:name => @host.name}, set_session_user
get :externalNodes, {:name => @host.name}
assert_response :success
assert_template :text => @host.info.to_yaml.gsub("\n","<br/>")
end
......
setup_user_and_host "Edit"
as_admin do
@one.domains = [domains(:mydomain)]
@host1.domain = domains(:mydomain)
@host2.domain = domains(:yourdomain)
@host1.update_attribute(:domain, domains(:mydomain))
@host2.update_attribute(:domain, domains(:yourdomain))
end
get :index, {}, set_session_user.merge(:user => @one.id)
assert_response :success

Also available in: Unified diff