summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAndrewMurrell <amurrel@purdue.edu>2014-04-02 14:53:10 -0400
committerAndrewMurrell <amurrel@purdue.edu>2014-04-02 14:53:10 -0400
commitf9a4ee4e998f5f113565a93802c041108e9a180d (patch)
tree453534c6ee9b38d921266f92ac02e7e740a7856c /test
parenta2de6b22a720671b796c88c694db905665fda142 (diff)
now ran generate without ger
Diffstat (limited to 'test')
-rw-r--r--test/controllers/remote_usernames_controller_test.rb49
-rw-r--r--test/controllers/tournaments_controller_test.rb4
-rw-r--r--test/fixtures/remote_usernames.yml4
-rw-r--r--test/fixtures/tournaments.yml10
-rw-r--r--test/helpers/remote_usernames_helper_test.rb4
5 files changed, 67 insertions, 4 deletions
diff --git a/test/controllers/remote_usernames_controller_test.rb b/test/controllers/remote_usernames_controller_test.rb
new file mode 100644
index 0000000..ff6a91d
--- /dev/null
+++ b/test/controllers/remote_usernames_controller_test.rb
@@ -0,0 +1,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
diff --git a/test/controllers/tournaments_controller_test.rb b/test/controllers/tournaments_controller_test.rb
index 0c1ff60..d5ab2af 100644
--- a/test/controllers/tournaments_controller_test.rb
+++ b/test/controllers/tournaments_controller_test.rb
@@ -18,7 +18,7 @@ class TournamentsControllerTest < ActionController::TestCase
test "should create tournament" do
assert_difference('Tournament.count') do
- post :create, tournament: { game_id: @tournament.game_id, name: @tournament.name, randomized_teams: @tournament.randomized_teams, status: @tournament.status }
+ post :create, tournament: { game_id: @tournament.game_id, max_players_per_team: @tournament.max_players_per_team, max_teams_per_match: @tournament.max_teams_per_match, min_players_per_team: @tournament.min_players_per_team, min_teams_per_match: @tournament.min_teams_per_match, name: @tournament.name, randomized_teams: @tournament.randomized_teams, set_rounds: @tournament.set_rounds, status: @tournament.status }
end
assert_redirected_to tournament_path(assigns(:tournament))
@@ -35,7 +35,7 @@ class TournamentsControllerTest < ActionController::TestCase
end
test "should update tournament" do
- patch :update, id: @tournament, tournament: { game_id: @tournament.game_id, name: @tournament.name, randomized_teams: @tournament.randomized_teams, status: @tournament.status }
+ patch :update, id: @tournament, tournament: { game_id: @tournament.game_id, max_players_per_team: @tournament.max_players_per_team, max_teams_per_match: @tournament.max_teams_per_match, min_players_per_team: @tournament.min_players_per_team, min_teams_per_match: @tournament.min_teams_per_match, name: @tournament.name, randomized_teams: @tournament.randomized_teams, set_rounds: @tournament.set_rounds, status: @tournament.status }
assert_redirected_to tournament_path(assigns(:tournament))
end
diff --git a/test/fixtures/remote_usernames.yml b/test/fixtures/remote_usernames.yml
index baa1714..0b3055a 100644
--- a/test/fixtures/remote_usernames.yml
+++ b/test/fixtures/remote_usernames.yml
@@ -3,9 +3,9 @@
one:
game_id:
user_id:
- json_value: MyText
+ user_name: MyString
two:
game_id:
user_id:
- json_value: MyText
+ user_name: MyString
diff --git a/test/fixtures/tournaments.yml b/test/fixtures/tournaments.yml
index d5a4366..89edc9f 100644
--- a/test/fixtures/tournaments.yml
+++ b/test/fixtures/tournaments.yml
@@ -4,10 +4,20 @@ one:
name: MyString
game_id:
status: 1
+ min_players_per_team: 1
+ max_players_per_team: 1
+ min_teams_per_match: 1
+ max_teams_per_match: 1
+ set_rounds: 1
randomized_teams: false
two:
name: MyString
game_id:
status: 1
+ min_players_per_team: 1
+ max_players_per_team: 1
+ min_teams_per_match: 1
+ max_teams_per_match: 1
+ set_rounds: 1
randomized_teams: false
diff --git a/test/helpers/remote_usernames_helper_test.rb b/test/helpers/remote_usernames_helper_test.rb
new file mode 100644
index 0000000..1c9a795
--- /dev/null
+++ b/test/helpers/remote_usernames_helper_test.rb
@@ -0,0 +1,4 @@
+require 'test_helper'
+
+class RemoteUsernamesHelperTest < ActionView::TestCase
+end