V
Vikas Gholap
hello all,
I have a simple test case that load home page.
When I run test i got following error.
test_load_site_with_out_errors(UserScenariosTest)
[test/integration/user_scenarios_test.rb:18:in `get_home_page'
test/integration/user_scenarios_test.rb:7:in
`test_load_site_with_out_error
s'
F:/Aflatune_Community_Engine/aflatune/vendor/rails/activesupport/lib/active
_support/testing/setup_and_teardown.rb:60:in `__send__'
F:/Aflatune_Community_Engine/aflatune/vendor/rails/activesupport/lib/active
_support/testing/setup_and_teardown.rb:60:in `run'
F:/Aflatune_Community_Engine/aflatune/vendor/rails/actionpack/lib/action_co
ntroller/integration.rb:597:in `run']:
Expected response to be a <:success>, but was <500>
<"You have a nil object when you didn't expect it!\nThe error occurred
while eva
luating nil.downcase">
2 tests, 1 assertions, 1 failures, 0 errors
--------------------------------------------------------------------------------
user_scenarios_test.rb
require "#{File.dirname(__FILE__)}/../test_helper"
class UserScenariosTest < ActionController::IntegrationTest
fixtures :users
# Load home page with out error
def test_load_site_with_out_errors
get_home_page
end
private
def get_home_page
get "/home/index"
assert_response :success
assert_template "index"
end
end
I have a simple test case that load home page.
When I run test i got following error.
test_load_site_with_out_errors(UserScenariosTest)
[test/integration/user_scenarios_test.rb:18:in `get_home_page'
test/integration/user_scenarios_test.rb:7:in
`test_load_site_with_out_error
s'
F:/Aflatune_Community_Engine/aflatune/vendor/rails/activesupport/lib/active
_support/testing/setup_and_teardown.rb:60:in `__send__'
F:/Aflatune_Community_Engine/aflatune/vendor/rails/activesupport/lib/active
_support/testing/setup_and_teardown.rb:60:in `run'
F:/Aflatune_Community_Engine/aflatune/vendor/rails/actionpack/lib/action_co
ntroller/integration.rb:597:in `run']:
Expected response to be a <:success>, but was <500>
<"You have a nil object when you didn't expect it!\nThe error occurred
while eva
luating nil.downcase">
2 tests, 1 assertions, 1 failures, 0 errors
--------------------------------------------------------------------------------
user_scenarios_test.rb
require "#{File.dirname(__FILE__)}/../test_helper"
class UserScenariosTest < ActionController::IntegrationTest
fixtures :users
# Load home page with out error
def test_load_site_with_out_errors
get_home_page
end
private
def get_home_page
get "/home/index"
assert_response :success
assert_template "index"
end
end