GeoRSS aggregator and Layar augmented reality server
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.
 
 
 
 
 

50 lignes
1.1 KiB

  1. require 'test_helper'
  2. class UsersControllerTest < ActionController::TestCase
  3. setup do
  4. @user = users(:one)
  5. end
  6. test "should get index" do
  7. get :index
  8. assert_response :success
  9. assert_not_nil assigns(:users)
  10. end
  11. test "should get new" do
  12. get :new
  13. assert_response :success
  14. end
  15. test "should create user" do
  16. assert_difference('User.count') do
  17. post :create, user: { crypted_password: @user.crypted_password, email: @user.email, salt: @user.salt }
  18. end
  19. assert_redirected_to user_path(assigns(:user))
  20. end
  21. test "should show user" do
  22. get :show, id: @user
  23. assert_response :success
  24. end
  25. test "should get edit" do
  26. get :edit, id: @user
  27. assert_response :success
  28. end
  29. test "should update user" do
  30. put :update, id: @user, user: { crypted_password: @user.crypted_password, email: @user.email, salt: @user.salt }
  31. assert_redirected_to user_path(assigns(:user))
  32. end
  33. test "should destroy user" do
  34. assert_difference('User.count', -1) do
  35. delete :destroy, id: @user
  36. end
  37. assert_redirected_to users_path
  38. end
  39. end