diff options
-rw-r--r-- | app/controllers/games_controller.rb | 2 | ||||
-rw-r--r-- | app/models/game.rb | 2 | ||||
-rw-r--r-- | app/models/game_setting.rb | 1 | ||||
-rw-r--r-- | app/views/games/_form.html.erb | 4 | ||||
-rw-r--r-- | app/views/games/index.html.erb | 2 | ||||
-rw-r--r-- | app/views/games/index.json.jbuilder | 2 | ||||
-rw-r--r-- | app/views/games/show.html.erb | 5 | ||||
-rw-r--r-- | app/views/games/show.json.jbuilder | 2 | ||||
-rw-r--r-- | db/migrate/20140423214420_create_simple_captcha_data.rb (renamed from db/migrate/20140423213222_create_simple_captcha_data.rb) | 0 | ||||
-rw-r--r-- | db/migrate/20140424014418_create_mailboxer.mailboxer_engine.rb (renamed from db/migrate/20140424013221_create_mailboxer.mailboxer_engine.rb) | 0 | ||||
-rw-r--r-- | db/migrate/20140424014419_add_notified_object.mailboxer_engine.rb (renamed from db/migrate/20140424013222_add_notified_object.mailboxer_engine.rb) | 0 | ||||
-rw-r--r-- | db/migrate/20140424014420_add_notification_code.mailboxer_engine.rb (renamed from db/migrate/20140424013223_add_notification_code.mailboxer_engine.rb) | 0 | ||||
-rw-r--r-- | db/migrate/20140424014421_add_attachments.mailboxer_engine.rb (renamed from db/migrate/20140424013224_add_attachments.mailboxer_engine.rb) | 0 | ||||
-rw-r--r-- | db/migrate/20140424014422_rename_receipts_read.mailboxer_engine.rb (renamed from db/migrate/20140424013225_rename_receipts_read.mailboxer_engine.rb) | 0 | ||||
-rw-r--r-- | db/migrate/20140424014423_add_global_notification_support.mailboxer_engine.rb (renamed from db/migrate/20140424013226_add_global_notification_support.mailboxer_engine.rb) | 0 | ||||
-rw-r--r-- | db/migrate/20140424014424_create_delayed_jobs.rb (renamed from db/migrate/20140424013227_create_delayed_jobs.rb) | 0 | ||||
-rw-r--r-- | db/migrate/20140424014425_create_servers.rb (renamed from db/migrate/20140424013228_create_servers.rb) | 0 | ||||
-rw-r--r-- | db/migrate/20140424014426_create_matches.rb (renamed from db/migrate/20140424013229_create_matches.rb) | 0 | ||||
-rw-r--r-- | db/migrate/20140424014427_create_teams.rb (renamed from db/migrate/20140424013230_create_teams.rb) | 0 | ||||
-rw-r--r-- | db/migrate/20140424014428_create_alerts.rb (renamed from db/migrate/20140424013231_create_alerts.rb) | 0 | ||||
-rw-r--r-- | db/migrate/20140424014429_create_pms.rb (renamed from db/migrate/20140424013232_create_pms.rb) | 0 | ||||
-rw-r--r-- | db/migrate/20140424014431_create_tournaments.rb (renamed from db/migrate/20140424013233_create_tournaments.rb) | 0 | ||||
-rw-r--r-- | db/migrate/20140424014433_create_games.rb (renamed from db/migrate/20140424013234_create_games.rb) | 1 | ||||
-rw-r--r-- | db/migrate/20140424014434_create_users.rb (renamed from db/migrate/20140424013236_create_users.rb) | 0 | ||||
-rw-r--r-- | db/migrate/20140424014436_create_sessions.rb (renamed from db/migrate/20140424013237_create_sessions.rb) | 0 | ||||
-rw-r--r-- | db/migrate/20140424014437_create_brackets.rb (renamed from db/migrate/20140424013239_create_brackets.rb) | 0 | ||||
-rw-r--r-- | db/migrate/20140424014439_create_game_settings.rb (renamed from db/migrate/20140424013241_create_game_settings.rb) | 1 | ||||
-rw-r--r-- | db/migrate/20140424014440_create_tournament_settings.rb (renamed from db/migrate/20140424013242_create_tournament_settings.rb) | 0 | ||||
-rw-r--r-- | db/migrate/20140424014442_create_tournament_stages.rb (renamed from db/migrate/20140424013244_create_tournament_stages.rb) | 0 | ||||
-rw-r--r-- | db/migrate/20140424014443_create_statistics.rb (renamed from db/migrate/20140424013245_create_statistics.rb) | 0 | ||||
-rw-r--r-- | db/migrate/20140424014445_create_remote_usernames.rb (renamed from db/migrate/20140424013247_create_remote_usernames.rb) | 0 | ||||
-rw-r--r-- | db/migrate/20140424014446_create_bracket_matches.rb (renamed from db/migrate/20140424013248_create_bracket_matches.rb) | 0 | ||||
-rw-r--r-- | db/migrate/20140424014448_create_api_requests.rb (renamed from db/migrate/20140424013250_create_api_requests.rb) | 0 | ||||
-rw-r--r-- | db/migrate/20140424014449_create_tournament_players_join_table.rb (renamed from db/migrate/20140424013251_create_tournament_players_join_table.rb) | 0 | ||||
-rw-r--r-- | db/migrate/20140424014451_create_tournament_hosts_join_table.rb (renamed from db/migrate/20140424013253_create_tournament_hosts_join_table.rb) | 0 | ||||
-rw-r--r-- | db/migrate/20140424014452_create_team_user_join_table.rb (renamed from db/migrate/20140424013254_create_team_user_join_table.rb) | 0 | ||||
-rw-r--r-- | db/migrate/20140424014454_create_match_team_join_table.rb (renamed from db/migrate/20140424013256_create_match_team_join_table.rb) | 0 | ||||
-rw-r--r-- | db/migrate/20140424014459_add_hidden_attrs_to_user.rb (renamed from db/migrate/20140424013300_add_hidden_attrs_to_user.rb) | 0 | ||||
-rw-r--r-- | db/schema.rb | 6 | ||||
-rwxr-xr-x | generate.sh | 4 | ||||
-rw-r--r-- | test/controllers/games_controller_test.rb | 4 | ||||
-rw-r--r-- | test/fixtures/game_settings.yml | 2 | ||||
-rw-r--r-- | test/fixtures/games.yml | 2 |
43 files changed, 26 insertions, 14 deletions
diff --git a/app/controllers/games_controller.rb b/app/controllers/games_controller.rb index 1f0bdd8..aec5294 100644 --- a/app/controllers/games_controller.rb +++ b/app/controllers/games_controller.rb @@ -67,6 +67,6 @@ class GamesController < ApplicationController # Never trust parameters from the scary internet, only allow the white list through. def game_params - params.require(:game).permit(:name, :min_players_per_team, :max_players_per_team, :min_teams_per_match, :max_teams_per_match, :set_rounds, :randomized_teams, :sampling_method) + params.require(:game).permit(:parent_id, :name, :min_players_per_team, :max_players_per_team, :min_teams_per_match, :max_teams_per_match, :set_rounds, :randomized_teams, :sampling_method) end end diff --git a/app/models/game.rb b/app/models/game.rb index 345877e..5f4c46d 100644 --- a/app/models/game.rb +++ b/app/models/game.rb @@ -1,3 +1,5 @@ class Game < ActiveRecord::Base + belongs_to :parent, class_name: "Game" + has_many :children, class_name: "Game" has_many :settings, class_name: "GameSetting" end diff --git a/app/models/game_setting.rb b/app/models/game_setting.rb index e6d43e5..bff8d97 100644 --- a/app/models/game_setting.rb +++ b/app/models/game_setting.rb @@ -1,4 +1,3 @@ class GameSetting < ActiveRecord::Base belongs_to :game - belongs_to :parent end diff --git a/app/views/games/_form.html.erb b/app/views/games/_form.html.erb index ef250ad..20cb214 100644 --- a/app/views/games/_form.html.erb +++ b/app/views/games/_form.html.erb @@ -12,6 +12,10 @@ <% end %> <div class="field"> + <%= f.label :parent_id %><br> + <%= f.text_field :parent_id %> + </div> + <div class="field"> <%= f.label :name %><br> <%= f.text_field :name %> </div> diff --git a/app/views/games/index.html.erb b/app/views/games/index.html.erb index abb0d8a..bcd10dd 100644 --- a/app/views/games/index.html.erb +++ b/app/views/games/index.html.erb @@ -3,6 +3,7 @@ <table class="table table-hover"> <thead> <tr> + <th>Parent</th> <th>Name</th> <th>Min players per team</th> <th>Max players per team</th> @@ -20,6 +21,7 @@ <tbody> <% @games.each do |game| %> <tr> + <td><%= game.parent %></td> <td><%= game.name %></td> <td><%= game.min_players_per_team %></td> <td><%= game.max_players_per_team %></td> diff --git a/app/views/games/index.json.jbuilder b/app/views/games/index.json.jbuilder index cc0afc9..6b20f60 100644 --- a/app/views/games/index.json.jbuilder +++ b/app/views/games/index.json.jbuilder @@ -1,4 +1,4 @@ json.array!(@games) do |game| - json.extract! game, :id, :name, :min_players_per_team, :max_players_per_team, :min_teams_per_match, :max_teams_per_match, :set_rounds, :randomized_teams, :sampling_method + json.extract! game, :id, :parent_id, :name, :min_players_per_team, :max_players_per_team, :min_teams_per_match, :max_teams_per_match, :set_rounds, :randomized_teams, :sampling_method json.url game_url(game, format: :json) end diff --git a/app/views/games/show.html.erb b/app/views/games/show.html.erb index d731e3d..1250cbd 100644 --- a/app/views/games/show.html.erb +++ b/app/views/games/show.html.erb @@ -1,4 +1,9 @@ <p> + <strong>Parent:</strong> + <%= @game.parent %> +</p> + +<p> <strong>Name:</strong> <%= @game.name %> </p> diff --git a/app/views/games/show.json.jbuilder b/app/views/games/show.json.jbuilder index 60d0a4a..087a156 100644 --- a/app/views/games/show.json.jbuilder +++ b/app/views/games/show.json.jbuilder @@ -1 +1 @@ -json.extract! @game, :id, :name, :min_players_per_team, :max_players_per_team, :min_teams_per_match, :max_teams_per_match, :set_rounds, :randomized_teams, :sampling_method, :created_at, :updated_at +json.extract! @game, :id, :parent_id, :name, :min_players_per_team, :max_players_per_team, :min_teams_per_match, :max_teams_per_match, :set_rounds, :randomized_teams, :sampling_method, :created_at, :updated_at diff --git a/db/migrate/20140423213222_create_simple_captcha_data.rb b/db/migrate/20140423214420_create_simple_captcha_data.rb index 4573b20..4573b20 100644 --- a/db/migrate/20140423213222_create_simple_captcha_data.rb +++ b/db/migrate/20140423214420_create_simple_captcha_data.rb diff --git a/db/migrate/20140424013221_create_mailboxer.mailboxer_engine.rb b/db/migrate/20140424014418_create_mailboxer.mailboxer_engine.rb index 690cec2..690cec2 100644 --- a/db/migrate/20140424013221_create_mailboxer.mailboxer_engine.rb +++ b/db/migrate/20140424014418_create_mailboxer.mailboxer_engine.rb diff --git a/db/migrate/20140424013222_add_notified_object.mailboxer_engine.rb b/db/migrate/20140424014419_add_notified_object.mailboxer_engine.rb index 7f41ac6..7f41ac6 100644 --- a/db/migrate/20140424013222_add_notified_object.mailboxer_engine.rb +++ b/db/migrate/20140424014419_add_notified_object.mailboxer_engine.rb diff --git a/db/migrate/20140424013223_add_notification_code.mailboxer_engine.rb b/db/migrate/20140424014420_add_notification_code.mailboxer_engine.rb index 04c12ef..04c12ef 100644 --- a/db/migrate/20140424013223_add_notification_code.mailboxer_engine.rb +++ b/db/migrate/20140424014420_add_notification_code.mailboxer_engine.rb diff --git a/db/migrate/20140424013224_add_attachments.mailboxer_engine.rb b/db/migrate/20140424014421_add_attachments.mailboxer_engine.rb index b8d6588..b8d6588 100644 --- a/db/migrate/20140424013224_add_attachments.mailboxer_engine.rb +++ b/db/migrate/20140424014421_add_attachments.mailboxer_engine.rb diff --git a/db/migrate/20140424013225_rename_receipts_read.mailboxer_engine.rb b/db/migrate/20140424014422_rename_receipts_read.mailboxer_engine.rb index 9ce904f..9ce904f 100644 --- a/db/migrate/20140424013225_rename_receipts_read.mailboxer_engine.rb +++ b/db/migrate/20140424014422_rename_receipts_read.mailboxer_engine.rb diff --git a/db/migrate/20140424013226_add_global_notification_support.mailboxer_engine.rb b/db/migrate/20140424014423_add_global_notification_support.mailboxer_engine.rb index 60f67ab..60f67ab 100644 --- a/db/migrate/20140424013226_add_global_notification_support.mailboxer_engine.rb +++ b/db/migrate/20140424014423_add_global_notification_support.mailboxer_engine.rb diff --git a/db/migrate/20140424013227_create_delayed_jobs.rb b/db/migrate/20140424014424_create_delayed_jobs.rb index ec0dd93..ec0dd93 100644 --- a/db/migrate/20140424013227_create_delayed_jobs.rb +++ b/db/migrate/20140424014424_create_delayed_jobs.rb diff --git a/db/migrate/20140424013228_create_servers.rb b/db/migrate/20140424014425_create_servers.rb index fbe1b02..fbe1b02 100644 --- a/db/migrate/20140424013228_create_servers.rb +++ b/db/migrate/20140424014425_create_servers.rb diff --git a/db/migrate/20140424013229_create_matches.rb b/db/migrate/20140424014426_create_matches.rb index bac92d1..bac92d1 100644 --- a/db/migrate/20140424013229_create_matches.rb +++ b/db/migrate/20140424014426_create_matches.rb diff --git a/db/migrate/20140424013230_create_teams.rb b/db/migrate/20140424014427_create_teams.rb index dd8397d..dd8397d 100644 --- a/db/migrate/20140424013230_create_teams.rb +++ b/db/migrate/20140424014427_create_teams.rb diff --git a/db/migrate/20140424013231_create_alerts.rb b/db/migrate/20140424014428_create_alerts.rb index 68a8e10..68a8e10 100644 --- a/db/migrate/20140424013231_create_alerts.rb +++ b/db/migrate/20140424014428_create_alerts.rb diff --git a/db/migrate/20140424013232_create_pms.rb b/db/migrate/20140424014429_create_pms.rb index 93bb5c6..93bb5c6 100644 --- a/db/migrate/20140424013232_create_pms.rb +++ b/db/migrate/20140424014429_create_pms.rb diff --git a/db/migrate/20140424013233_create_tournaments.rb b/db/migrate/20140424014431_create_tournaments.rb index 716871f..716871f 100644 --- a/db/migrate/20140424013233_create_tournaments.rb +++ b/db/migrate/20140424014431_create_tournaments.rb diff --git a/db/migrate/20140424013234_create_games.rb b/db/migrate/20140424014433_create_games.rb index 46ed30d..23edf0b 100644 --- a/db/migrate/20140424013234_create_games.rb +++ b/db/migrate/20140424014433_create_games.rb @@ -1,6 +1,7 @@ class CreateGames < ActiveRecord::Migration def change create_table :games do |t| + t.references :parent, index: true t.string :name t.integer :min_players_per_team t.integer :max_players_per_team diff --git a/db/migrate/20140424013236_create_users.rb b/db/migrate/20140424014434_create_users.rb index 8032870..8032870 100644 --- a/db/migrate/20140424013236_create_users.rb +++ b/db/migrate/20140424014434_create_users.rb diff --git a/db/migrate/20140424013237_create_sessions.rb b/db/migrate/20140424014436_create_sessions.rb index f667f1e..f667f1e 100644 --- a/db/migrate/20140424013237_create_sessions.rb +++ b/db/migrate/20140424014436_create_sessions.rb diff --git a/db/migrate/20140424013239_create_brackets.rb b/db/migrate/20140424014437_create_brackets.rb index 8813bf2..8813bf2 100644 --- a/db/migrate/20140424013239_create_brackets.rb +++ b/db/migrate/20140424014437_create_brackets.rb diff --git a/db/migrate/20140424013241_create_game_settings.rb b/db/migrate/20140424014439_create_game_settings.rb index 502b4fe..06fb72e 100644 --- a/db/migrate/20140424013241_create_game_settings.rb +++ b/db/migrate/20140424014439_create_game_settings.rb @@ -8,7 +8,6 @@ class CreateGameSettings < ActiveRecord::Migration t.text :description t.integer :display_order t.text :default - t.references :parent, index: true t.timestamps end diff --git a/db/migrate/20140424013242_create_tournament_settings.rb b/db/migrate/20140424014440_create_tournament_settings.rb index e56697f..e56697f 100644 --- a/db/migrate/20140424013242_create_tournament_settings.rb +++ b/db/migrate/20140424014440_create_tournament_settings.rb diff --git a/db/migrate/20140424013244_create_tournament_stages.rb b/db/migrate/20140424014442_create_tournament_stages.rb index e3668cb..e3668cb 100644 --- a/db/migrate/20140424013244_create_tournament_stages.rb +++ b/db/migrate/20140424014442_create_tournament_stages.rb diff --git a/db/migrate/20140424013245_create_statistics.rb b/db/migrate/20140424014443_create_statistics.rb index cc2e97d..cc2e97d 100644 --- a/db/migrate/20140424013245_create_statistics.rb +++ b/db/migrate/20140424014443_create_statistics.rb diff --git a/db/migrate/20140424013247_create_remote_usernames.rb b/db/migrate/20140424014445_create_remote_usernames.rb index e265985..e265985 100644 --- a/db/migrate/20140424013247_create_remote_usernames.rb +++ b/db/migrate/20140424014445_create_remote_usernames.rb diff --git a/db/migrate/20140424013248_create_bracket_matches.rb b/db/migrate/20140424014446_create_bracket_matches.rb index 3323e31..3323e31 100644 --- a/db/migrate/20140424013248_create_bracket_matches.rb +++ b/db/migrate/20140424014446_create_bracket_matches.rb diff --git a/db/migrate/20140424013250_create_api_requests.rb b/db/migrate/20140424014448_create_api_requests.rb index 544c330..544c330 100644 --- a/db/migrate/20140424013250_create_api_requests.rb +++ b/db/migrate/20140424014448_create_api_requests.rb diff --git a/db/migrate/20140424013251_create_tournament_players_join_table.rb b/db/migrate/20140424014449_create_tournament_players_join_table.rb index be240e8..be240e8 100644 --- a/db/migrate/20140424013251_create_tournament_players_join_table.rb +++ b/db/migrate/20140424014449_create_tournament_players_join_table.rb diff --git a/db/migrate/20140424013253_create_tournament_hosts_join_table.rb b/db/migrate/20140424014451_create_tournament_hosts_join_table.rb index 7521d89..7521d89 100644 --- a/db/migrate/20140424013253_create_tournament_hosts_join_table.rb +++ b/db/migrate/20140424014451_create_tournament_hosts_join_table.rb diff --git a/db/migrate/20140424013254_create_team_user_join_table.rb b/db/migrate/20140424014452_create_team_user_join_table.rb index f3b57fc..f3b57fc 100644 --- a/db/migrate/20140424013254_create_team_user_join_table.rb +++ b/db/migrate/20140424014452_create_team_user_join_table.rb diff --git a/db/migrate/20140424013256_create_match_team_join_table.rb b/db/migrate/20140424014454_create_match_team_join_table.rb index c2ed1b7..c2ed1b7 100644 --- a/db/migrate/20140424013256_create_match_team_join_table.rb +++ b/db/migrate/20140424014454_create_match_team_join_table.rb diff --git a/db/migrate/20140424013300_add_hidden_attrs_to_user.rb b/db/migrate/20140424014459_add_hidden_attrs_to_user.rb index 9b5c505..9b5c505 100644 --- a/db/migrate/20140424013300_add_hidden_attrs_to_user.rb +++ b/db/migrate/20140424014459_add_hidden_attrs_to_user.rb diff --git a/db/schema.rb b/db/schema.rb index efe99b5..0e9202a 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 20140424013300) do +ActiveRecord::Schema.define(version: 20140424014459) do create_table "alerts", force: true do |t| t.integer "author_id" @@ -81,15 +81,14 @@ ActiveRecord::Schema.define(version: 20140424013300) do t.text "description" t.integer "display_order" t.text "default" - t.integer "parent_id" t.datetime "created_at" t.datetime "updated_at" end add_index "game_settings", ["game_id"], name: "index_game_settings_on_game_id" - add_index "game_settings", ["parent_id"], name: "index_game_settings_on_parent_id" create_table "games", force: true do |t| + t.integer "parent_id" t.string "name" t.integer "min_players_per_team" t.integer "max_players_per_team" @@ -103,6 +102,7 @@ ActiveRecord::Schema.define(version: 20140424013300) do end add_index "games", ["name"], name: "index_games_on_name", unique: true + add_index "games", ["parent_id"], name: "index_games_on_parent_id" create_table "hosts_tournaments", id: false, force: true do |t| t.integer "host_id", null: false diff --git a/generate.sh b/generate.sh index 00e86c5..7d33ba3 100755 --- a/generate.sh +++ b/generate.sh @@ -45,13 +45,13 @@ bundle exec rails generate scaffold team bundle exec rails generate scaffold alert author:references message:text bundle exec rails generate scaffold pm author:references recipient:references message:text bundle exec rails generate scaffold tournament game:references status:integer name:string:uniq min_players_per_team:integer max_players_per_team:integer min_teams_per_match:integer max_teams_per_match:integer set_rounds:integer randomized_teams:boolean sampling_method:string -bundle exec rails generate scaffold game name:string:uniq min_players_per_team:integer max_players_per_team:integer min_teams_per_match:integer max_teams_per_match:integer set_rounds:integer randomized_teams:boolean sampling_method:string +bundle exec rails generate scaffold game parent:references name:string:uniq min_players_per_team:integer max_players_per_team:integer min_teams_per_match:integer max_teams_per_match:integer set_rounds:integer randomized_teams:boolean sampling_method:string bundle exec rails generate scaffold user name:string email:string:uniq user_name:string:uniq bundle exec rails generate scaffold session user:references token:string:uniq bundle exec rails generate scaffold bracket user:references tournament:references name:string # Just models -bundle exec rails generate model game_setting game:references name:string vartype:integer type_opt:text description:text display_order:integer default:text parent:references +bundle exec rails generate model game_setting game:references name:string vartype:integer type_opt:text description:text display_order:integer default:text bundle exec rails generate model tournament_setting tournament:references name:string vartype:integer type_opt:text description:text display_order:integer value:text bundle exec rails generate model score user:references match:references value:integer diff --git a/test/controllers/games_controller_test.rb b/test/controllers/games_controller_test.rb index f55a226..be97aa0 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, sampling_method: @game.sampling_method, 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, parent_id: @game.parent_id, 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, sampling_method: @game.sampling_method, 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, parent_id: @game.parent_id, 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/fixtures/game_settings.yml b/test/fixtures/game_settings.yml index 37ec91d..118501b 100644 --- a/test/fixtures/game_settings.yml +++ b/test/fixtures/game_settings.yml @@ -8,7 +8,6 @@ one: description: MyText display_order: 1 default: MyText - parent_id: two: game_id: @@ -18,4 +17,3 @@ two: description: MyText display_order: 1 default: MyText - parent_id: diff --git a/test/fixtures/games.yml b/test/fixtures/games.yml index af46a13..b811dec 100644 --- a/test/fixtures/games.yml +++ b/test/fixtures/games.yml @@ -1,6 +1,7 @@ # Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html one: + parent_id: name: MyString min_players_per_team: 1 max_players_per_team: 1 @@ -11,6 +12,7 @@ one: sampling_method: MyString two: + parent_id: name: MyString min_players_per_team: 1 max_players_per_team: 1 |