summaryrefslogtreecommitdiff
path: root/test/controllers/remote_usernames_controller_test.rb
blob: ff6a91d62e403d0563da3a2b4408caf0402de048 (plain)
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
require 'test_helper'

class RemoteUsernamesControllerTest < ActionController::TestCase
  setup do
    @remote_username = remote_usernames(:one)
  end

  test "should get index" do
    get :index
    assert_response :success
    assert_not_nil assigns(:remote_usernames)
  end

  test "should get new" do
    get :new
    assert_response :success
  end

  test "should create remote_username" do
    assert_difference('RemoteUsername.count') do
      post :create, remote_username: { game_id: @remote_username.game_id, user_id: @remote_username.user_id, user_name: @remote_username.user_name }
    end

    assert_redirected_to remote_username_path(assigns(:remote_username))
  end

  test "should show remote_username" do
    get :show, id: @remote_username
    assert_response :success
  end

  test "should get edit" do
    get :edit, id: @remote_username
    assert_response :success
  end

  test "should update remote_username" do
    patch :update, id: @remote_username, remote_username: { game_id: @remote_username.game_id, user_id: @remote_username.user_id, user_name: @remote_username.user_name }
    assert_redirected_to remote_username_path(assigns(:remote_username))
  end

  test "should destroy remote_username" do
    assert_difference('RemoteUsername.count', -1) do
      delete :destroy, id: @remote_username
    end

    assert_redirected_to remote_usernames_path
  end
end