Skip to content

Instantly share code, notes, and snippets.

@jamesbrink
Created March 6, 2011 10:18
Show Gist options
  • Save jamesbrink/857181 to your computer and use it in GitHub Desktop.
Save jamesbrink/857181 to your computer and use it in GitHub Desktop.
require 'test_helper'
class AddressesControllerTest < ActionController::TestCase
setup do
@address = addresses(:of_patient)
@patient = patients(:one)
activate_authlogic
end
test "patient addresses index without user" do
get :index,patient_addresses_path(:patient_id=>1)
assert_redirected_to :login
end
end
1) Error:
test_patient_addresses_index_without_user(AddressesControllerTest):
NoMethodError: undefined method `symbolize_keys' for "/patients/1/addresses":String
/Users/james/.rvm/gems/ruby-1.9.2-p136/gems/actionpack-3.0.4/lib/action_controller/test_case.rb:142:in `assign_parameters'
/Users/james/.rvm/gems/ruby-1.9.2-p136/gems/actionpack-3.0.4/lib/action_controller/test_case.rb:402:in `process'
/Users/james/.rvm/gems/ruby-1.9.2-p136/gems/actionpack-3.0.4/lib/action_controller/test_case.rb:47:in `process'
/Users/james/.rvm/gems/ruby-1.9.2-p136/gems/actionpack-3.0.4/lib/action_controller/test_case.rb:350:in `get'
test/functional/addresses_controller_test.rb:11:in `block in <class:AddressesControllerTest>'
1 tests, 0 assertions, 0 failures, 1 errors, 0 skips
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment