Sha256: 5f57344a182657aa422ff48a1b087342582531dfa04ed6e4921d358a06e48fae

Contents?: true

Size: 1.18 KB

Versions: 6

Compression:

Stored size: 1.18 KB

Contents

require 'test_helper'

module Wafflemix
  class UsersControllerTest < ActionController::TestCase
    setup do
      @user = users(:one)
    end
  
    test "should get index" do
      get :index
      assert_response :success
      assert_not_nil assigns(:users)
    end
  
    test "should get new" do
      get :new
      assert_response :success
    end
  
    test "should create user" do
      assert_difference('User.count') do
        post :create, user: { email: @user.email, password: @user.password, username: @user.username }
      end
  
      assert_redirected_to user_path(assigns(:user))
    end
  
    test "should show user" do
      get :show, id: @user
      assert_response :success
    end
  
    test "should get edit" do
      get :edit, id: @user
      assert_response :success
    end
  
    test "should update user" do
      put :update, id: @user, user: { email: @user.email, password: @user.password, username: @user.username }
      assert_redirected_to user_path(assigns(:user))
    end
  
    test "should destroy user" do
      assert_difference('User.count', -1) do
        delete :destroy, id: @user
      end
  
      assert_redirected_to users_path
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
wafflemix-0.0.6 test/functional/wafflemix/users_controller_test.rb
wafflemix-0.0.5 test/functional/wafflemix/users_controller_test.rb
wafflemix-0.0.4 test/functional/wafflemix/users_controller_test.rb
wafflemix-0.0.3 test/functional/wafflemix/users_controller_test.rb
wafflemix-0.0.2 test/functional/wafflemix/users_controller_test.rb
wafflemix-0.0.1 test/functional/wafflemix/users_controller_test.rb