Skip to content

Instantly share code, notes, and snippets.

@mrichman
Created November 8, 2009 18:03
Show Gist options
  • Select an option

  • Save mrichman/229408 to your computer and use it in GitHub Desktop.

Select an option

Save mrichman/229408 to your computer and use it in GitHub Desktop.
1) Error:
test_should_create_user(UsersControllerTest):
NoMethodError: undefined method `symbolize_keys' for #<User:0x102c266d8>
/test/functional/users_controller_test.rb:11:in `test_should_create_user'
/test/functional/users_controller_test.rb:10:in `test_should_create_user'
## /test/functional/users_controller_test.rb:11
post :create, users(:testuser)
testuser:
login: testuser
first_name: Test
last_name: User
email: [email protected]
address1: 123 Main St.
city: Anytown
state: XY
postal_code: 12345
country: United States
password_salt: <%= salt = Authlogic::Random.hex_token %>
crypted_password: <%= Authlogic::CryptoProviders::Sha512.encrypt("testuser" + salt) %>
persistence_token: 6cde0674657a8a313ce952df979de2830309aa4c11ca65805dd00bfdc65dbcc2f5e36718660a1d2e68c1a08c276d996763985d2f06fd3d076eb7bc4d97b1e317
#password: admin
#password_confirmation: admin
mail_notification: true
language: en
status: 1
require 'test_helper'
class UsersControllerTest < ActionController::TestCase
test "should get new" do
get :new
assert_response :success
end
test "should create user" do
assert_difference('User.count') do
post :create, users(:testuser)
end
assert_redirected_to account_path
end
test "should show user" do
UserSession.create(users(:testuser))
get :show
assert_response :success
end
test "should get edit" do
UserSession.create(users(:testuser))
get :edit, :id => users(:testuser).id
assert_response :success
end
test "should update user" do
UserSession.create(users(:testuser))
put :update, :id => users(:testuser).id, :user => { }
assert_redirected_to account_path
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment