From f5d36fc67d1994b7cc1ce02e7be2767ffcb47857 Mon Sep 17 00:00:00 2001 From: guntasgrewal Date: Thu, 6 Mar 2014 17:25:40 -0500 Subject: new generate --- test/controllers/games_controller_test.rb | 4 ++-- test/controllers/teams_controller_test.rb | 4 ++-- test/controllers/tournaments_controller_test.rb | 4 ++-- test/fixtures/game_attributes.yml | 11 ----------- test/fixtures/game_options.yml | 11 +++++++++++ test/fixtures/games.yml | 16 ++++++++++------ test/fixtures/scores.yml | 11 +++++++++++ test/fixtures/teams.yml | 14 +++++--------- test/fixtures/tournament_options.yml | 20 +++++++++++--------- test/fixtures/tournament_user_pairs.yml | 9 +++++++++ test/fixtures/tournaments.yml | 14 ++++++++++++++ test/models/game_attribute_test.rb | 7 ------- test/models/game_option_test.rb | 7 +++++++ test/models/score_test.rb | 7 +++++++ test/models/tournament_user_pair_test.rb | 7 +++++++ 15 files changed, 98 insertions(+), 48 deletions(-) delete mode 100644 test/fixtures/game_attributes.yml create mode 100644 test/fixtures/game_options.yml create mode 100644 test/fixtures/scores.yml create mode 100644 test/fixtures/tournament_user_pairs.yml delete mode 100644 test/models/game_attribute_test.rb create mode 100644 test/models/game_option_test.rb create mode 100644 test/models/score_test.rb create mode 100644 test/models/tournament_user_pair_test.rb (limited to 'test') 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_attributes.yml b/test/fixtures/game_attributes.yml deleted file mode 100644 index eff7212..0000000 --- a/test/fixtures/game_attributes.yml +++ /dev/null @@ -1,11 +0,0 @@ -# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html - -one: - game_id: - key: MyText - type: 1 - -two: - game_id: - key: MyText - type: 1 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/scores.yml b/test/fixtures/scores.yml new file mode 100644 index 0000000..26065df --- /dev/null +++ b/test/fixtures/scores.yml @@ -0,0 +1,11 @@ +# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html + +one: + user_id: + match_id: + value: 1 + +two: + 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_attribute_test.rb deleted file mode 100644 index 13c6e65..0000000 --- a/test/models/game_attribute_test.rb +++ /dev/null @@ -1,7 +0,0 @@ -require 'test_helper' - -class GameAttributeTest < ActiveSupport::TestCase - # test "the truth" do - # assert true - # end -end diff --git a/test/models/game_option_test.rb b/test/models/game_option_test.rb new file mode 100644 index 0000000..1ae5701 --- /dev/null +++ b/test/models/game_option_test.rb @@ -0,0 +1,7 @@ +require 'test_helper' + +class GameOptionTest < ActiveSupport::TestCase + # test "the truth" do + # assert true + # end +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 -- cgit v1.2.3