summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorguntasgrewal <guntasgrewal@gmail.com>2014-03-06 17:25:40 -0500
committerguntasgrewal <guntasgrewal@gmail.com>2014-03-06 17:25:40 -0500
commitf5d36fc67d1994b7cc1ce02e7be2767ffcb47857 (patch)
tree03afe3bea27d2963525d7509690ec6b39e5648f9 /test
parentd0545c2820d101a98b3c895cf6e3691145a62f3c (diff)
new generate
Diffstat (limited to 'test')
-rw-r--r--test/controllers/games_controller_test.rb4
-rw-r--r--test/controllers/teams_controller_test.rb4
-rw-r--r--test/controllers/tournaments_controller_test.rb4
-rw-r--r--test/fixtures/game_options.yml11
-rw-r--r--test/fixtures/games.yml16
-rw-r--r--test/fixtures/scores.yml (renamed from test/fixtures/game_attributes.yml)12
-rw-r--r--test/fixtures/teams.yml14
-rw-r--r--test/fixtures/tournament_options.yml20
-rw-r--r--test/fixtures/tournament_user_pairs.yml9
-rw-r--r--test/fixtures/tournaments.yml14
-rw-r--r--test/models/game_option_test.rb (renamed from test/models/game_attribute_test.rb)2
-rw-r--r--test/models/score_test.rb7
-rw-r--r--test/models/tournament_user_pair_test.rb7
13 files changed, 87 insertions, 37 deletions
diff --git a/test/controllers/games_controller_test.rb b/test/controllers/games_controller_test.rb
index 95c3145..b93feac 100644
--- a/test/controllers/games_controller_test.rb
+++ b/test/controllers/games_controller_test.rb
@@ -18,7 +18,7 @@ class GamesControllerTest < ActionController::TestCase
test "should create game" do
assert_difference('Game.count') do
- post :create, game: { name: @game.name, players_per_team: @game.players_per_team, randomized_teams: @game.randomized_teams, set_rounds: @game.set_rounds, teams_per_match: @game.teams_per_match }
+ post :create, game: { max_players_per_team: @game.max_players_per_team, max_teams_per_match: @game.max_teams_per_match, min_players_per_team: @game.min_players_per_team, min_teams_per_match: @game.min_teams_per_match, name: @game.name, randomized_teams: @game.randomized_teams, set_rounds: @game.set_rounds }
end
assert_redirected_to game_path(assigns(:game))
@@ -35,7 +35,7 @@ class GamesControllerTest < ActionController::TestCase
end
test "should update game" do
- patch :update, id: @game, game: { name: @game.name, players_per_team: @game.players_per_team, randomized_teams: @game.randomized_teams, set_rounds: @game.set_rounds, teams_per_match: @game.teams_per_match }
+ patch :update, id: @game, game: { max_players_per_team: @game.max_players_per_team, max_teams_per_match: @game.max_teams_per_match, min_players_per_team: @game.min_players_per_team, min_teams_per_match: @game.min_teams_per_match, name: @game.name, randomized_teams: @game.randomized_teams, set_rounds: @game.set_rounds }
assert_redirected_to game_path(assigns(:game))
end
diff --git a/test/controllers/teams_controller_test.rb b/test/controllers/teams_controller_test.rb
index 8bf60be..52f7c17 100644
--- a/test/controllers/teams_controller_test.rb
+++ b/test/controllers/teams_controller_test.rb
@@ -18,7 +18,7 @@ class TeamsControllerTest < ActionController::TestCase
test "should create team" do
assert_difference('Team.count') do
- post :create, team: { }
+ post :create, team: { match_id: @team.match_id }
end
assert_redirected_to team_path(assigns(:team))
@@ -35,7 +35,7 @@ class TeamsControllerTest < ActionController::TestCase
end
test "should update team" do
- patch :update, id: @team, team: { }
+ patch :update, id: @team, team: { match_id: @team.match_id }
assert_redirected_to team_path(assigns(:team))
end
diff --git a/test/controllers/tournaments_controller_test.rb b/test/controllers/tournaments_controller_test.rb
index bdbbfac..02e578a 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 }
+ 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, 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 }
+ 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, 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/game_options.yml b/test/fixtures/game_options.yml
new file mode 100644
index 0000000..eb4760a
--- /dev/null
+++ b/test/fixtures/game_options.yml
@@ -0,0 +1,11 @@
+# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
+
+one:
+ vartype: 1
+ name: MyString
+ default: MyText
+
+two:
+ vartype: 1
+ name: MyString
+ default: MyText
diff --git a/test/fixtures/games.yml b/test/fixtures/games.yml
index 3068527..16f792e 100644
--- a/test/fixtures/games.yml
+++ b/test/fixtures/games.yml
@@ -2,14 +2,18 @@
one:
name: MyText
- players_per_team: 1
- teams_per_match: 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: 1
+ randomized_teams: false
two:
name: MyText
- players_per_team: 1
- teams_per_match: 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: 1
+ randomized_teams: false
diff --git a/test/fixtures/game_attributes.yml b/test/fixtures/scores.yml
index eff7212..26065df 100644
--- a/test/fixtures/game_attributes.yml
+++ b/test/fixtures/scores.yml
@@ -1,11 +1,11 @@
# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
one:
- game_id:
- key: MyText
- type: 1
+ user_id:
+ match_id:
+ value: 1
two:
- game_id:
- key: MyText
- type: 1
+ user_id:
+ match_id:
+ value: 1
diff --git a/test/fixtures/teams.yml b/test/fixtures/teams.yml
index 937a0c0..4efc76e 100644
--- a/test/fixtures/teams.yml
+++ b/test/fixtures/teams.yml
@@ -1,11 +1,7 @@
# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
-# This model initially had no columns defined. If you add columns to the
-# model remove the '{}' from the fixture names and add the columns immediately
-# below each fixture, per the syntax in the comments below
-#
-one: {}
-# column: value
-#
-two: {}
-# column: value
+one:
+ match_id:
+
+two:
+ match_id:
diff --git a/test/fixtures/tournament_options.yml b/test/fixtures/tournament_options.yml
index 937a0c0..aa5eaef 100644
--- a/test/fixtures/tournament_options.yml
+++ b/test/fixtures/tournament_options.yml
@@ -1,11 +1,13 @@
# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
-# This model initially had no columns defined. If you add columns to the
-# model remove the '{}' from the fixture names and add the columns immediately
-# below each fixture, per the syntax in the comments below
-#
-one: {}
-# column: value
-#
-two: {}
-# column: value
+one:
+ tournament_id:
+ vartype: 1
+ name: MyString
+ value: MyText
+
+two:
+ tournament_id:
+ vartype: 1
+ name: MyString
+ value: MyText
diff --git a/test/fixtures/tournament_user_pairs.yml b/test/fixtures/tournament_user_pairs.yml
new file mode 100644
index 0000000..dbc4a88
--- /dev/null
+++ b/test/fixtures/tournament_user_pairs.yml
@@ -0,0 +1,9 @@
+# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
+
+one:
+ tournament_id:
+ user_id:
+
+two:
+ tournament_id:
+ user_id:
diff --git a/test/fixtures/tournaments.yml b/test/fixtures/tournaments.yml
index 4cba7ca..c58a1ed 100644
--- a/test/fixtures/tournaments.yml
+++ b/test/fixtures/tournaments.yml
@@ -2,6 +2,20 @@
one:
game_id:
+ 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
+ status: 1
two:
game_id:
+ 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
+ status: 1
diff --git a/test/models/game_attribute_test.rb b/test/models/game_option_test.rb
index 13c6e65..1ae5701 100644
--- a/test/models/game_attribute_test.rb
+++ b/test/models/game_option_test.rb
@@ -1,6 +1,6 @@
require 'test_helper'
-class GameAttributeTest < ActiveSupport::TestCase
+class GameOptionTest < ActiveSupport::TestCase
# test "the truth" do
# assert true
# end
diff --git a/test/models/score_test.rb b/test/models/score_test.rb
new file mode 100644
index 0000000..d38cb0a
--- /dev/null
+++ b/test/models/score_test.rb
@@ -0,0 +1,7 @@
+require 'test_helper'
+
+class ScoreTest < ActiveSupport::TestCase
+ # test "the truth" do
+ # assert true
+ # end
+end
diff --git a/test/models/tournament_user_pair_test.rb b/test/models/tournament_user_pair_test.rb
new file mode 100644
index 0000000..c8d1789
--- /dev/null
+++ b/test/models/tournament_user_pair_test.rb
@@ -0,0 +1,7 @@
+require 'test_helper'
+
+class TournamentUserPairTest < ActiveSupport::TestCase
+ # test "the truth" do
+ # assert true
+ # end
+end