Advertisement
Guest User

Untitled

a guest
Jul 31st, 2017
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. def test_create
  2. num_admins = Admin.count
  3.  
  4. post :create, :admin => admins(:admin)
  5.  
  6. assert_response :redirect
  7. assert_redirected_to :action => 'list'
  8.  
  9. assert_equal num_admins 1, Admin.count
  10. end
  11.  
  12.  
  13. in the fixture there is:
  14.  
  15.  
  16. <% SALT = "saltyNut24ucr4cK3r" unless defined?(SALT) %>
  17. admin:
  18. id: 1
  19. username: admin
  20. password: <%= Admin.sha1(SALT, 'test123') %>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement