diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/controllers/games_controller_test.rb | 4 | ||||
-rw-r--r-- | test/controllers/matches_controller_test.rb | 4 | ||||
-rw-r--r-- | test/controllers/tournaments_controller_test.rb | 4 | ||||
-rw-r--r-- | test/fixtures/games.yml | 6 | ||||
-rw-r--r-- | test/fixtures/matches.yml | 4 | ||||
-rw-r--r-- | test/fixtures/statistics.yml (renamed from test/fixtures/scores.yml) | 2 | ||||
-rw-r--r-- | test/fixtures/tournament_stages.yml | 11 | ||||
-rw-r--r-- | test/fixtures/tournaments.yml | 6 | ||||
-rw-r--r-- | test/models/statistic_test.rb (renamed from test/models/score_test.rb) | 2 | ||||
-rw-r--r-- | test/models/tournament_stage_test.rb | 7 |
10 files changed, 37 insertions, 13 deletions
diff --git a/test/controllers/games_controller_test.rb b/test/controllers/games_controller_test.rb index b93feac..f55a226 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: { 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 } + 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, sampling_method: @game.sampling_method, 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: { 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 } + 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, sampling_method: @game.sampling_method, set_rounds: @game.set_rounds } assert_redirected_to game_path(assigns(:game)) end diff --git a/test/controllers/matches_controller_test.rb b/test/controllers/matches_controller_test.rb index aca7008..033704e 100644 --- a/test/controllers/matches_controller_test.rb +++ b/test/controllers/matches_controller_test.rb @@ -18,7 +18,7 @@ class MatchesControllerTest < ActionController::TestCase test "should create match" do assert_difference('Match.count') do - post :create, match: { name: @match.name, remote_id: @match.remote_id, status: @match.status, submitted_peer_evaluations: @match.submitted_peer_evaluations, tournament_id: @match.tournament_id, winner_id: @match.winner_id } + post :create, match: { name: @match.name, remote_id: @match.remote_id, status: @match.status, submitted_peer_evaluations: @match.submitted_peer_evaluations, tournament_stage_id: @match.tournament_stage_id, winner_id: @match.winner_id } end assert_redirected_to match_path(assigns(:match)) @@ -35,7 +35,7 @@ class MatchesControllerTest < ActionController::TestCase end test "should update match" do - patch :update, id: @match, match: { name: @match.name, remote_id: @match.remote_id, status: @match.status, submitted_peer_evaluations: @match.submitted_peer_evaluations, tournament_id: @match.tournament_id, winner_id: @match.winner_id } + patch :update, id: @match, match: { name: @match.name, remote_id: @match.remote_id, status: @match.status, submitted_peer_evaluations: @match.submitted_peer_evaluations, tournament_stage_id: @match.tournament_stage_id, winner_id: @match.winner_id } assert_redirected_to match_path(assigns(:match)) end diff --git a/test/controllers/tournaments_controller_test.rb b/test/controllers/tournaments_controller_test.rb index d5ab2af..0e5673c 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, 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 } + 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, sampling_method: @tournament.sampling_method, 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, 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 } + 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, sampling_method: @tournament.sampling_method, set_rounds: @tournament.set_rounds, status: @tournament.status } assert_redirected_to tournament_path(assigns(:tournament)) end diff --git a/test/fixtures/games.yml b/test/fixtures/games.yml index 16f792e..af46a13 100644 --- a/test/fixtures/games.yml +++ b/test/fixtures/games.yml @@ -1,19 +1,21 @@ # Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html one: - name: MyText + name: MyString 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 + sampling_method: MyString two: - name: MyText + name: MyString 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 + sampling_method: MyString diff --git a/test/fixtures/matches.yml b/test/fixtures/matches.yml index f64a72e..ff81182 100644 --- a/test/fixtures/matches.yml +++ b/test/fixtures/matches.yml @@ -2,7 +2,7 @@ one: status: 1 - tournament_id: + tournament_stage_id: name: MyString winner_id: remote_id: MyString @@ -10,7 +10,7 @@ one: two: status: 1 - tournament_id: + tournament_stage_id: name: MyString winner_id: remote_id: MyString diff --git a/test/fixtures/scores.yml b/test/fixtures/statistics.yml index 26065df..0b5b113 100644 --- a/test/fixtures/scores.yml +++ b/test/fixtures/statistics.yml @@ -3,9 +3,11 @@ one: user_id: match_id: + name: MyString value: 1 two: user_id: match_id: + name: MyString value: 1 diff --git a/test/fixtures/tournament_stages.yml b/test/fixtures/tournament_stages.yml new file mode 100644 index 0000000..fdb263c --- /dev/null +++ b/test/fixtures/tournament_stages.yml @@ -0,0 +1,11 @@ +# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html + +one: + tournament_id: + scheduling: MyString + structure: MyText + +two: + tournament_id: + scheduling: MyString + structure: MyText diff --git a/test/fixtures/tournaments.yml b/test/fixtures/tournaments.yml index 89edc9f..714a963 100644 --- a/test/fixtures/tournaments.yml +++ b/test/fixtures/tournaments.yml @@ -1,23 +1,25 @@ # Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html one: - name: MyString game_id: status: 1 + name: MyString 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 + sampling_method: MyString two: - name: MyString game_id: status: 1 + name: MyString 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 + sampling_method: MyString diff --git a/test/models/score_test.rb b/test/models/statistic_test.rb index d38cb0a..e9e63bf 100644 --- a/test/models/score_test.rb +++ b/test/models/statistic_test.rb @@ -1,6 +1,6 @@ require 'test_helper' -class ScoreTest < ActiveSupport::TestCase +class StatisticTest < ActiveSupport::TestCase # test "the truth" do # assert true # end diff --git a/test/models/tournament_stage_test.rb b/test/models/tournament_stage_test.rb new file mode 100644 index 0000000..10a3a92 --- /dev/null +++ b/test/models/tournament_stage_test.rb @@ -0,0 +1,7 @@ +require 'test_helper' + +class TournamentStageTest < ActiveSupport::TestCase + # test "the truth" do + # assert true + # end +end |