nil object error during integration test.

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
 
B

Brian Candler

can anyone tell me about this error and solution.

It seems that somewhere in your code you are doing something.downcase,
and at that point something is nil:
<"You have a nil object when you didn't expect it!\nThe error occurred
while evaluating nil.downcase">

However, Rails questions are best directed to a Rails forum or mailing
list.

Regards,

Brian.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,066
Latest member
VytoKetoReviews

Latest Threads

Top