Skip to content

Instantly share code, notes, and snippets.

@jamesbrink
Created March 6, 2011 05:34
Show Gist options
  • Save jamesbrink/857057 to your computer and use it in GitHub Desktop.
Save jamesbrink/857057 to your computer and use it in GitHub Desktop.
require 'test_helper'
class PatientsControllerTest < ActionController::TestCase
setup do
@patient = patients(:one)
end
test "actions without user" do
PatientsController.action_methods.each do |action|
get action
assert_redirected_to :login
end
end
end
james$ ruby -I test test/functional/patients_controller_test.rb
DEPRECATION WARNING: reorder is deprecated. Please use except(:order).order(...) instead. (called from <top (required)> at /Users/james/Desktop/AuXilium/RailsApps/CloudMD/config/application.rb:7)
Loaded suite test/functional/patients_controller_test
Started
E
Finished in 0.086666 seconds.
1) Error:
test_actions_without_user(PatientsControllerTest):
RuntimeError: can't modify frozen string
/Users/james/.rvm/gems/ruby-1.9.2-p136/gems/actionpack-3.0.4/lib/action_dispatch/http/parameters.rb:47:in `force_encoding'
/Users/james/.rvm/gems/ruby-1.9.2-p136/gems/actionpack-3.0.4/lib/action_dispatch/http/parameters.rb:47:in `encode_params'
/Users/james/.rvm/gems/ruby-1.9.2-p136/gems/actionpack-3.0.4/lib/action_dispatch/http/parameters.rb:59:in `block in encode_params'
/Users/james/.rvm/gems/ruby-1.9.2-p136/gems/actionpack-3.0.4/lib/action_dispatch/http/parameters.rb:52:in `each'
/Users/james/.rvm/gems/ruby-1.9.2-p136/gems/actionpack-3.0.4/lib/action_dispatch/http/parameters.rb:52:in `encode_params'
/Users/james/.rvm/gems/ruby-1.9.2-p136/gems/actionpack-3.0.4/lib/action_dispatch/http/parameters.rb:12:in `parameters'
/Users/james/.rvm/gems/ruby-1.9.2-p136/gems/actionpack-3.0.4/lib/action_controller/metal.rb:88:in `params'
/Users/james/.rvm/gems/ruby-1.9.2-p136/gems/actionpack-3.0.4/lib/action_controller/test_case.rb:409: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/patients_controller_test.rb:10:in `block (2 levels) in <class:PatientsControllerTest>'
1 tests, 0 assertions, 0 failures, 1 errors, 0 skips
Test run options: --seed 15080
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment