mrichman (owner)

Revisions

gist: 229408 Download_button fork
public
Public Clone URL: git://gist.github.com/229408.git
Embed All Files: show embed
users.yml #
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
testuser:
  login: testuser
  first_name: Test
  last_name: User
  email: testuser@example.com
  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
 
users_controller_test.rb #
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
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
 
Text only #
1
2
3
4
5
6
7
8
9
10
  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)