diff options
author | AndrewMurrell <amurrel@purdue.edu> | 2014-04-01 17:17:49 -0400 |
---|---|---|
committer | AndrewMurrell <amurrel@purdue.edu> | 2014-04-01 17:17:49 -0400 |
commit | 031b31dfcc2b99836021d6e251c78a9fc339d444 (patch) | |
tree | 4193ce7f3cd69f60a304e7d720baf943cf09da86 | |
parent | cd6b94cfc989800d65acc0fbceeebe35da5be4af (diff) | |
parent | 0f2b05889cba090e4824f62965ee8d131da09973 (diff) |
Settled Merge Conflicts.
-rw-r--r-- | app/controllers/matches_controller.rb | 2 | ||||
-rw-r--r-- | app/controllers/tournaments_controller.rb | 2 | ||||
-rw-r--r-- | app/models/remote_username.rb | 4 | ||||
-rw-r--r-- | app/models/server_setting.rb | 2 | ||||
-rw-r--r-- | app/models/server_settings.rb | 2 | ||||
-rw-r--r-- | app/models/tournament_option.rb | 3 | ||||
-rw-r--r-- | app/models/tournament_preference.rb | 3 | ||||
-rw-r--r-- | app/views/matches/_form.html.erb | 8 | ||||
-rw-r--r-- | app/views/matches/index.html.erb | 4 | ||||
-rw-r--r-- | app/views/matches/index.json.jbuilder | 2 | ||||
-rw-r--r-- | app/views/matches/show.html.erb | 1 | ||||
-rw-r--r-- | app/views/matches/show.json.jbuilder | 2 | ||||
-rw-r--r-- | app/views/tournaments/_form.html.erb | 20 | ||||
-rw-r--r-- | app/views/tournaments/index.html.erb | 1 | ||||
-rw-r--r-- | app/views/tournaments/index.json.jbuilder | 2 | ||||
-rw-r--r-- | app/views/tournaments/show.json.jbuilder | 2 | ||||
-rw-r--r-- | db/migrate/20140401205355_create_servers.rb (renamed from db/migrate/20140325214513_create_servers.rb) | 0 | ||||
-rw-r--r-- | db/migrate/20140401205357_create_matches.rb (renamed from db/migrate/20140325214516_create_matches.rb) | 1 | ||||
-rw-r--r-- | db/migrate/20140401205400_create_teams.rb (renamed from db/migrate/20140325214518_create_teams.rb) | 0 | ||||
-rw-r--r-- | db/migrate/20140401205402_create_alerts.rb (renamed from db/migrate/20140325214521_create_alerts.rb) | 0 | ||||
-rw-r--r-- | db/migrate/20140401205405_create_pms.rb (renamed from db/migrate/20140325214523_create_pms.rb) | 0 | ||||
-rw-r--r-- | db/migrate/20140401205407_create_tournaments.rb (renamed from db/migrate/20140325214525_create_tournaments.rb) | 6 | ||||
-rw-r--r-- | db/migrate/20140401205410_create_games.rb (renamed from db/migrate/20140325214528_create_games.rb) | 0 | ||||
-rw-r--r-- | db/migrate/20140401205412_create_users.rb (renamed from db/migrate/20140325214531_create_users.rb) | 0 | ||||
-rw-r--r-- | db/migrate/20140401205415_create_sessions.rb (renamed from db/migrate/20140325214533_create_sessions.rb) | 0 | ||||
-rw-r--r-- | db/migrate/20140401205417_create_server_settings.rb (renamed from db/migrate/20140325214536_create_server_settings.rb) | 0 | ||||
-rw-r--r-- | db/migrate/20140401205420_create_game_settings.rb (renamed from db/migrate/20140325214540_create_game_settings.rb) | 0 | ||||
-rw-r--r-- | db/migrate/20140401205422_create_tournament_preferences.rb (renamed from db/migrate/20140325214538_create_tournament_options.rb) | 4 | ||||
-rw-r--r-- | db/migrate/20140401205424_create_scores.rb (renamed from db/migrate/20140325214543_create_scores.rb) | 0 | ||||
-rw-r--r-- | db/migrate/20140401205427_create_remote_usernames.rb | 11 | ||||
-rw-r--r-- | db/migrate/20140401205429_create_tournament_players_join_table.rb (renamed from db/migrate/20140325214545_create_tournament_players_join_table.rb) | 0 | ||||
-rw-r--r-- | db/migrate/20140401205432_create_tournament_hosts_join_table.rb (renamed from db/migrate/20140325214548_create_tournament_hosts_join_table.rb) | 0 | ||||
-rw-r--r-- | db/migrate/20140401205434_create_team_user_join_table.rb (renamed from db/migrate/20140325214550_create_team_user_join_table.rb) | 0 | ||||
-rw-r--r-- | db/migrate/20140401205437_create_match_team_join_table.rb (renamed from db/migrate/20140325214553_create_match_team_join_table.rb) | 0 | ||||
-rw-r--r-- | db/migrate/20140401205446_add_hidden_attrs_to_user.rb (renamed from db/migrate/20140325214602_add_hidden_attrs_to_user.rb) | 0 | ||||
-rw-r--r-- | db/schema.rb | 24 | ||||
-rwxr-xr-x | generate.sh | 6 | ||||
-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/matches.yml | 2 | ||||
-rw-r--r-- | test/fixtures/remote_usernames.yml | 11 | ||||
-rw-r--r-- | test/fixtures/tournament_preferences.yml (renamed from test/fixtures/tournament_options.yml) | 0 | ||||
-rw-r--r-- | test/fixtures/tournaments.yml | 12 | ||||
-rw-r--r-- | test/models/remote_username_test.rb (renamed from test/models/server_settings_test.rb) | 2 | ||||
-rw-r--r-- | test/models/server_setting_test.rb (renamed from test/models/tournament_option_test.rb) | 2 | ||||
-rw-r--r-- | test/models/tournament_preference_test.rb | 7 |
46 files changed, 86 insertions, 70 deletions
diff --git a/app/controllers/matches_controller.rb b/app/controllers/matches_controller.rb index b312e9e..53028a4 100644 --- a/app/controllers/matches_controller.rb +++ b/app/controllers/matches_controller.rb @@ -72,6 +72,6 @@ class MatchesController < ApplicationController end # Never trust parameters from the scary internet, only allow the white list through. def match_params - params.require(:match).permit(:status, :tournament_id, :name, :winner_id) + params.require(:match).permit(:status, :tournament_id, :name, :winner_id, :remote_id) end end diff --git a/app/controllers/tournaments_controller.rb b/app/controllers/tournaments_controller.rb index 8d90758..027aad6 100644 --- a/app/controllers/tournaments_controller.rb +++ b/app/controllers/tournaments_controller.rb @@ -124,8 +124,6 @@ class TournamentsController < ApplicationController # Never trust parameters from the scary internet, only allow the white list through. def tournament_params - params.require(:tournament).permit(:game, :name, :game_id, :status, :min_players_per_team, :max_players_per_team, :min_teams_per_match, :max_teams_per_match, :set_rounds, :randomized_teams) - end end diff --git a/app/models/remote_username.rb b/app/models/remote_username.rb new file mode 100644 index 0000000..94e5063 --- /dev/null +++ b/app/models/remote_username.rb @@ -0,0 +1,4 @@ +class RemoteUsername < ActiveRecord::Base + belongs_to :game + belongs_to :user +end diff --git a/app/models/server_setting.rb b/app/models/server_setting.rb new file mode 100644 index 0000000..28ae943 --- /dev/null +++ b/app/models/server_setting.rb @@ -0,0 +1,2 @@ +class ServerSetting < ActiveRecord::Base +end diff --git a/app/models/server_settings.rb b/app/models/server_settings.rb deleted file mode 100644 index 7f49863..0000000 --- a/app/models/server_settings.rb +++ /dev/null @@ -1,2 +0,0 @@ -class ServerSettings < ActiveRecord::Base -end diff --git a/app/models/tournament_option.rb b/app/models/tournament_option.rb deleted file mode 100644 index 242a6f6..0000000 --- a/app/models/tournament_option.rb +++ /dev/null @@ -1,3 +0,0 @@ -class TournamentOption < ActiveRecord::Base - belongs_to :tournament -end diff --git a/app/models/tournament_preference.rb b/app/models/tournament_preference.rb new file mode 100644 index 0000000..1f335e3 --- /dev/null +++ b/app/models/tournament_preference.rb @@ -0,0 +1,3 @@ +class TournamentPreference < ActiveRecord::Base + belongs_to :tournament +end diff --git a/app/views/matches/_form.html.erb b/app/views/matches/_form.html.erb index 3efb566..e2ec73b 100644 --- a/app/views/matches/_form.html.erb +++ b/app/views/matches/_form.html.erb @@ -12,6 +12,14 @@ <%= f.label :name %><br> <%= f.text_field :name %> </div> + <div class="field"> + <%= f.label :winner_id %><br> + <%= f.text_field :winner_id %> + </div> + <div class="field"> + <%= f.label :remote_id %><br> + <%= f.text_field :remote_id %> + </div> <div class="actions"> <%= f.submit %> </div> diff --git a/app/views/matches/index.html.erb b/app/views/matches/index.html.erb index d862d57..d463e50 100644 --- a/app/views/matches/index.html.erb +++ b/app/views/matches/index.html.erb @@ -7,6 +7,7 @@ <th>Tournament</th> <th>Name</th> <th>Winner</th> + <th>Remote</th> <th></th> <th></th> <th></th> @@ -21,9 +22,6 @@ <td><%= match.tournament %></td> <td><%= match.name %></td> <td><%= match.winner %></td> - <td><%= link_to 'Show', tournament_match_path(@tournament, match) %></td> - <td><%= link_to 'Edit', edit_tournament_match_path(@tournament, match) %></td> - <td><%= link_to 'Destroy', tournament_match_path(@tournament, match), method: :delete, data: { confirm: 'Are you sure?' } %></td> </tr> <% end %> </tbody> diff --git a/app/views/matches/index.json.jbuilder b/app/views/matches/index.json.jbuilder index 1a63f5f..18f172d 100644 --- a/app/views/matches/index.json.jbuilder +++ b/app/views/matches/index.json.jbuilder @@ -1,4 +1,4 @@ json.array!(@matches) do |match| - json.extract! match, :id, :status, :tournament_id, :name, :winner_id + json.extract! match, :id, :status, :tournament_id, :name, :winner_id, :remote_id json.url match_url(match, format: :json) end diff --git a/app/views/matches/show.html.erb b/app/views/matches/show.html.erb index 6b962ad..53c3b38 100644 --- a/app/views/matches/show.html.erb +++ b/app/views/matches/show.html.erb @@ -32,4 +32,3 @@ </p> <% end %> -<%= link_to 'Back', tournament_matches_path %> diff --git a/app/views/matches/show.json.jbuilder b/app/views/matches/show.json.jbuilder index a3ef588..bfd2be4 100644 --- a/app/views/matches/show.json.jbuilder +++ b/app/views/matches/show.json.jbuilder @@ -1 +1 @@ -json.extract! @match, :id, :status, :tournament_id, :name, :winner_id, :created_at, :updated_at +json.extract! @match, :id, :status, :tournament_id, :name, :winner_id, :remote_id, :created_at, :updated_at diff --git a/app/views/tournaments/_form.html.erb b/app/views/tournaments/_form.html.erb index 38855a0..fe92318 100644 --- a/app/views/tournaments/_form.html.erb +++ b/app/views/tournaments/_form.html.erb @@ -24,24 +24,8 @@ <%= f.number_field :status %> </div> <div class="field"> - <%= f.label :min_players_per_team %><br> - <%= f.number_field :min_players_per_team %> - </div> - <div class="field"> - <%= f.label :max_players_per_team %><br> - <%= f.number_field :max_players_per_team %> - </div> - <div class="field"> - <%= f.label :min_teams_per_match %><br> - <%= f.number_field :min_teams_per_match %> - </div> - <div class="field"> - <%= f.label :max_teams_per_match %><br> - <%= f.number_field :max_teams_per_match %> - </div> - <div class="field"> - <%= f.label :set_rounds %><br> - <%= f.number_field :set_rounds %> + <%= f.label :ger %><br> + <%= f.text_field :ger %> </div> <div class="field"> <%= f.label :randomized_teams %><br> diff --git a/app/views/tournaments/index.html.erb b/app/views/tournaments/index.html.erb index b7c9118..6a86955 100644 --- a/app/views/tournaments/index.html.erb +++ b/app/views/tournaments/index.html.erb @@ -43,7 +43,6 @@ </div> <% end %> - </div> <% else %> <p class="no-entries"> No tournaments going on right now... Why not start your own? </p> diff --git a/app/views/tournaments/index.json.jbuilder b/app/views/tournaments/index.json.jbuilder index 4038f04..653442f 100644 --- a/app/views/tournaments/index.json.jbuilder +++ b/app/views/tournaments/index.json.jbuilder @@ -1,4 +1,4 @@ json.array!(@tournaments) do |tournament| - json.extract! tournament, :id, :name, :game_id, :status, :min_players_per_team, :max_players_per_team, :min_teams_per_match, :max_teams_per_match, :set_rounds, :randomized_teams + json.extract! tournament, :id, :name, :game_id, :status, :ger, :randomized_teams json.url tournament_url(tournament, format: :json) end diff --git a/app/views/tournaments/show.json.jbuilder b/app/views/tournaments/show.json.jbuilder index 27fd5c0..d70a27a 100644 --- a/app/views/tournaments/show.json.jbuilder +++ b/app/views/tournaments/show.json.jbuilder @@ -1 +1 @@ -json.extract! @tournament, :id, :name, :game_id, :status, :min_players_per_team, :max_players_per_team, :min_teams_per_match, :max_teams_per_match, :set_rounds, :randomized_teams, :created_at, :updated_at +json.extract! @tournament, :id, :name, :game_id, :status, :ger, :randomized_teams, :created_at, :updated_at diff --git a/db/migrate/20140325214513_create_servers.rb b/db/migrate/20140401205355_create_servers.rb index f33241a..f33241a 100644 --- a/db/migrate/20140325214513_create_servers.rb +++ b/db/migrate/20140401205355_create_servers.rb diff --git a/db/migrate/20140325214516_create_matches.rb b/db/migrate/20140401205357_create_matches.rb index 30949a8..31eea12 100644 --- a/db/migrate/20140325214516_create_matches.rb +++ b/db/migrate/20140401205357_create_matches.rb @@ -5,6 +5,7 @@ class CreateMatches < ActiveRecord::Migration t.references :tournament, index: true t.string :name t.references :winner, index: true + t.string :remote_id t.timestamps end diff --git a/db/migrate/20140325214518_create_teams.rb b/db/migrate/20140401205400_create_teams.rb index fdf9a68..fdf9a68 100644 --- a/db/migrate/20140325214518_create_teams.rb +++ b/db/migrate/20140401205400_create_teams.rb diff --git a/db/migrate/20140325214521_create_alerts.rb b/db/migrate/20140401205402_create_alerts.rb index 68a8e10..68a8e10 100644 --- a/db/migrate/20140325214521_create_alerts.rb +++ b/db/migrate/20140401205402_create_alerts.rb diff --git a/db/migrate/20140325214523_create_pms.rb b/db/migrate/20140401205405_create_pms.rb index 93bb5c6..93bb5c6 100644 --- a/db/migrate/20140325214523_create_pms.rb +++ b/db/migrate/20140401205405_create_pms.rb diff --git a/db/migrate/20140325214525_create_tournaments.rb b/db/migrate/20140401205407_create_tournaments.rb index c0d8929..3e36441 100644 --- a/db/migrate/20140325214525_create_tournaments.rb +++ b/db/migrate/20140401205407_create_tournaments.rb @@ -4,11 +4,7 @@ class CreateTournaments < ActiveRecord::Migration t.string :name t.references :game, index: true t.integer :status - t.integer :min_players_per_team - t.integer :max_players_per_team - t.integer :min_teams_per_match - t.integer :max_teams_per_match - t.integer :set_rounds + t.string :ger t.boolean :randomized_teams t.timestamps diff --git a/db/migrate/20140325214528_create_games.rb b/db/migrate/20140401205410_create_games.rb index 5e4f56f..5e4f56f 100644 --- a/db/migrate/20140325214528_create_games.rb +++ b/db/migrate/20140401205410_create_games.rb diff --git a/db/migrate/20140325214531_create_users.rb b/db/migrate/20140401205412_create_users.rb index 8032870..8032870 100644 --- a/db/migrate/20140325214531_create_users.rb +++ b/db/migrate/20140401205412_create_users.rb diff --git a/db/migrate/20140325214533_create_sessions.rb b/db/migrate/20140401205415_create_sessions.rb index fe25bf2..fe25bf2 100644 --- a/db/migrate/20140325214533_create_sessions.rb +++ b/db/migrate/20140401205415_create_sessions.rb diff --git a/db/migrate/20140325214536_create_server_settings.rb b/db/migrate/20140401205417_create_server_settings.rb index dfdd91b..dfdd91b 100644 --- a/db/migrate/20140325214536_create_server_settings.rb +++ b/db/migrate/20140401205417_create_server_settings.rb diff --git a/db/migrate/20140325214540_create_game_settings.rb b/db/migrate/20140401205420_create_game_settings.rb index 0ebbf18..0ebbf18 100644 --- a/db/migrate/20140325214540_create_game_settings.rb +++ b/db/migrate/20140401205420_create_game_settings.rb diff --git a/db/migrate/20140325214538_create_tournament_options.rb b/db/migrate/20140401205422_create_tournament_preferences.rb index 53b601c..991d659 100644 --- a/db/migrate/20140325214538_create_tournament_options.rb +++ b/db/migrate/20140401205422_create_tournament_preferences.rb @@ -1,6 +1,6 @@ -class CreateTournamentOptions < ActiveRecord::Migration +class CreateTournamentPreferences < ActiveRecord::Migration def change - create_table :tournament_options do |t| + create_table :tournament_preferences do |t| t.references :tournament, index: true t.integer :vartype t.string :name diff --git a/db/migrate/20140325214543_create_scores.rb b/db/migrate/20140401205424_create_scores.rb index 4ca0b0b..4ca0b0b 100644 --- a/db/migrate/20140325214543_create_scores.rb +++ b/db/migrate/20140401205424_create_scores.rb diff --git a/db/migrate/20140401205427_create_remote_usernames.rb b/db/migrate/20140401205427_create_remote_usernames.rb new file mode 100644 index 0000000..e265985 --- /dev/null +++ b/db/migrate/20140401205427_create_remote_usernames.rb @@ -0,0 +1,11 @@ +class CreateRemoteUsernames < ActiveRecord::Migration + def change + create_table :remote_usernames do |t| + t.references :game, index: true + t.references :user, index: true + t.text :json_value + + t.timestamps + end + end +end diff --git a/db/migrate/20140325214545_create_tournament_players_join_table.rb b/db/migrate/20140401205429_create_tournament_players_join_table.rb index be240e8..be240e8 100644 --- a/db/migrate/20140325214545_create_tournament_players_join_table.rb +++ b/db/migrate/20140401205429_create_tournament_players_join_table.rb diff --git a/db/migrate/20140325214548_create_tournament_hosts_join_table.rb b/db/migrate/20140401205432_create_tournament_hosts_join_table.rb index 7521d89..7521d89 100644 --- a/db/migrate/20140325214548_create_tournament_hosts_join_table.rb +++ b/db/migrate/20140401205432_create_tournament_hosts_join_table.rb diff --git a/db/migrate/20140325214550_create_team_user_join_table.rb b/db/migrate/20140401205434_create_team_user_join_table.rb index f3b57fc..f3b57fc 100644 --- a/db/migrate/20140325214550_create_team_user_join_table.rb +++ b/db/migrate/20140401205434_create_team_user_join_table.rb diff --git a/db/migrate/20140325214553_create_match_team_join_table.rb b/db/migrate/20140401205437_create_match_team_join_table.rb index c2ed1b7..c2ed1b7 100644 --- a/db/migrate/20140325214553_create_match_team_join_table.rb +++ b/db/migrate/20140401205437_create_match_team_join_table.rb diff --git a/db/migrate/20140325214602_add_hidden_attrs_to_user.rb b/db/migrate/20140401205446_add_hidden_attrs_to_user.rb index 2f1b0b2..2f1b0b2 100644 --- a/db/migrate/20140325214602_add_hidden_attrs_to_user.rb +++ b/db/migrate/20140401205446_add_hidden_attrs_to_user.rb diff --git a/db/schema.rb b/db/schema.rb index 4704a45..eda2839 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: 20140325214602) do +ActiveRecord::Schema.define(version: 20140401205446) do create_table "alerts", force: true do |t| t.integer "author_id" @@ -58,6 +58,7 @@ ActiveRecord::Schema.define(version: 20140325214602) do t.integer "tournament_id" t.string "name" t.integer "winner_id" + t.string "remote_id" t.datetime "created_at" t.datetime "updated_at" end @@ -86,6 +87,17 @@ ActiveRecord::Schema.define(version: 20140325214602) do add_index "pms", ["author_id"], name: "index_pms_on_author_id" add_index "pms", ["recipient_id"], name: "index_pms_on_recipient_id" + create_table "remote_usernames", force: true do |t| + t.integer "game_id" + t.integer "user_id" + t.text "json_value" + t.datetime "created_at" + t.datetime "updated_at" + end + + add_index "remote_usernames", ["game_id"], name: "index_remote_usernames_on_game_id" + add_index "remote_usernames", ["user_id"], name: "index_remote_usernames_on_user_id" + create_table "scores", force: true do |t| t.integer "user_id" t.integer "match_id" @@ -128,7 +140,7 @@ ActiveRecord::Schema.define(version: 20140325214602) do t.integer "user_id", null: false end - create_table "tournament_options", force: true do |t| + create_table "tournament_preferences", force: true do |t| t.integer "tournament_id" t.integer "vartype" t.string "name" @@ -137,17 +149,13 @@ ActiveRecord::Schema.define(version: 20140325214602) do t.datetime "updated_at" end - add_index "tournament_options", ["tournament_id"], name: "index_tournament_options_on_tournament_id" + add_index "tournament_preferences", ["tournament_id"], name: "index_tournament_preferences_on_tournament_id" create_table "tournaments", force: true do |t| t.string "name" t.integer "game_id" t.integer "status" - t.integer "min_players_per_team" - t.integer "max_players_per_team" - t.integer "min_teams_per_match" - t.integer "max_teams_per_match" - t.integer "set_rounds" + t.string "ger" t.boolean "randomized_teams" t.datetime "created_at" t.datetime "updated_at" diff --git a/generate.sh b/generate.sh index 328a08f..9c3960f 100755 --- a/generate.sh +++ b/generate.sh @@ -22,10 +22,7 @@ bundle exec rails generate scaffold match status:integer tournament:references n bundle exec rails generate scaffold team match:references $NOTEST bundle exec rails generate scaffold alert author:references message:text $NOTEST bundle exec rails generate scaffold pm author:references recipient:references message:text $NOTEST -bundle exec rails generate scaffold tournament name:string:unique game:references status:integer \ - 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 +bundle exec rails generate scaffold tournament name:string:unique game:references status:integer ger randomized_teams:boolean bundle exec rails generate scaffold game \ name:text \ min_players_per_team:integer max_players_per_team:integer \ @@ -40,6 +37,7 @@ bundle exec rails generate model server_setting $NOTEST bundle exec rails generate model game_setting game:references type:integer name:string default:text discription:text type_opt:text display_order:integer $NOTEST bundle exec rails generate model tournament_preference tournament:references vartype:integer name:string value:text $NOTEST bundle exec rails generate model score user:references match:references value:integer $NOTEST +bundle exec rails generate model remote_username game:references user:references json_value:text # Join tables bundle exec rails generate migration CreateTournamentPlayersJoinTable players tournaments diff --git a/test/controllers/matches_controller_test.rb b/test/controllers/matches_controller_test.rb index c3cc7a4..8782b2c 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, status: @match.status, tournament_id: @match.tournament_id, winner_id: @match.winner_id } + post :create, match: { name: @match.name, remote_id: @match.remote_id, status: @match.status, tournament_id: @match.tournament_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, status: @match.status, 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, tournament_id: @match.tournament_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..775288c 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, ger: @tournament.ger, name: @tournament.name, randomized_teams: @tournament.randomized_teams, 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, ger: @tournament.ger, name: @tournament.name, randomized_teams: @tournament.randomized_teams, status: @tournament.status } assert_redirected_to tournament_path(assigns(:tournament)) end diff --git a/test/fixtures/matches.yml b/test/fixtures/matches.yml index 00af9f5..8e86062 100644 --- a/test/fixtures/matches.yml +++ b/test/fixtures/matches.yml @@ -5,9 +5,11 @@ one: tournament_id: name: MyString winner_id: + remote_id: MyString two: status: 1 tournament_id: name: MyString winner_id: + remote_id: MyString diff --git a/test/fixtures/remote_usernames.yml b/test/fixtures/remote_usernames.yml new file mode 100644 index 0000000..baa1714 --- /dev/null +++ b/test/fixtures/remote_usernames.yml @@ -0,0 +1,11 @@ +# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html + +one: + game_id: + user_id: + json_value: MyText + +two: + game_id: + user_id: + json_value: MyText diff --git a/test/fixtures/tournament_options.yml b/test/fixtures/tournament_preferences.yml index aa5eaef..aa5eaef 100644 --- a/test/fixtures/tournament_options.yml +++ b/test/fixtures/tournament_preferences.yml diff --git a/test/fixtures/tournaments.yml b/test/fixtures/tournaments.yml index 89edc9f..25bb065 100644 --- a/test/fixtures/tournaments.yml +++ b/test/fixtures/tournaments.yml @@ -4,20 +4,12 @@ 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 + ger: MyString 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 + ger: MyString randomized_teams: false diff --git a/test/models/server_settings_test.rb b/test/models/remote_username_test.rb index 470b316..3321b6c 100644 --- a/test/models/server_settings_test.rb +++ b/test/models/remote_username_test.rb @@ -1,6 +1,6 @@ require 'test_helper' -class ServerSettingsTest < ActiveSupport::TestCase +class RemoteUsernameTest < ActiveSupport::TestCase # test "the truth" do # assert true # end diff --git a/test/models/tournament_option_test.rb b/test/models/server_setting_test.rb index 8fa9628..eee32c1 100644 --- a/test/models/tournament_option_test.rb +++ b/test/models/server_setting_test.rb @@ -1,6 +1,6 @@ require 'test_helper' -class TournamentOptionTest < ActiveSupport::TestCase +class ServerSettingTest < ActiveSupport::TestCase # test "the truth" do # assert true # end diff --git a/test/models/tournament_preference_test.rb b/test/models/tournament_preference_test.rb new file mode 100644 index 0000000..e200b8e --- /dev/null +++ b/test/models/tournament_preference_test.rb @@ -0,0 +1,7 @@ +require 'test_helper' + +class TournamentPreferenceTest < ActiveSupport::TestCase + # test "the truth" do + # assert true + # end +end |