From eaf3d3cddf418c560c9619f722ea1dbc5d6cc61a Mon Sep 17 00:00:00 2001 From: DavisLWebb Date: Sun, 2 Mar 2014 15:59:50 -0500 Subject: currently adding Session controller and view --- Gemfile.lock | 8 -- app/assets/javascripts/alerts.js.coffee | 3 + app/assets/javascripts/games.js.coffee | 3 + app/assets/javascripts/main.js.coffee | 3 + app/assets/javascripts/matches.js.coffee | 3 + app/assets/javascripts/pms.js.coffee | 3 + app/assets/javascripts/search.js.coffee | 3 + app/assets/javascripts/servers.js.coffee | 3 + app/assets/javascripts/sessions.js.coffee | 3 + app/assets/javascripts/static.js.coffee | 3 + app/assets/javascripts/teams.js.coffee | 3 + app/assets/javascripts/tournaments.js.coffee | 3 + app/assets/javascripts/users.js.coffee | 3 + app/assets/stylesheets/alerts.css.scss | 3 + app/assets/stylesheets/games.css.scss | 3 + app/assets/stylesheets/main.css.scss | 3 + app/assets/stylesheets/matches.css.scss | 3 + app/assets/stylesheets/pms.css.scss | 3 + app/assets/stylesheets/scaffolds.css.scss | 69 +++++++++ app/assets/stylesheets/search.css.scss | 3 + app/assets/stylesheets/servers.css.scss | 3 + app/assets/stylesheets/sessions.css.scss | 3 + app/assets/stylesheets/static.css.scss | 3 + app/assets/stylesheets/teams.css.scss | 3 + app/assets/stylesheets/tournaments.css.scss | 3 + app/assets/stylesheets/users.css.scss | 3 + app/controllers/alerts_controller.rb | 74 ++++++++++ app/controllers/games_controller.rb | 74 ++++++++++ app/controllers/main_controller.rb | 2 + app/controllers/matches_controller.rb | 74 ++++++++++ app/controllers/pms_controller.rb | 74 ++++++++++ app/controllers/search_controller.rb | 2 + app/controllers/servers_controller.rb | 74 ++++++++++ app/controllers/sessions_controller.rb | 2 + app/controllers/static_controller.rb | 2 + app/controllers/teams_controller.rb | 74 ++++++++++ app/controllers/tournaments_controller.rb | 74 ++++++++++ app/controllers/users_controller.rb | 2 + app/helpers/alerts_helper.rb | 2 + app/helpers/games_helper.rb | 2 + app/helpers/main_helper.rb | 2 + app/helpers/matches_helper.rb | 2 + app/helpers/pms_helper.rb | 2 + app/helpers/search_helper.rb | 2 + app/helpers/servers_helper.rb | 2 + app/helpers/sessions_helper.rb | 2 + app/helpers/static_helper.rb | 2 + app/helpers/teams_helper.rb | 2 + app/helpers/tournaments_helper.rb | 2 + app/helpers/users_helper.rb | 2 + app/models/alert.rb | 3 + app/models/game.rb | 2 + app/models/game_attribute.rb | 3 + app/models/match.rb | 3 + app/models/pm.rb | 4 + app/models/server.rb | 2 + app/models/server_settings.rb | 2 + app/models/team.rb | 2 + app/models/team_match_pair.rb | 4 + app/models/tournament.rb | 3 + app/models/tournament_option.rb | 2 + app/models/user.rb | 2 + app/models/user_team_pair.rb | 4 + app/views/alerts/_form.html.erb | 25 ++++ app/views/alerts/edit.html.erb | 6 + app/views/alerts/index.html.erb | 29 ++++ app/views/alerts/index.json.jbuilder | 4 + app/views/alerts/new.html.erb | 5 + app/views/alerts/show.html.erb | 14 ++ app/views/alerts/show.json.jbuilder | 1 + app/views/games/_form.html.erb | 37 +++++ app/views/games/edit.html.erb | 6 + app/views/games/index.html.erb | 35 +++++ app/views/games/index.json.jbuilder | 4 + app/views/games/new.html.erb | 5 + app/views/games/show.html.erb | 29 ++++ app/views/games/show.json.jbuilder | 1 + app/views/matches/_form.html.erb | 21 +++ app/views/matches/edit.html.erb | 6 + app/views/matches/index.html.erb | 27 ++++ app/views/matches/index.json.jbuilder | 4 + app/views/matches/new.html.erb | 5 + app/views/matches/show.html.erb | 9 ++ app/views/matches/show.json.jbuilder | 1 + app/views/pms/_form.html.erb | 29 ++++ app/views/pms/edit.html.erb | 6 + app/views/pms/index.html.erb | 31 ++++ app/views/pms/index.json.jbuilder | 4 + app/views/pms/new.html.erb | 5 + app/views/pms/show.html.erb | 19 +++ app/views/pms/show.json.jbuilder | 1 + app/views/servers/_form.html.erb | 17 +++ app/views/servers/edit.html.erb | 6 + app/views/servers/index.html.erb | 25 ++++ app/views/servers/index.json.jbuilder | 4 + app/views/servers/new.html.erb | 5 + app/views/servers/show.html.erb | 4 + app/views/servers/show.json.jbuilder | 1 + app/views/teams/_form.html.erb | 17 +++ app/views/teams/edit.html.erb | 6 + app/views/teams/index.html.erb | 25 ++++ app/views/teams/index.json.jbuilder | 4 + app/views/teams/new.html.erb | 5 + app/views/teams/show.html.erb | 4 + app/views/teams/show.json.jbuilder | 1 + app/views/tournaments/_form.html.erb | 21 +++ app/views/tournaments/edit.html.erb | 6 + app/views/tournaments/index.html.erb | 27 ++++ app/views/tournaments/index.json.jbuilder | 4 + app/views/tournaments/new.html.erb | 5 + app/views/tournaments/show.html.erb | 9 ++ app/views/tournaments/show.json.jbuilder | 1 + config/routes.rb | 14 ++ db/migrate/20140304020217_create_servers.rb | 8 ++ db/migrate/20140304020219_create_tournaments.rb | 9 ++ db/migrate/20140304020221_create_matches.rb | 9 ++ db/migrate/20140304020224_create_teams.rb | 8 ++ db/migrate/20140304020230_create_users.rb | 11 ++ .../20140304020233_create_user_team_pairs.rb | 10 ++ .../20140304020235_create_team_match_pairs.rb | 10 ++ db/migrate/20140304020237_create_alerts.rb | 10 ++ db/migrate/20140304020239_create_pms.rb | 11 ++ db/migrate/20140304020242_create_games.rb | 13 ++ .../20140304020244_create_game_attributes.rb | 11 ++ .../20140304020246_create_server_settings.rb | 8 ++ .../20140304020255_create_tournament_options.rb | 8 ++ db/schema.rb | 120 ++++++++++++++++ generate.sh | 1 + spec/controllers/alerts_controller_spec.rb | 160 +++++++++++++++++++++ spec/controllers/games_controller_spec.rb | 160 +++++++++++++++++++++ spec/controllers/main_controller_spec.rb | 5 + spec/controllers/matches_controller_spec.rb | 160 +++++++++++++++++++++ spec/controllers/pms_controller_spec.rb | 160 +++++++++++++++++++++ spec/controllers/search_controller_spec.rb | 5 + spec/controllers/servers_controller_spec.rb | 160 +++++++++++++++++++++ spec/controllers/sessions_controller_spec.rb | 5 + spec/controllers/static_controller_spec.rb | 5 + spec/controllers/teams_controller_spec.rb | 160 +++++++++++++++++++++ spec/controllers/tournaments_controller_spec.rb | 160 +++++++++++++++++++++ spec/controllers/users_controller_spec.rb | 5 + spec/helpers/alerts_helper_spec.rb | 15 ++ spec/helpers/games_helper_spec.rb | 15 ++ spec/helpers/main_helper_spec.rb | 15 ++ spec/helpers/matches_helper_spec.rb | 15 ++ spec/helpers/pms_helper_spec.rb | 15 ++ spec/helpers/search_helper_spec.rb | 15 ++ spec/helpers/servers_helper_spec.rb | 15 ++ spec/helpers/sessions_helper_spec.rb | 15 ++ spec/helpers/static_helper_spec.rb | 15 ++ spec/helpers/teams_helper_spec.rb | 15 ++ spec/helpers/tournaments_helper_spec.rb | 15 ++ spec/helpers/users_helper_spec.rb | 15 ++ spec/models/alert_spec.rb | 5 + spec/models/game_attribute_spec.rb | 5 + spec/models/game_spec.rb | 5 + spec/models/match_spec.rb | 5 + spec/models/pm_spec.rb | 5 + spec/models/server_settings_spec.rb | 5 + spec/models/server_spec.rb | 5 + spec/models/team_match_pair_spec.rb | 5 + spec/models/team_spec.rb | 5 + spec/models/tournament_option_spec.rb | 5 + spec/models/tournament_spec.rb | 5 + spec/models/user_spec.rb | 5 + spec/models/user_team_pair_spec.rb | 5 + spec/requests/alerts_spec.rb | 11 ++ spec/requests/games_spec.rb | 11 ++ spec/requests/matches_spec.rb | 11 ++ spec/requests/pms_spec.rb | 11 ++ spec/requests/servers_spec.rb | 11 ++ spec/requests/teams_spec.rb | 11 ++ spec/requests/tournaments_spec.rb | 11 ++ spec/routing/alerts_routing_spec.rb | 35 +++++ spec/routing/games_routing_spec.rb | 35 +++++ spec/routing/matches_routing_spec.rb | 35 +++++ spec/routing/pms_routing_spec.rb | 35 +++++ spec/routing/servers_routing_spec.rb | 35 +++++ spec/routing/teams_routing_spec.rb | 35 +++++ spec/routing/tournaments_routing_spec.rb | 35 +++++ spec/views/alerts/edit.html.erb_spec.rb | 20 +++ spec/views/alerts/index.html.erb_spec.rb | 23 +++ spec/views/alerts/new.html.erb_spec.rb | 20 +++ spec/views/alerts/show.html.erb_spec.rb | 17 +++ spec/views/games/edit.html.erb_spec.rb | 26 ++++ spec/views/games/index.html.erb_spec.rb | 32 +++++ spec/views/games/new.html.erb_spec.rb | 26 ++++ spec/views/games/show.html.erb_spec.rb | 23 +++ spec/views/matches/edit.html.erb_spec.rb | 18 +++ spec/views/matches/index.html.erb_spec.rb | 20 +++ spec/views/matches/new.html.erb_spec.rb | 18 +++ spec/views/matches/show.html.erb_spec.rb | 15 ++ spec/views/pms/edit.html.erb_spec.rb | 22 +++ spec/views/pms/index.html.erb_spec.rb | 26 ++++ spec/views/pms/new.html.erb_spec.rb | 22 +++ spec/views/pms/show.html.erb_spec.rb | 19 +++ spec/views/servers/edit.html.erb_spec.rb | 15 ++ spec/views/servers/index.html.erb_spec.rb | 15 ++ spec/views/servers/new.html.erb_spec.rb | 15 ++ spec/views/servers/show.html.erb_spec.rb | 12 ++ spec/views/teams/edit.html.erb_spec.rb | 15 ++ spec/views/teams/index.html.erb_spec.rb | 15 ++ spec/views/teams/new.html.erb_spec.rb | 15 ++ spec/views/teams/show.html.erb_spec.rb | 12 ++ spec/views/tournaments/edit.html.erb_spec.rb | 18 +++ spec/views/tournaments/index.html.erb_spec.rb | 20 +++ spec/views/tournaments/new.html.erb_spec.rb | 18 +++ spec/views/tournaments/show.html.erb_spec.rb | 15 ++ 207 files changed, 3800 insertions(+), 8 deletions(-) create mode 100644 app/assets/javascripts/alerts.js.coffee create mode 100644 app/assets/javascripts/games.js.coffee create mode 100644 app/assets/javascripts/main.js.coffee create mode 100644 app/assets/javascripts/matches.js.coffee create mode 100644 app/assets/javascripts/pms.js.coffee create mode 100644 app/assets/javascripts/search.js.coffee create mode 100644 app/assets/javascripts/servers.js.coffee create mode 100644 app/assets/javascripts/sessions.js.coffee create mode 100644 app/assets/javascripts/static.js.coffee create mode 100644 app/assets/javascripts/teams.js.coffee create mode 100644 app/assets/javascripts/tournaments.js.coffee create mode 100644 app/assets/javascripts/users.js.coffee create mode 100644 app/assets/stylesheets/alerts.css.scss create mode 100644 app/assets/stylesheets/games.css.scss create mode 100644 app/assets/stylesheets/main.css.scss create mode 100644 app/assets/stylesheets/matches.css.scss create mode 100644 app/assets/stylesheets/pms.css.scss create mode 100644 app/assets/stylesheets/scaffolds.css.scss create mode 100644 app/assets/stylesheets/search.css.scss create mode 100644 app/assets/stylesheets/servers.css.scss create mode 100644 app/assets/stylesheets/sessions.css.scss create mode 100644 app/assets/stylesheets/static.css.scss create mode 100644 app/assets/stylesheets/teams.css.scss create mode 100644 app/assets/stylesheets/tournaments.css.scss create mode 100644 app/assets/stylesheets/users.css.scss create mode 100644 app/controllers/alerts_controller.rb create mode 100644 app/controllers/games_controller.rb create mode 100644 app/controllers/main_controller.rb create mode 100644 app/controllers/matches_controller.rb create mode 100644 app/controllers/pms_controller.rb create mode 100644 app/controllers/search_controller.rb create mode 100644 app/controllers/servers_controller.rb create mode 100644 app/controllers/sessions_controller.rb create mode 100644 app/controllers/static_controller.rb create mode 100644 app/controllers/teams_controller.rb create mode 100644 app/controllers/tournaments_controller.rb create mode 100644 app/controllers/users_controller.rb create mode 100644 app/helpers/alerts_helper.rb create mode 100644 app/helpers/games_helper.rb create mode 100644 app/helpers/main_helper.rb create mode 100644 app/helpers/matches_helper.rb create mode 100644 app/helpers/pms_helper.rb create mode 100644 app/helpers/search_helper.rb create mode 100644 app/helpers/servers_helper.rb create mode 100644 app/helpers/sessions_helper.rb create mode 100644 app/helpers/static_helper.rb create mode 100644 app/helpers/teams_helper.rb create mode 100644 app/helpers/tournaments_helper.rb create mode 100644 app/helpers/users_helper.rb create mode 100644 app/models/alert.rb create mode 100644 app/models/game.rb create mode 100644 app/models/game_attribute.rb create mode 100644 app/models/match.rb create mode 100644 app/models/pm.rb create mode 100644 app/models/server.rb create mode 100644 app/models/server_settings.rb create mode 100644 app/models/team.rb create mode 100644 app/models/team_match_pair.rb create mode 100644 app/models/tournament.rb create mode 100644 app/models/tournament_option.rb create mode 100644 app/models/user.rb create mode 100644 app/models/user_team_pair.rb create mode 100644 app/views/alerts/_form.html.erb create mode 100644 app/views/alerts/edit.html.erb create mode 100644 app/views/alerts/index.html.erb create mode 100644 app/views/alerts/index.json.jbuilder create mode 100644 app/views/alerts/new.html.erb create mode 100644 app/views/alerts/show.html.erb create mode 100644 app/views/alerts/show.json.jbuilder create mode 100644 app/views/games/_form.html.erb create mode 100644 app/views/games/edit.html.erb create mode 100644 app/views/games/index.html.erb create mode 100644 app/views/games/index.json.jbuilder create mode 100644 app/views/games/new.html.erb create mode 100644 app/views/games/show.html.erb create mode 100644 app/views/games/show.json.jbuilder create mode 100644 app/views/matches/_form.html.erb create mode 100644 app/views/matches/edit.html.erb create mode 100644 app/views/matches/index.html.erb create mode 100644 app/views/matches/index.json.jbuilder create mode 100644 app/views/matches/new.html.erb create mode 100644 app/views/matches/show.html.erb create mode 100644 app/views/matches/show.json.jbuilder create mode 100644 app/views/pms/_form.html.erb create mode 100644 app/views/pms/edit.html.erb create mode 100644 app/views/pms/index.html.erb create mode 100644 app/views/pms/index.json.jbuilder create mode 100644 app/views/pms/new.html.erb create mode 100644 app/views/pms/show.html.erb create mode 100644 app/views/pms/show.json.jbuilder create mode 100644 app/views/servers/_form.html.erb create mode 100644 app/views/servers/edit.html.erb create mode 100644 app/views/servers/index.html.erb create mode 100644 app/views/servers/index.json.jbuilder create mode 100644 app/views/servers/new.html.erb create mode 100644 app/views/servers/show.html.erb create mode 100644 app/views/servers/show.json.jbuilder create mode 100644 app/views/teams/_form.html.erb create mode 100644 app/views/teams/edit.html.erb create mode 100644 app/views/teams/index.html.erb create mode 100644 app/views/teams/index.json.jbuilder create mode 100644 app/views/teams/new.html.erb create mode 100644 app/views/teams/show.html.erb create mode 100644 app/views/teams/show.json.jbuilder create mode 100644 app/views/tournaments/_form.html.erb create mode 100644 app/views/tournaments/edit.html.erb create mode 100644 app/views/tournaments/index.html.erb create mode 100644 app/views/tournaments/index.json.jbuilder create mode 100644 app/views/tournaments/new.html.erb create mode 100644 app/views/tournaments/show.html.erb create mode 100644 app/views/tournaments/show.json.jbuilder create mode 100644 db/migrate/20140304020217_create_servers.rb create mode 100644 db/migrate/20140304020219_create_tournaments.rb create mode 100644 db/migrate/20140304020221_create_matches.rb create mode 100644 db/migrate/20140304020224_create_teams.rb create mode 100644 db/migrate/20140304020230_create_users.rb create mode 100644 db/migrate/20140304020233_create_user_team_pairs.rb create mode 100644 db/migrate/20140304020235_create_team_match_pairs.rb create mode 100644 db/migrate/20140304020237_create_alerts.rb create mode 100644 db/migrate/20140304020239_create_pms.rb create mode 100644 db/migrate/20140304020242_create_games.rb create mode 100644 db/migrate/20140304020244_create_game_attributes.rb create mode 100644 db/migrate/20140304020246_create_server_settings.rb create mode 100644 db/migrate/20140304020255_create_tournament_options.rb create mode 100644 db/schema.rb create mode 100644 spec/controllers/alerts_controller_spec.rb create mode 100644 spec/controllers/games_controller_spec.rb create mode 100644 spec/controllers/main_controller_spec.rb create mode 100644 spec/controllers/matches_controller_spec.rb create mode 100644 spec/controllers/pms_controller_spec.rb create mode 100644 spec/controllers/search_controller_spec.rb create mode 100644 spec/controllers/servers_controller_spec.rb create mode 100644 spec/controllers/sessions_controller_spec.rb create mode 100644 spec/controllers/static_controller_spec.rb create mode 100644 spec/controllers/teams_controller_spec.rb create mode 100644 spec/controllers/tournaments_controller_spec.rb create mode 100644 spec/controllers/users_controller_spec.rb create mode 100644 spec/helpers/alerts_helper_spec.rb create mode 100644 spec/helpers/games_helper_spec.rb create mode 100644 spec/helpers/main_helper_spec.rb create mode 100644 spec/helpers/matches_helper_spec.rb create mode 100644 spec/helpers/pms_helper_spec.rb create mode 100644 spec/helpers/search_helper_spec.rb create mode 100644 spec/helpers/servers_helper_spec.rb create mode 100644 spec/helpers/sessions_helper_spec.rb create mode 100644 spec/helpers/static_helper_spec.rb create mode 100644 spec/helpers/teams_helper_spec.rb create mode 100644 spec/helpers/tournaments_helper_spec.rb create mode 100644 spec/helpers/users_helper_spec.rb create mode 100644 spec/models/alert_spec.rb create mode 100644 spec/models/game_attribute_spec.rb create mode 100644 spec/models/game_spec.rb create mode 100644 spec/models/match_spec.rb create mode 100644 spec/models/pm_spec.rb create mode 100644 spec/models/server_settings_spec.rb create mode 100644 spec/models/server_spec.rb create mode 100644 spec/models/team_match_pair_spec.rb create mode 100644 spec/models/team_spec.rb create mode 100644 spec/models/tournament_option_spec.rb create mode 100644 spec/models/tournament_spec.rb create mode 100644 spec/models/user_spec.rb create mode 100644 spec/models/user_team_pair_spec.rb create mode 100644 spec/requests/alerts_spec.rb create mode 100644 spec/requests/games_spec.rb create mode 100644 spec/requests/matches_spec.rb create mode 100644 spec/requests/pms_spec.rb create mode 100644 spec/requests/servers_spec.rb create mode 100644 spec/requests/teams_spec.rb create mode 100644 spec/requests/tournaments_spec.rb create mode 100644 spec/routing/alerts_routing_spec.rb create mode 100644 spec/routing/games_routing_spec.rb create mode 100644 spec/routing/matches_routing_spec.rb create mode 100644 spec/routing/pms_routing_spec.rb create mode 100644 spec/routing/servers_routing_spec.rb create mode 100644 spec/routing/teams_routing_spec.rb create mode 100644 spec/routing/tournaments_routing_spec.rb create mode 100644 spec/views/alerts/edit.html.erb_spec.rb create mode 100644 spec/views/alerts/index.html.erb_spec.rb create mode 100644 spec/views/alerts/new.html.erb_spec.rb create mode 100644 spec/views/alerts/show.html.erb_spec.rb create mode 100644 spec/views/games/edit.html.erb_spec.rb create mode 100644 spec/views/games/index.html.erb_spec.rb create mode 100644 spec/views/games/new.html.erb_spec.rb create mode 100644 spec/views/games/show.html.erb_spec.rb create mode 100644 spec/views/matches/edit.html.erb_spec.rb create mode 100644 spec/views/matches/index.html.erb_spec.rb create mode 100644 spec/views/matches/new.html.erb_spec.rb create mode 100644 spec/views/matches/show.html.erb_spec.rb create mode 100644 spec/views/pms/edit.html.erb_spec.rb create mode 100644 spec/views/pms/index.html.erb_spec.rb create mode 100644 spec/views/pms/new.html.erb_spec.rb create mode 100644 spec/views/pms/show.html.erb_spec.rb create mode 100644 spec/views/servers/edit.html.erb_spec.rb create mode 100644 spec/views/servers/index.html.erb_spec.rb create mode 100644 spec/views/servers/new.html.erb_spec.rb create mode 100644 spec/views/servers/show.html.erb_spec.rb create mode 100644 spec/views/teams/edit.html.erb_spec.rb create mode 100644 spec/views/teams/index.html.erb_spec.rb create mode 100644 spec/views/teams/new.html.erb_spec.rb create mode 100644 spec/views/teams/show.html.erb_spec.rb create mode 100644 spec/views/tournaments/edit.html.erb_spec.rb create mode 100644 spec/views/tournaments/index.html.erb_spec.rb create mode 100644 spec/views/tournaments/new.html.erb_spec.rb create mode 100644 spec/views/tournaments/show.html.erb_spec.rb diff --git a/Gemfile.lock b/Gemfile.lock index 9de990e..9dd0199 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -26,11 +26,7 @@ GEM thread_safe (~> 0.1) tzinfo (~> 0.3.37) arel (4.0.2) -<<<<<<< HEAD atomic (1.1.15) -======= - atomic (1.1.14) ->>>>>>> 699bd065c06689a159c11ac3aacef6b34001617c bcrypt-ruby (3.1.2) bootstrap-sass (3.1.1.0) sass (~> 3.2) @@ -119,11 +115,7 @@ GEM multi_json (~> 1.0) rubyzip (< 1.0.0) websocket (~> 1.0.4) -<<<<<<< HEAD sprockets (2.11.0) -======= - sprockets (2.10.1) ->>>>>>> 699bd065c06689a159c11ac3aacef6b34001617c hike (~> 1.2) multi_json (~> 1.0) rack (~> 1.0) diff --git a/app/assets/javascripts/alerts.js.coffee b/app/assets/javascripts/alerts.js.coffee new file mode 100644 index 0000000..24f83d1 --- /dev/null +++ b/app/assets/javascripts/alerts.js.coffee @@ -0,0 +1,3 @@ +# Place all the behaviors and hooks related to the matching controller here. +# All this logic will automatically be available in application.js. +# You can use CoffeeScript in this file: http://coffeescript.org/ diff --git a/app/assets/javascripts/games.js.coffee b/app/assets/javascripts/games.js.coffee new file mode 100644 index 0000000..24f83d1 --- /dev/null +++ b/app/assets/javascripts/games.js.coffee @@ -0,0 +1,3 @@ +# Place all the behaviors and hooks related to the matching controller here. +# All this logic will automatically be available in application.js. +# You can use CoffeeScript in this file: http://coffeescript.org/ diff --git a/app/assets/javascripts/main.js.coffee b/app/assets/javascripts/main.js.coffee new file mode 100644 index 0000000..24f83d1 --- /dev/null +++ b/app/assets/javascripts/main.js.coffee @@ -0,0 +1,3 @@ +# Place all the behaviors and hooks related to the matching controller here. +# All this logic will automatically be available in application.js. +# You can use CoffeeScript in this file: http://coffeescript.org/ diff --git a/app/assets/javascripts/matches.js.coffee b/app/assets/javascripts/matches.js.coffee new file mode 100644 index 0000000..24f83d1 --- /dev/null +++ b/app/assets/javascripts/matches.js.coffee @@ -0,0 +1,3 @@ +# Place all the behaviors and hooks related to the matching controller here. +# All this logic will automatically be available in application.js. +# You can use CoffeeScript in this file: http://coffeescript.org/ diff --git a/app/assets/javascripts/pms.js.coffee b/app/assets/javascripts/pms.js.coffee new file mode 100644 index 0000000..24f83d1 --- /dev/null +++ b/app/assets/javascripts/pms.js.coffee @@ -0,0 +1,3 @@ +# Place all the behaviors and hooks related to the matching controller here. +# All this logic will automatically be available in application.js. +# You can use CoffeeScript in this file: http://coffeescript.org/ diff --git a/app/assets/javascripts/search.js.coffee b/app/assets/javascripts/search.js.coffee new file mode 100644 index 0000000..24f83d1 --- /dev/null +++ b/app/assets/javascripts/search.js.coffee @@ -0,0 +1,3 @@ +# Place all the behaviors and hooks related to the matching controller here. +# All this logic will automatically be available in application.js. +# You can use CoffeeScript in this file: http://coffeescript.org/ diff --git a/app/assets/javascripts/servers.js.coffee b/app/assets/javascripts/servers.js.coffee new file mode 100644 index 0000000..24f83d1 --- /dev/null +++ b/app/assets/javascripts/servers.js.coffee @@ -0,0 +1,3 @@ +# Place all the behaviors and hooks related to the matching controller here. +# All this logic will automatically be available in application.js. +# You can use CoffeeScript in this file: http://coffeescript.org/ diff --git a/app/assets/javascripts/sessions.js.coffee b/app/assets/javascripts/sessions.js.coffee new file mode 100644 index 0000000..24f83d1 --- /dev/null +++ b/app/assets/javascripts/sessions.js.coffee @@ -0,0 +1,3 @@ +# Place all the behaviors and hooks related to the matching controller here. +# All this logic will automatically be available in application.js. +# You can use CoffeeScript in this file: http://coffeescript.org/ diff --git a/app/assets/javascripts/static.js.coffee b/app/assets/javascripts/static.js.coffee new file mode 100644 index 0000000..24f83d1 --- /dev/null +++ b/app/assets/javascripts/static.js.coffee @@ -0,0 +1,3 @@ +# Place all the behaviors and hooks related to the matching controller here. +# All this logic will automatically be available in application.js. +# You can use CoffeeScript in this file: http://coffeescript.org/ diff --git a/app/assets/javascripts/teams.js.coffee b/app/assets/javascripts/teams.js.coffee new file mode 100644 index 0000000..24f83d1 --- /dev/null +++ b/app/assets/javascripts/teams.js.coffee @@ -0,0 +1,3 @@ +# Place all the behaviors and hooks related to the matching controller here. +# All this logic will automatically be available in application.js. +# You can use CoffeeScript in this file: http://coffeescript.org/ diff --git a/app/assets/javascripts/tournaments.js.coffee b/app/assets/javascripts/tournaments.js.coffee new file mode 100644 index 0000000..24f83d1 --- /dev/null +++ b/app/assets/javascripts/tournaments.js.coffee @@ -0,0 +1,3 @@ +# Place all the behaviors and hooks related to the matching controller here. +# All this logic will automatically be available in application.js. +# You can use CoffeeScript in this file: http://coffeescript.org/ diff --git a/app/assets/javascripts/users.js.coffee b/app/assets/javascripts/users.js.coffee new file mode 100644 index 0000000..24f83d1 --- /dev/null +++ b/app/assets/javascripts/users.js.coffee @@ -0,0 +1,3 @@ +# Place all the behaviors and hooks related to the matching controller here. +# All this logic will automatically be available in application.js. +# You can use CoffeeScript in this file: http://coffeescript.org/ diff --git a/app/assets/stylesheets/alerts.css.scss b/app/assets/stylesheets/alerts.css.scss new file mode 100644 index 0000000..c01a620 --- /dev/null +++ b/app/assets/stylesheets/alerts.css.scss @@ -0,0 +1,3 @@ +// Place all the styles related to the alerts controller here. +// They will automatically be included in application.css. +// You can use Sass (SCSS) here: http://sass-lang.com/ diff --git a/app/assets/stylesheets/games.css.scss b/app/assets/stylesheets/games.css.scss new file mode 100644 index 0000000..db1b7bc --- /dev/null +++ b/app/assets/stylesheets/games.css.scss @@ -0,0 +1,3 @@ +// Place all the styles related to the games controller here. +// They will automatically be included in application.css. +// You can use Sass (SCSS) here: http://sass-lang.com/ diff --git a/app/assets/stylesheets/main.css.scss b/app/assets/stylesheets/main.css.scss new file mode 100644 index 0000000..a0d94c1 --- /dev/null +++ b/app/assets/stylesheets/main.css.scss @@ -0,0 +1,3 @@ +// Place all the styles related to the main controller here. +// They will automatically be included in application.css. +// You can use Sass (SCSS) here: http://sass-lang.com/ diff --git a/app/assets/stylesheets/matches.css.scss b/app/assets/stylesheets/matches.css.scss new file mode 100644 index 0000000..4c396e3 --- /dev/null +++ b/app/assets/stylesheets/matches.css.scss @@ -0,0 +1,3 @@ +// Place all the styles related to the matches controller here. +// They will automatically be included in application.css. +// You can use Sass (SCSS) here: http://sass-lang.com/ diff --git a/app/assets/stylesheets/pms.css.scss b/app/assets/stylesheets/pms.css.scss new file mode 100644 index 0000000..5106093 --- /dev/null +++ b/app/assets/stylesheets/pms.css.scss @@ -0,0 +1,3 @@ +// Place all the styles related to the pms controller here. +// They will automatically be included in application.css. +// You can use Sass (SCSS) here: http://sass-lang.com/ diff --git a/app/assets/stylesheets/scaffolds.css.scss b/app/assets/stylesheets/scaffolds.css.scss new file mode 100644 index 0000000..6ec6a8f --- /dev/null +++ b/app/assets/stylesheets/scaffolds.css.scss @@ -0,0 +1,69 @@ +body { + background-color: #fff; + color: #333; + font-family: verdana, arial, helvetica, sans-serif; + font-size: 13px; + line-height: 18px; +} + +p, ol, ul, td { + font-family: verdana, arial, helvetica, sans-serif; + font-size: 13px; + line-height: 18px; +} + +pre { + background-color: #eee; + padding: 10px; + font-size: 11px; +} + +a { + color: #000; + &:visited { + color: #666; + } + &:hover { + color: #fff; + background-color: #000; + } +} + +div { + &.field, &.actions { + margin-bottom: 10px; + } +} + +#notice { + color: green; +} + +.field_with_errors { + padding: 2px; + background-color: red; + display: table; +} + +#error_explanation { + width: 450px; + border: 2px solid red; + padding: 7px; + padding-bottom: 0; + margin-bottom: 20px; + background-color: #f0f0f0; + h2 { + text-align: left; + font-weight: bold; + padding: 5px 5px 5px 15px; + font-size: 12px; + margin: -7px; + margin-bottom: 0px; + background-color: #c00; + color: #fff; + } + ul li { + font-size: 12px; + list-style: square; + } +} diff --git a/app/assets/stylesheets/search.css.scss b/app/assets/stylesheets/search.css.scss new file mode 100644 index 0000000..22fd394 --- /dev/null +++ b/app/assets/stylesheets/search.css.scss @@ -0,0 +1,3 @@ +// Place all the styles related to the search controller here. +// They will automatically be included in application.css. +// You can use Sass (SCSS) here: http://sass-lang.com/ diff --git a/app/assets/stylesheets/servers.css.scss b/app/assets/stylesheets/servers.css.scss new file mode 100644 index 0000000..4710386 --- /dev/null +++ b/app/assets/stylesheets/servers.css.scss @@ -0,0 +1,3 @@ +// Place all the styles related to the servers controller here. +// They will automatically be included in application.css. +// You can use Sass (SCSS) here: http://sass-lang.com/ diff --git a/app/assets/stylesheets/sessions.css.scss b/app/assets/stylesheets/sessions.css.scss new file mode 100644 index 0000000..ccb1ed2 --- /dev/null +++ b/app/assets/stylesheets/sessions.css.scss @@ -0,0 +1,3 @@ +// Place all the styles related to the Sessions controller here. +// They will automatically be included in application.css. +// You can use Sass (SCSS) here: http://sass-lang.com/ diff --git a/app/assets/stylesheets/static.css.scss b/app/assets/stylesheets/static.css.scss new file mode 100644 index 0000000..5a803c8 --- /dev/null +++ b/app/assets/stylesheets/static.css.scss @@ -0,0 +1,3 @@ +// Place all the styles related to the static controller here. +// They will automatically be included in application.css. +// You can use Sass (SCSS) here: http://sass-lang.com/ diff --git a/app/assets/stylesheets/teams.css.scss b/app/assets/stylesheets/teams.css.scss new file mode 100644 index 0000000..320d00d --- /dev/null +++ b/app/assets/stylesheets/teams.css.scss @@ -0,0 +1,3 @@ +// Place all the styles related to the teams controller here. +// They will automatically be included in application.css. +// You can use Sass (SCSS) here: http://sass-lang.com/ diff --git a/app/assets/stylesheets/tournaments.css.scss b/app/assets/stylesheets/tournaments.css.scss new file mode 100644 index 0000000..e372b90 --- /dev/null +++ b/app/assets/stylesheets/tournaments.css.scss @@ -0,0 +1,3 @@ +// Place all the styles related to the tournaments controller here. +// They will automatically be included in application.css. +// You can use Sass (SCSS) here: http://sass-lang.com/ diff --git a/app/assets/stylesheets/users.css.scss b/app/assets/stylesheets/users.css.scss new file mode 100644 index 0000000..1efc835 --- /dev/null +++ b/app/assets/stylesheets/users.css.scss @@ -0,0 +1,3 @@ +// Place all the styles related to the users controller here. +// They will automatically be included in application.css. +// You can use Sass (SCSS) here: http://sass-lang.com/ diff --git a/app/controllers/alerts_controller.rb b/app/controllers/alerts_controller.rb new file mode 100644 index 0000000..873e9b7 --- /dev/null +++ b/app/controllers/alerts_controller.rb @@ -0,0 +1,74 @@ +class AlertsController < ApplicationController + before_action :set_alert, only: [:show, :edit, :update, :destroy] + + # GET /alerts + # GET /alerts.json + def index + @alerts = Alert.all + end + + # GET /alerts/1 + # GET /alerts/1.json + def show + end + + # GET /alerts/new + def new + @alert = Alert.new + end + + # GET /alerts/1/edit + def edit + end + + # POST /alerts + # POST /alerts.json + def create + @alert = Alert.new(alert_params) + + respond_to do |format| + if @alert.save + format.html { redirect_to @alert, notice: 'Alert was successfully created.' } + format.json { render action: 'show', status: :created, location: @alert } + else + format.html { render action: 'new' } + format.json { render json: @alert.errors, status: :unprocessable_entity } + end + end + end + + # PATCH/PUT /alerts/1 + # PATCH/PUT /alerts/1.json + def update + respond_to do |format| + if @alert.update(alert_params) + format.html { redirect_to @alert, notice: 'Alert was successfully updated.' } + format.json { head :no_content } + else + format.html { render action: 'edit' } + format.json { render json: @alert.errors, status: :unprocessable_entity } + end + end + end + + # DELETE /alerts/1 + # DELETE /alerts/1.json + def destroy + @alert.destroy + respond_to do |format| + format.html { redirect_to alerts_url } + format.json { head :no_content } + end + end + + private + # Use callbacks to share common setup or constraints between actions. + def set_alert + @alert = Alert.find(params[:id]) + end + + # Never trust parameters from the scary internet, only allow the white list through. + def alert_params + params.require(:alert).permit(:author_id, :message) + end +end diff --git a/app/controllers/games_controller.rb b/app/controllers/games_controller.rb new file mode 100644 index 0000000..4ecff17 --- /dev/null +++ b/app/controllers/games_controller.rb @@ -0,0 +1,74 @@ +class GamesController < ApplicationController + before_action :set_game, only: [:show, :edit, :update, :destroy] + + # GET /games + # GET /games.json + def index + @games = Game.all + end + + # GET /games/1 + # GET /games/1.json + def show + end + + # GET /games/new + def new + @game = Game.new + end + + # GET /games/1/edit + def edit + end + + # POST /games + # POST /games.json + def create + @game = Game.new(game_params) + + respond_to do |format| + if @game.save + format.html { redirect_to @game, notice: 'Game was successfully created.' } + format.json { render action: 'show', status: :created, location: @game } + else + format.html { render action: 'new' } + format.json { render json: @game.errors, status: :unprocessable_entity } + end + end + end + + # PATCH/PUT /games/1 + # PATCH/PUT /games/1.json + def update + respond_to do |format| + if @game.update(game_params) + format.html { redirect_to @game, notice: 'Game was successfully updated.' } + format.json { head :no_content } + else + format.html { render action: 'edit' } + format.json { render json: @game.errors, status: :unprocessable_entity } + end + end + end + + # DELETE /games/1 + # DELETE /games/1.json + def destroy + @game.destroy + respond_to do |format| + format.html { redirect_to games_url } + format.json { head :no_content } + end + end + + private + # Use callbacks to share common setup or constraints between actions. + def set_game + @game = Game.find(params[:id]) + end + + # Never trust parameters from the scary internet, only allow the white list through. + def game_params + params.require(:game).permit(:name, :players_per_team, :teams_per_match, :set_rounds, :randomized_teams) + end +end diff --git a/app/controllers/main_controller.rb b/app/controllers/main_controller.rb new file mode 100644 index 0000000..6519d7b --- /dev/null +++ b/app/controllers/main_controller.rb @@ -0,0 +1,2 @@ +class MainController < ApplicationController +end diff --git a/app/controllers/matches_controller.rb b/app/controllers/matches_controller.rb new file mode 100644 index 0000000..e9f3c5a --- /dev/null +++ b/app/controllers/matches_controller.rb @@ -0,0 +1,74 @@ +class MatchesController < ApplicationController + before_action :set_match, only: [:show, :edit, :update, :destroy] + + # GET /matches + # GET /matches.json + def index + @matches = Match.all + end + + # GET /matches/1 + # GET /matches/1.json + def show + end + + # GET /matches/new + def new + @match = Match.new + end + + # GET /matches/1/edit + def edit + end + + # POST /matches + # POST /matches.json + def create + @match = Match.new(match_params) + + respond_to do |format| + if @match.save + format.html { redirect_to @match, notice: 'Match was successfully created.' } + format.json { render action: 'show', status: :created, location: @match } + else + format.html { render action: 'new' } + format.json { render json: @match.errors, status: :unprocessable_entity } + end + end + end + + # PATCH/PUT /matches/1 + # PATCH/PUT /matches/1.json + def update + respond_to do |format| + if @match.update(match_params) + format.html { redirect_to @match, notice: 'Match was successfully updated.' } + format.json { head :no_content } + else + format.html { render action: 'edit' } + format.json { render json: @match.errors, status: :unprocessable_entity } + end + end + end + + # DELETE /matches/1 + # DELETE /matches/1.json + def destroy + @match.destroy + respond_to do |format| + format.html { redirect_to matches_url } + format.json { head :no_content } + end + end + + private + # Use callbacks to share common setup or constraints between actions. + def set_match + @match = Match.find(params[:id]) + end + + # Never trust parameters from the scary internet, only allow the white list through. + def match_params + params.require(:match).permit(:tournament_id) + end +end diff --git a/app/controllers/pms_controller.rb b/app/controllers/pms_controller.rb new file mode 100644 index 0000000..5dd0d69 --- /dev/null +++ b/app/controllers/pms_controller.rb @@ -0,0 +1,74 @@ +class PmsController < ApplicationController + before_action :set_pm, only: [:show, :edit, :update, :destroy] + + # GET /pms + # GET /pms.json + def index + @pms = Pm.all + end + + # GET /pms/1 + # GET /pms/1.json + def show + end + + # GET /pms/new + def new + @pm = Pm.new + end + + # GET /pms/1/edit + def edit + end + + # POST /pms + # POST /pms.json + def create + @pm = Pm.new(pm_params) + + respond_to do |format| + if @pm.save + format.html { redirect_to @pm, notice: 'Pm was successfully created.' } + format.json { render action: 'show', status: :created, location: @pm } + else + format.html { render action: 'new' } + format.json { render json: @pm.errors, status: :unprocessable_entity } + end + end + end + + # PATCH/PUT /pms/1 + # PATCH/PUT /pms/1.json + def update + respond_to do |format| + if @pm.update(pm_params) + format.html { redirect_to @pm, notice: 'Pm was successfully updated.' } + format.json { head :no_content } + else + format.html { render action: 'edit' } + format.json { render json: @pm.errors, status: :unprocessable_entity } + end + end + end + + # DELETE /pms/1 + # DELETE /pms/1.json + def destroy + @pm.destroy + respond_to do |format| + format.html { redirect_to pms_url } + format.json { head :no_content } + end + end + + private + # Use callbacks to share common setup or constraints between actions. + def set_pm + @pm = Pm.find(params[:id]) + end + + # Never trust parameters from the scary internet, only allow the white list through. + def pm_params + params.require(:pm).permit(:author_id, :recipient_id, :message) + end +end diff --git a/app/controllers/search_controller.rb b/app/controllers/search_controller.rb new file mode 100644 index 0000000..ee61487 --- /dev/null +++ b/app/controllers/search_controller.rb @@ -0,0 +1,2 @@ +class SearchController < ApplicationController +end diff --git a/app/controllers/servers_controller.rb b/app/controllers/servers_controller.rb new file mode 100644 index 0000000..7d54eb6 --- /dev/null +++ b/app/controllers/servers_controller.rb @@ -0,0 +1,74 @@ +class ServersController < ApplicationController + before_action :set_server, only: [:show, :edit, :update, :destroy] + + # GET /servers + # GET /servers.json + def index + @servers = Server.all + end + + # GET /servers/1 + # GET /servers/1.json + def show + end + + # GET /servers/new + def new + @server = Server.new + end + + # GET /servers/1/edit + def edit + end + + # POST /servers + # POST /servers.json + def create + @server = Server.new(server_params) + + respond_to do |format| + if @server.save + format.html { redirect_to @server, notice: 'Server was successfully created.' } + format.json { render action: 'show', status: :created, location: @server } + else + format.html { render action: 'new' } + format.json { render json: @server.errors, status: :unprocessable_entity } + end + end + end + + # PATCH/PUT /servers/1 + # PATCH/PUT /servers/1.json + def update + respond_to do |format| + if @server.update(server_params) + format.html { redirect_to @server, notice: 'Server was successfully updated.' } + format.json { head :no_content } + else + format.html { render action: 'edit' } + format.json { render json: @server.errors, status: :unprocessable_entity } + end + end + end + + # DELETE /servers/1 + # DELETE /servers/1.json + def destroy + @server.destroy + respond_to do |format| + format.html { redirect_to servers_url } + format.json { head :no_content } + end + end + + private + # Use callbacks to share common setup or constraints between actions. + def set_server + @server = Server.find(params[:id]) + end + + # Never trust parameters from the scary internet, only allow the white list through. + def server_params + params[:server] + end +end diff --git a/app/controllers/sessions_controller.rb b/app/controllers/sessions_controller.rb new file mode 100644 index 0000000..16d11b5 --- /dev/null +++ b/app/controllers/sessions_controller.rb @@ -0,0 +1,2 @@ +class SessionsController < ApplicationController +end diff --git a/app/controllers/static_controller.rb b/app/controllers/static_controller.rb new file mode 100644 index 0000000..c6df11e --- /dev/null +++ b/app/controllers/static_controller.rb @@ -0,0 +1,2 @@ +class StaticController < ApplicationController +end diff --git a/app/controllers/teams_controller.rb b/app/controllers/teams_controller.rb new file mode 100644 index 0000000..f14c97f --- /dev/null +++ b/app/controllers/teams_controller.rb @@ -0,0 +1,74 @@ +class TeamsController < ApplicationController + before_action :set_team, only: [:show, :edit, :update, :destroy] + + # GET /teams + # GET /teams.json + def index + @teams = Team.all + end + + # GET /teams/1 + # GET /teams/1.json + def show + end + + # GET /teams/new + def new + @team = Team.new + end + + # GET /teams/1/edit + def edit + end + + # POST /teams + # POST /teams.json + def create + @team = Team.new(team_params) + + respond_to do |format| + if @team.save + format.html { redirect_to @team, notice: 'Team was successfully created.' } + format.json { render action: 'show', status: :created, location: @team } + else + format.html { render action: 'new' } + format.json { render json: @team.errors, status: :unprocessable_entity } + end + end + end + + # PATCH/PUT /teams/1 + # PATCH/PUT /teams/1.json + def update + respond_to do |format| + if @team.update(team_params) + format.html { redirect_to @team, notice: 'Team was successfully updated.' } + format.json { head :no_content } + else + format.html { render action: 'edit' } + format.json { render json: @team.errors, status: :unprocessable_entity } + end + end + end + + # DELETE /teams/1 + # DELETE /teams/1.json + def destroy + @team.destroy + respond_to do |format| + format.html { redirect_to teams_url } + format.json { head :no_content } + end + end + + private + # Use callbacks to share common setup or constraints between actions. + def set_team + @team = Team.find(params[:id]) + end + + # Never trust parameters from the scary internet, only allow the white list through. + def team_params + params[:team] + end +end diff --git a/app/controllers/tournaments_controller.rb b/app/controllers/tournaments_controller.rb new file mode 100644 index 0000000..720305f --- /dev/null +++ b/app/controllers/tournaments_controller.rb @@ -0,0 +1,74 @@ +class TournamentsController < ApplicationController + before_action :set_tournament, only: [:show, :edit, :update, :destroy] + + # GET /tournaments + # GET /tournaments.json + def index + @tournaments = Tournament.all + end + + # GET /tournaments/1 + # GET /tournaments/1.json + def show + end + + # GET /tournaments/new + def new + @tournament = Tournament.new + end + + # GET /tournaments/1/edit + def edit + end + + # POST /tournaments + # POST /tournaments.json + def create + @tournament = Tournament.new(tournament_params) + + respond_to do |format| + if @tournament.save + format.html { redirect_to @tournament, notice: 'Tournament was successfully created.' } + format.json { render action: 'show', status: :created, location: @tournament } + else + format.html { render action: 'new' } + format.json { render json: @tournament.errors, status: :unprocessable_entity } + end + end + end + + # PATCH/PUT /tournaments/1 + # PATCH/PUT /tournaments/1.json + def update + respond_to do |format| + if @tournament.update(tournament_params) + format.html { redirect_to @tournament, notice: 'Tournament was successfully updated.' } + format.json { head :no_content } + else + format.html { render action: 'edit' } + format.json { render json: @tournament.errors, status: :unprocessable_entity } + end + end + end + + # DELETE /tournaments/1 + # DELETE /tournaments/1.json + def destroy + @tournament.destroy + respond_to do |format| + format.html { redirect_to tournaments_url } + format.json { head :no_content } + end + end + + private + # Use callbacks to share common setup or constraints between actions. + def set_tournament + @tournament = Tournament.find(params[:id]) + end + + # Never trust parameters from the scary internet, only allow the white list through. + def tournament_params + params.require(:tournament).permit(:game_id) + end +end diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb new file mode 100644 index 0000000..3e74dea --- /dev/null +++ b/app/controllers/users_controller.rb @@ -0,0 +1,2 @@ +class UsersController < ApplicationController +end diff --git a/app/helpers/alerts_helper.rb b/app/helpers/alerts_helper.rb new file mode 100644 index 0000000..20f5b50 --- /dev/null +++ b/app/helpers/alerts_helper.rb @@ -0,0 +1,2 @@ +module AlertsHelper +end diff --git a/app/helpers/games_helper.rb b/app/helpers/games_helper.rb new file mode 100644 index 0000000..2ef8c1f --- /dev/null +++ b/app/helpers/games_helper.rb @@ -0,0 +1,2 @@ +module GamesHelper +end diff --git a/app/helpers/main_helper.rb b/app/helpers/main_helper.rb new file mode 100644 index 0000000..826effe --- /dev/null +++ b/app/helpers/main_helper.rb @@ -0,0 +1,2 @@ +module MainHelper +end diff --git a/app/helpers/matches_helper.rb b/app/helpers/matches_helper.rb new file mode 100644 index 0000000..cc2ef83 --- /dev/null +++ b/app/helpers/matches_helper.rb @@ -0,0 +1,2 @@ +module MatchesHelper +end diff --git a/app/helpers/pms_helper.rb b/app/helpers/pms_helper.rb new file mode 100644 index 0000000..0188e59 --- /dev/null +++ b/app/helpers/pms_helper.rb @@ -0,0 +1,2 @@ +module PmsHelper +end diff --git a/app/helpers/search_helper.rb b/app/helpers/search_helper.rb new file mode 100644 index 0000000..b3ce20a --- /dev/null +++ b/app/helpers/search_helper.rb @@ -0,0 +1,2 @@ +module SearchHelper +end diff --git a/app/helpers/servers_helper.rb b/app/helpers/servers_helper.rb new file mode 100644 index 0000000..a36fb17 --- /dev/null +++ b/app/helpers/servers_helper.rb @@ -0,0 +1,2 @@ +module ServersHelper +end diff --git a/app/helpers/sessions_helper.rb b/app/helpers/sessions_helper.rb new file mode 100644 index 0000000..309f8b2 --- /dev/null +++ b/app/helpers/sessions_helper.rb @@ -0,0 +1,2 @@ +module SessionsHelper +end diff --git a/app/helpers/static_helper.rb b/app/helpers/static_helper.rb new file mode 100644 index 0000000..8cfc9af --- /dev/null +++ b/app/helpers/static_helper.rb @@ -0,0 +1,2 @@ +module StaticHelper +end diff --git a/app/helpers/teams_helper.rb b/app/helpers/teams_helper.rb new file mode 100644 index 0000000..5fb41eb --- /dev/null +++ b/app/helpers/teams_helper.rb @@ -0,0 +1,2 @@ +module TeamsHelper +end diff --git a/app/helpers/tournaments_helper.rb b/app/helpers/tournaments_helper.rb new file mode 100644 index 0000000..2b6e27c --- /dev/null +++ b/app/helpers/tournaments_helper.rb @@ -0,0 +1,2 @@ +module TournamentsHelper +end diff --git a/app/helpers/users_helper.rb b/app/helpers/users_helper.rb new file mode 100644 index 0000000..2310a24 --- /dev/null +++ b/app/helpers/users_helper.rb @@ -0,0 +1,2 @@ +module UsersHelper +end diff --git a/app/models/alert.rb b/app/models/alert.rb new file mode 100644 index 0000000..343c269 --- /dev/null +++ b/app/models/alert.rb @@ -0,0 +1,3 @@ +class Alert < ActiveRecord::Base + belongs_to :author +end diff --git a/app/models/game.rb b/app/models/game.rb new file mode 100644 index 0000000..a181c26 --- /dev/null +++ b/app/models/game.rb @@ -0,0 +1,2 @@ +class Game < ActiveRecord::Base +end diff --git a/app/models/game_attribute.rb b/app/models/game_attribute.rb new file mode 100644 index 0000000..c12723b --- /dev/null +++ b/app/models/game_attribute.rb @@ -0,0 +1,3 @@ +class GameAttribute < ActiveRecord::Base + belongs_to :game +end diff --git a/app/models/match.rb b/app/models/match.rb new file mode 100644 index 0000000..533435a --- /dev/null +++ b/app/models/match.rb @@ -0,0 +1,3 @@ +class Match < ActiveRecord::Base + belongs_to :tournament +end diff --git a/app/models/pm.rb b/app/models/pm.rb new file mode 100644 index 0000000..ab5af3b --- /dev/null +++ b/app/models/pm.rb @@ -0,0 +1,4 @@ +class Pm < ActiveRecord::Base + belongs_to :author + belongs_to :recipient +end diff --git a/app/models/server.rb b/app/models/server.rb new file mode 100644 index 0000000..120f0fa --- /dev/null +++ b/app/models/server.rb @@ -0,0 +1,2 @@ +class Server < ActiveRecord::Base +end diff --git a/app/models/server_settings.rb b/app/models/server_settings.rb new file mode 100644 index 0000000..7f49863 --- /dev/null +++ b/app/models/server_settings.rb @@ -0,0 +1,2 @@ +class ServerSettings < ActiveRecord::Base +end diff --git a/app/models/team.rb b/app/models/team.rb new file mode 100644 index 0000000..fa7ba9e --- /dev/null +++ b/app/models/team.rb @@ -0,0 +1,2 @@ +class Team < ActiveRecord::Base +end diff --git a/app/models/team_match_pair.rb b/app/models/team_match_pair.rb new file mode 100644 index 0000000..85f8eaa --- /dev/null +++ b/app/models/team_match_pair.rb @@ -0,0 +1,4 @@ +class TeamMatchPair < ActiveRecord::Base + belongs_to :team + belongs_to :match +end diff --git a/app/models/tournament.rb b/app/models/tournament.rb new file mode 100644 index 0000000..cc915a0 --- /dev/null +++ b/app/models/tournament.rb @@ -0,0 +1,3 @@ +class Tournament < ActiveRecord::Base + belongs_to :game +end diff --git a/app/models/tournament_option.rb b/app/models/tournament_option.rb new file mode 100644 index 0000000..950b351 --- /dev/null +++ b/app/models/tournament_option.rb @@ -0,0 +1,2 @@ +class TournamentOption < ActiveRecord::Base +end diff --git a/app/models/user.rb b/app/models/user.rb new file mode 100644 index 0000000..4a57cf0 --- /dev/null +++ b/app/models/user.rb @@ -0,0 +1,2 @@ +class User < ActiveRecord::Base +end diff --git a/app/models/user_team_pair.rb b/app/models/user_team_pair.rb new file mode 100644 index 0000000..c55dc2e --- /dev/null +++ b/app/models/user_team_pair.rb @@ -0,0 +1,4 @@ +class UserTeamPair < ActiveRecord::Base + belongs_to :user + belongs_to :team +end diff --git a/app/views/alerts/_form.html.erb b/app/views/alerts/_form.html.erb new file mode 100644 index 0000000..b60eaf2 --- /dev/null +++ b/app/views/alerts/_form.html.erb @@ -0,0 +1,25 @@ +<%= form_for(@alert) do |f| %> + <% if @alert.errors.any? %> +
+

<%= pluralize(@alert.errors.count, "error") %> prohibited this alert from being saved:

+ + +
+ <% end %> + +
+ <%= f.label :author_id %>
+ <%= f.text_field :author_id %> +
+
+ <%= f.label :message %>
+ <%= f.text_area :message %> +
+
+ <%= f.submit %> +
+<% end %> diff --git a/app/views/alerts/edit.html.erb b/app/views/alerts/edit.html.erb new file mode 100644 index 0000000..ad99164 --- /dev/null +++ b/app/views/alerts/edit.html.erb @@ -0,0 +1,6 @@ +

Editing alert

+ +<%= render 'form' %> + +<%= link_to 'Show', @alert %> | +<%= link_to 'Back', alerts_path %> diff --git a/app/views/alerts/index.html.erb b/app/views/alerts/index.html.erb new file mode 100644 index 0000000..458b951 --- /dev/null +++ b/app/views/alerts/index.html.erb @@ -0,0 +1,29 @@ +

Listing alerts

+ + + + + + + + + + + + + + <% @alerts.each do |alert| %> + + + + + + + + <% end %> + +
AuthorMessage
<%= alert.author %><%= alert.message %><%= link_to 'Show', alert %><%= link_to 'Edit', edit_alert_path(alert) %><%= link_to 'Destroy', alert, method: :delete, data: { confirm: 'Are you sure?' } %>
+ +
+ +<%= link_to 'New Alert', new_alert_path %> diff --git a/app/views/alerts/index.json.jbuilder b/app/views/alerts/index.json.jbuilder new file mode 100644 index 0000000..0911a5c --- /dev/null +++ b/app/views/alerts/index.json.jbuilder @@ -0,0 +1,4 @@ +json.array!(@alerts) do |alert| + json.extract! alert, :id, :author_id, :message + json.url alert_url(alert, format: :json) +end diff --git a/app/views/alerts/new.html.erb b/app/views/alerts/new.html.erb new file mode 100644 index 0000000..6d04589 --- /dev/null +++ b/app/views/alerts/new.html.erb @@ -0,0 +1,5 @@ +

New alert

+ +<%= render 'form' %> + +<%= link_to 'Back', alerts_path %> diff --git a/app/views/alerts/show.html.erb b/app/views/alerts/show.html.erb new file mode 100644 index 0000000..eeab7f7 --- /dev/null +++ b/app/views/alerts/show.html.erb @@ -0,0 +1,14 @@ +

<%= notice %>

+ +

+ Author: + <%= @alert.author %> +

+ +

+ Message: + <%= @alert.message %> +

+ +<%= link_to 'Edit', edit_alert_path(@alert) %> | +<%= link_to 'Back', alerts_path %> diff --git a/app/views/alerts/show.json.jbuilder b/app/views/alerts/show.json.jbuilder new file mode 100644 index 0000000..95481eb --- /dev/null +++ b/app/views/alerts/show.json.jbuilder @@ -0,0 +1 @@ +json.extract! @alert, :id, :author_id, :message, :created_at, :updated_at diff --git a/app/views/games/_form.html.erb b/app/views/games/_form.html.erb new file mode 100644 index 0000000..8941c59 --- /dev/null +++ b/app/views/games/_form.html.erb @@ -0,0 +1,37 @@ +<%= form_for(@game) do |f| %> + <% if @game.errors.any? %> +
+

<%= pluralize(@game.errors.count, "error") %> prohibited this game from being saved:

+ + +
+ <% end %> + +
+ <%= f.label :name %>
+ <%= f.text_area :name %> +
+
+ <%= f.label :players_per_team %>
+ <%= f.number_field :players_per_team %> +
+
+ <%= f.label :teams_per_match %>
+ <%= f.number_field :teams_per_match %> +
+
+ <%= f.label :set_rounds %>
+ <%= f.number_field :set_rounds %> +
+
+ <%= f.label :randomized_teams %>
+ <%= f.number_field :randomized_teams %> +
+
+ <%= f.submit %> +
+<% end %> diff --git a/app/views/games/edit.html.erb b/app/views/games/edit.html.erb new file mode 100644 index 0000000..d72bd2e --- /dev/null +++ b/app/views/games/edit.html.erb @@ -0,0 +1,6 @@ +

Editing game

+ +<%= render 'form' %> + +<%= link_to 'Show', @game %> | +<%= link_to 'Back', games_path %> diff --git a/app/views/games/index.html.erb b/app/views/games/index.html.erb new file mode 100644 index 0000000..ccd0f63 --- /dev/null +++ b/app/views/games/index.html.erb @@ -0,0 +1,35 @@ +

Listing games

+ + + + + + + + + + + + + + + + + <% @games.each do |game| %> + + + + + + + + + + + <% end %> + +
NamePlayers per teamTeams per matchSet roundsRandomized teams
<%= game.name %><%= game.players_per_team %><%= game.teams_per_match %><%= game.set_rounds %><%= game.randomized_teams %><%= link_to 'Show', game %><%= link_to 'Edit', edit_game_path(game) %><%= link_to 'Destroy', game, method: :delete, data: { confirm: 'Are you sure?' } %>
+ +
+ +<%= link_to 'New Game', new_game_path %> diff --git a/app/views/games/index.json.jbuilder b/app/views/games/index.json.jbuilder new file mode 100644 index 0000000..7e5c1a1 --- /dev/null +++ b/app/views/games/index.json.jbuilder @@ -0,0 +1,4 @@ +json.array!(@games) do |game| + json.extract! game, :id, :name, :players_per_team, :teams_per_match, :set_rounds, :randomized_teams + json.url game_url(game, format: :json) +end diff --git a/app/views/games/new.html.erb b/app/views/games/new.html.erb new file mode 100644 index 0000000..ab95f70 --- /dev/null +++ b/app/views/games/new.html.erb @@ -0,0 +1,5 @@ +

New game

+ +<%= render 'form' %> + +<%= link_to 'Back', games_path %> diff --git a/app/views/games/show.html.erb b/app/views/games/show.html.erb new file mode 100644 index 0000000..7986016 --- /dev/null +++ b/app/views/games/show.html.erb @@ -0,0 +1,29 @@ +

<%= notice %>

+ +

+ Name: + <%= @game.name %> +

+ +

+ Players per team: + <%= @game.players_per_team %> +

+ +

+ Teams per match: + <%= @game.teams_per_match %> +

+ +

+ Set rounds: + <%= @game.set_rounds %> +

+ +

+ Randomized teams: + <%= @game.randomized_teams %> +

+ +<%= link_to 'Edit', edit_game_path(@game) %> | +<%= link_to 'Back', games_path %> diff --git a/app/views/games/show.json.jbuilder b/app/views/games/show.json.jbuilder new file mode 100644 index 0000000..1a2d0c7 --- /dev/null +++ b/app/views/games/show.json.jbuilder @@ -0,0 +1 @@ +json.extract! @game, :id, :name, :players_per_team, :teams_per_match, :set_rounds, :randomized_teams, :created_at, :updated_at diff --git a/app/views/matches/_form.html.erb b/app/views/matches/_form.html.erb new file mode 100644 index 0000000..34494c3 --- /dev/null +++ b/app/views/matches/_form.html.erb @@ -0,0 +1,21 @@ +<%= form_for(@match) do |f| %> + <% if @match.errors.any? %> +
+

<%= pluralize(@match.errors.count, "error") %> prohibited this match from being saved:

+ + +
+ <% end %> + +
+ <%= f.label :tournament_id %>
+ <%= f.text_field :tournament_id %> +
+
+ <%= f.submit %> +
+<% end %> diff --git a/app/views/matches/edit.html.erb b/app/views/matches/edit.html.erb new file mode 100644 index 0000000..38b7d70 --- /dev/null +++ b/app/views/matches/edit.html.erb @@ -0,0 +1,6 @@ +

Editing match

+ +<%= render 'form' %> + +<%= link_to 'Show', @match %> | +<%= link_to 'Back', matches_path %> diff --git a/app/views/matches/index.html.erb b/app/views/matches/index.html.erb new file mode 100644 index 0000000..d8122ac --- /dev/null +++ b/app/views/matches/index.html.erb @@ -0,0 +1,27 @@ +

Listing matches

+ + + + + + + + + + + + + <% @matches.each do |match| %> + + + + + + + <% end %> + +
Tournament
<%= match.tournament %><%= link_to 'Show', match %><%= link_to 'Edit', edit_match_path(match) %><%= link_to 'Destroy', match, method: :delete, data: { confirm: 'Are you sure?' } %>
+ +
+ +<%= link_to 'New Match', new_match_path %> diff --git a/app/views/matches/index.json.jbuilder b/app/views/matches/index.json.jbuilder new file mode 100644 index 0000000..c8ada7a --- /dev/null +++ b/app/views/matches/index.json.jbuilder @@ -0,0 +1,4 @@ +json.array!(@matches) do |match| + json.extract! match, :id, :tournament_id + json.url match_url(match, format: :json) +end diff --git a/app/views/matches/new.html.erb b/app/views/matches/new.html.erb new file mode 100644 index 0000000..bd4c78c --- /dev/null +++ b/app/views/matches/new.html.erb @@ -0,0 +1,5 @@ +

New match

+ +<%= render 'form' %> + +<%= link_to 'Back', matches_path %> diff --git a/app/views/matches/show.html.erb b/app/views/matches/show.html.erb new file mode 100644 index 0000000..7bab721 --- /dev/null +++ b/app/views/matches/show.html.erb @@ -0,0 +1,9 @@ +

<%= notice %>

+ +

+ Tournament: + <%= @match.tournament %> +

+ +<%= link_to 'Edit', edit_match_path(@match) %> | +<%= link_to 'Back', matches_path %> diff --git a/app/views/matches/show.json.jbuilder b/app/views/matches/show.json.jbuilder new file mode 100644 index 0000000..2e45395 --- /dev/null +++ b/app/views/matches/show.json.jbuilder @@ -0,0 +1 @@ +json.extract! @match, :id, :tournament_id, :created_at, :updated_at diff --git a/app/views/pms/_form.html.erb b/app/views/pms/_form.html.erb new file mode 100644 index 0000000..480e308 --- /dev/null +++ b/app/views/pms/_form.html.erb @@ -0,0 +1,29 @@ +<%= form_for(@pm) do |f| %> + <% if @pm.errors.any? %> +
+

<%= pluralize(@pm.errors.count, "error") %> prohibited this pm from being saved:

+ + +
+ <% end %> + +
+ <%= f.label :author_id %>
+ <%= f.text_field :author_id %> +
+
+ <%= f.label :recipient_id %>
+ <%= f.text_field :recipient_id %> +
+
+ <%= f.label :message %>
+ <%= f.text_area :message %> +
+
+ <%= f.submit %> +
+<% end %> diff --git a/app/views/pms/edit.html.erb b/app/views/pms/edit.html.erb new file mode 100644 index 0000000..074a4fd --- /dev/null +++ b/app/views/pms/edit.html.erb @@ -0,0 +1,6 @@ +

Editing pm

+ +<%= render 'form' %> + +<%= link_to 'Show', @pm %> | +<%= link_to 'Back', pms_path %> diff --git a/app/views/pms/index.html.erb b/app/views/pms/index.html.erb new file mode 100644 index 0000000..cb7fe4b --- /dev/null +++ b/app/views/pms/index.html.erb @@ -0,0 +1,31 @@ +

Listing pms

+ + + + + + + + + + + + + + + <% @pms.each do |pm| %> + + + + + + + + + <% end %> + +
AuthorRecipientMessage
<%= pm.author %><%= pm.recipient %><%= pm.message %><%= link_to 'Show', pm %><%= link_to 'Edit', edit_pm_path(pm) %><%= link_to 'Destroy', pm, method: :delete, data: { confirm: 'Are you sure?' } %>
+ +
+ +<%= link_to 'New Pm', new_pm_path %> diff --git a/app/views/pms/index.json.jbuilder b/app/views/pms/index.json.jbuilder new file mode 100644 index 0000000..fcfca84 --- /dev/null +++ b/app/views/pms/index.json.jbuilder @@ -0,0 +1,4 @@ +json.array!(@pms) do |pm| + json.extract! pm, :id, :author_id, :recipient_id, :message + json.url pm_url(pm, format: :json) +end diff --git a/app/views/pms/new.html.erb b/app/views/pms/new.html.erb new file mode 100644 index 0000000..29e24ec --- /dev/null +++ b/app/views/pms/new.html.erb @@ -0,0 +1,5 @@ +

New pm

+ +<%= render 'form' %> + +<%= link_to 'Back', pms_path %> diff --git a/app/views/pms/show.html.erb b/app/views/pms/show.html.erb new file mode 100644 index 0000000..5ee483f --- /dev/null +++ b/app/views/pms/show.html.erb @@ -0,0 +1,19 @@ +

<%= notice %>

+ +

+ Author: + <%= @pm.author %> +

+ +

+ Recipient: + <%= @pm.recipient %> +

+ +

+ Message: + <%= @pm.message %> +

+ +<%= link_to 'Edit', edit_pm_path(@pm) %> | +<%= link_to 'Back', pms_path %> diff --git a/app/views/pms/show.json.jbuilder b/app/views/pms/show.json.jbuilder new file mode 100644 index 0000000..94252e9 --- /dev/null +++ b/app/views/pms/show.json.jbuilder @@ -0,0 +1 @@ +json.extract! @pm, :id, :author_id, :recipient_id, :message, :created_at, :updated_at diff --git a/app/views/servers/_form.html.erb b/app/views/servers/_form.html.erb new file mode 100644 index 0000000..b08654b --- /dev/null +++ b/app/views/servers/_form.html.erb @@ -0,0 +1,17 @@ +<%= form_for(@server) do |f| %> + <% if @server.errors.any? %> +
+

<%= pluralize(@server.errors.count, "error") %> prohibited this server from being saved:

+ + +
+ <% end %> + +
+ <%= f.submit %> +
+<% end %> diff --git a/app/views/servers/edit.html.erb b/app/views/servers/edit.html.erb new file mode 100644 index 0000000..a92cdb5 --- /dev/null +++ b/app/views/servers/edit.html.erb @@ -0,0 +1,6 @@ +

Editing server

+ +<%= render 'form' %> + +<%= link_to 'Show', @server %> | +<%= link_to 'Back', servers_path %> diff --git a/app/views/servers/index.html.erb b/app/views/servers/index.html.erb new file mode 100644 index 0000000..f45d393 --- /dev/null +++ b/app/views/servers/index.html.erb @@ -0,0 +1,25 @@ +

Listing servers

+ + + + + + + + + + + + <% @servers.each do |server| %> + + + + + + <% end %> + +
<%= link_to 'Show', server %><%= link_to 'Edit', edit_server_path(server) %><%= link_to 'Destroy', server, method: :delete, data: { confirm: 'Are you sure?' } %>
+ +
+ +<%= link_to 'New Server', new_server_path %> diff --git a/app/views/servers/index.json.jbuilder b/app/views/servers/index.json.jbuilder new file mode 100644 index 0000000..2776abc --- /dev/null +++ b/app/views/servers/index.json.jbuilder @@ -0,0 +1,4 @@ +json.array!(@servers) do |server| + json.extract! server, :id + json.url server_url(server, format: :json) +end diff --git a/app/views/servers/new.html.erb b/app/views/servers/new.html.erb new file mode 100644 index 0000000..0422009 --- /dev/null +++ b/app/views/servers/new.html.erb @@ -0,0 +1,5 @@ +

New server

+ +<%= render 'form' %> + +<%= link_to 'Back', servers_path %> diff --git a/app/views/servers/show.html.erb b/app/views/servers/show.html.erb new file mode 100644 index 0000000..039cd8f --- /dev/null +++ b/app/views/servers/show.html.erb @@ -0,0 +1,4 @@ +

<%= notice %>

+ +<%= link_to 'Edit', edit_server_path(@server) %> | +<%= link_to 'Back', servers_path %> diff --git a/app/views/servers/show.json.jbuilder b/app/views/servers/show.json.jbuilder new file mode 100644 index 0000000..972b1c0 --- /dev/null +++ b/app/views/servers/show.json.jbuilder @@ -0,0 +1 @@ +json.extract! @server, :id, :created_at, :updated_at diff --git a/app/views/teams/_form.html.erb b/app/views/teams/_form.html.erb new file mode 100644 index 0000000..fd10129 --- /dev/null +++ b/app/views/teams/_form.html.erb @@ -0,0 +1,17 @@ +<%= form_for(@team) do |f| %> + <% if @team.errors.any? %> +
+

<%= pluralize(@team.errors.count, "error") %> prohibited this team from being saved:

+ + +
+ <% end %> + +
+ <%= f.submit %> +
+<% end %> diff --git a/app/views/teams/edit.html.erb b/app/views/teams/edit.html.erb new file mode 100644 index 0000000..49858ad --- /dev/null +++ b/app/views/teams/edit.html.erb @@ -0,0 +1,6 @@ +

Editing team

+ +<%= render 'form' %> + +<%= link_to 'Show', @team %> | +<%= link_to 'Back', teams_path %> diff --git a/app/views/teams/index.html.erb b/app/views/teams/index.html.erb new file mode 100644 index 0000000..b077e10 --- /dev/null +++ b/app/views/teams/index.html.erb @@ -0,0 +1,25 @@ +

Listing teams

+ + + + + + + + + + + + <% @teams.each do |team| %> + + + + + + <% end %> + +
<%= link_to 'Show', team %><%= link_to 'Edit', edit_team_path(team) %><%= link_to 'Destroy', team, method: :delete, data: { confirm: 'Are you sure?' } %>
+ +
+ +<%= link_to 'New Team', new_team_path %> diff --git a/app/views/teams/index.json.jbuilder b/app/views/teams/index.json.jbuilder new file mode 100644 index 0000000..b29428b --- /dev/null +++ b/app/views/teams/index.json.jbuilder @@ -0,0 +1,4 @@ +json.array!(@teams) do |team| + json.extract! team, :id + json.url team_url(team, format: :json) +end diff --git a/app/views/teams/new.html.erb b/app/views/teams/new.html.erb new file mode 100644 index 0000000..433d944 --- /dev/null +++ b/app/views/teams/new.html.erb @@ -0,0 +1,5 @@ +

New team

+ +<%= render 'form' %> + +<%= link_to 'Back', teams_path %> diff --git a/app/views/teams/show.html.erb b/app/views/teams/show.html.erb new file mode 100644 index 0000000..5b18d33 --- /dev/null +++ b/app/views/teams/show.html.erb @@ -0,0 +1,4 @@ +

<%= notice %>

+ +<%= link_to 'Edit', edit_team_path(@team) %> | +<%= link_to 'Back', teams_path %> diff --git a/app/views/teams/show.json.jbuilder b/app/views/teams/show.json.jbuilder new file mode 100644 index 0000000..1538019 --- /dev/null +++ b/app/views/teams/show.json.jbuilder @@ -0,0 +1 @@ +json.extract! @team, :id, :created_at, :updated_at diff --git a/app/views/tournaments/_form.html.erb b/app/views/tournaments/_form.html.erb new file mode 100644 index 0000000..1fd63e9 --- /dev/null +++ b/app/views/tournaments/_form.html.erb @@ -0,0 +1,21 @@ +<%= form_for(@tournament) do |f| %> + <% if @tournament.errors.any? %> +
+

<%= pluralize(@tournament.errors.count, "error") %> prohibited this tournament from being saved:

+ + +
+ <% end %> + +
+ <%= f.label :game_id %>
+ <%= f.text_field :game_id %> +
+
+ <%= f.submit %> +
+<% end %> diff --git a/app/views/tournaments/edit.html.erb b/app/views/tournaments/edit.html.erb new file mode 100644 index 0000000..2913025 --- /dev/null +++ b/app/views/tournaments/edit.html.erb @@ -0,0 +1,6 @@ +

Editing tournament

+ +<%= render 'form' %> + +<%= link_to 'Show', @tournament %> | +<%= link_to 'Back', tournaments_path %> diff --git a/app/views/tournaments/index.html.erb b/app/views/tournaments/index.html.erb new file mode 100644 index 0000000..ad2b7cf --- /dev/null +++ b/app/views/tournaments/index.html.erb @@ -0,0 +1,27 @@ +

Listing tournaments

+ + + + + + + + + + + + + <% @tournaments.each do |tournament| %> + + + + + + + <% end %> + +
Game
<%= tournament.game %><%= link_to 'Show', tournament %><%= link_to 'Edit', edit_tournament_path(tournament) %><%= link_to 'Destroy', tournament, method: :delete, data: { confirm: 'Are you sure?' } %>
+ +
+ +<%= link_to 'New Tournament', new_tournament_path %> diff --git a/app/views/tournaments/index.json.jbuilder b/app/views/tournaments/index.json.jbuilder new file mode 100644 index 0000000..e6f3b49 --- /dev/null +++ b/app/views/tournaments/index.json.jbuilder @@ -0,0 +1,4 @@ +json.array!(@tournaments) do |tournament| + json.extract! tournament, :id, :game_id + json.url tournament_url(tournament, format: :json) +end diff --git a/app/views/tournaments/new.html.erb b/app/views/tournaments/new.html.erb new file mode 100644 index 0000000..2a60539 --- /dev/null +++ b/app/views/tournaments/new.html.erb @@ -0,0 +1,5 @@ +

New tournament

+ +<%= render 'form' %> + +<%= link_to 'Back', tournaments_path %> diff --git a/app/views/tournaments/show.html.erb b/app/views/tournaments/show.html.erb new file mode 100644 index 0000000..30df788 --- /dev/null +++ b/app/views/tournaments/show.html.erb @@ -0,0 +1,9 @@ +

<%= notice %>

+ +

+ Game: + <%= @tournament.game %> +

+ +<%= link_to 'Edit', edit_tournament_path(@tournament) %> | +<%= link_to 'Back', tournaments_path %> diff --git a/app/views/tournaments/show.json.jbuilder b/app/views/tournaments/show.json.jbuilder new file mode 100644 index 0000000..0fe65a6 --- /dev/null +++ b/app/views/tournaments/show.json.jbuilder @@ -0,0 +1 @@ +json.extract! @tournament, :id, :game_id, :created_at, :updated_at diff --git a/config/routes.rb b/config/routes.rb index 876667f..149c321 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -1,4 +1,18 @@ Leaguer::Application.routes.draw do + resources :games + + resources :pms + + resources :alerts + + resources :teams + + resources :matches + + resources :tournaments + + resources :servers + # The priority is based upon order of creation: first created -> highest priority. # See how all your routes lay out with "rake routes". diff --git a/db/migrate/20140304020217_create_servers.rb b/db/migrate/20140304020217_create_servers.rb new file mode 100644 index 0000000..f33241a --- /dev/null +++ b/db/migrate/20140304020217_create_servers.rb @@ -0,0 +1,8 @@ +class CreateServers < ActiveRecord::Migration + def change + create_table :servers do |t| + + t.timestamps + end + end +end diff --git a/db/migrate/20140304020219_create_tournaments.rb b/db/migrate/20140304020219_create_tournaments.rb new file mode 100644 index 0000000..36fcf7e --- /dev/null +++ b/db/migrate/20140304020219_create_tournaments.rb @@ -0,0 +1,9 @@ +class CreateTournaments < ActiveRecord::Migration + def change + create_table :tournaments do |t| + t.references :game, index: true + + t.timestamps + end + end +end diff --git a/db/migrate/20140304020221_create_matches.rb b/db/migrate/20140304020221_create_matches.rb new file mode 100644 index 0000000..6c0c157 --- /dev/null +++ b/db/migrate/20140304020221_create_matches.rb @@ -0,0 +1,9 @@ +class CreateMatches < ActiveRecord::Migration + def change + create_table :matches do |t| + t.references :tournament, index: true + + t.timestamps + end + end +end diff --git a/db/migrate/20140304020224_create_teams.rb b/db/migrate/20140304020224_create_teams.rb new file mode 100644 index 0000000..dd8397d --- /dev/null +++ b/db/migrate/20140304020224_create_teams.rb @@ -0,0 +1,8 @@ +class CreateTeams < ActiveRecord::Migration + def change + create_table :teams do |t| + + t.timestamps + end + end +end diff --git a/db/migrate/20140304020230_create_users.rb b/db/migrate/20140304020230_create_users.rb new file mode 100644 index 0000000..f0986d4 --- /dev/null +++ b/db/migrate/20140304020230_create_users.rb @@ -0,0 +1,11 @@ +class CreateUsers < ActiveRecord::Migration + def change + create_table :users do |t| + t.string :name + t.string :email + t.string :user_name + + t.timestamps + end + end +end diff --git a/db/migrate/20140304020233_create_user_team_pairs.rb b/db/migrate/20140304020233_create_user_team_pairs.rb new file mode 100644 index 0000000..2c492ac --- /dev/null +++ b/db/migrate/20140304020233_create_user_team_pairs.rb @@ -0,0 +1,10 @@ +class CreateUserTeamPairs < ActiveRecord::Migration + def change + create_table :user_team_pairs do |t| + t.references :user, index: true + t.references :team, index: true + + t.timestamps + end + end +end diff --git a/db/migrate/20140304020235_create_team_match_pairs.rb b/db/migrate/20140304020235_create_team_match_pairs.rb new file mode 100644 index 0000000..8fac07e --- /dev/null +++ b/db/migrate/20140304020235_create_team_match_pairs.rb @@ -0,0 +1,10 @@ +class CreateTeamMatchPairs < ActiveRecord::Migration + def change + create_table :team_match_pairs do |t| + t.references :team, index: true + t.references :match, index: true + + t.timestamps + end + end +end diff --git a/db/migrate/20140304020237_create_alerts.rb b/db/migrate/20140304020237_create_alerts.rb new file mode 100644 index 0000000..68a8e10 --- /dev/null +++ b/db/migrate/20140304020237_create_alerts.rb @@ -0,0 +1,10 @@ +class CreateAlerts < ActiveRecord::Migration + def change + create_table :alerts do |t| + t.references :author, index: true + t.text :message + + t.timestamps + end + end +end diff --git a/db/migrate/20140304020239_create_pms.rb b/db/migrate/20140304020239_create_pms.rb new file mode 100644 index 0000000..93bb5c6 --- /dev/null +++ b/db/migrate/20140304020239_create_pms.rb @@ -0,0 +1,11 @@ +class CreatePms < ActiveRecord::Migration + def change + create_table :pms do |t| + t.references :author, index: true + t.references :recipient, index: true + t.text :message + + t.timestamps + end + end +end diff --git a/db/migrate/20140304020242_create_games.rb b/db/migrate/20140304020242_create_games.rb new file mode 100644 index 0000000..59d4ef0 --- /dev/null +++ b/db/migrate/20140304020242_create_games.rb @@ -0,0 +1,13 @@ +class CreateGames < ActiveRecord::Migration + def change + create_table :games do |t| + t.text :name + t.integer :players_per_team + t.integer :teams_per_match + t.integer :set_rounds + t.integer :randomized_teams + + t.timestamps + end + end +end diff --git a/db/migrate/20140304020244_create_game_attributes.rb b/db/migrate/20140304020244_create_game_attributes.rb new file mode 100644 index 0000000..b63f134 --- /dev/null +++ b/db/migrate/20140304020244_create_game_attributes.rb @@ -0,0 +1,11 @@ +class CreateGameAttributes < ActiveRecord::Migration + def change + create_table :game_attributes do |t| + t.references :game, index: true + t.text :key + t.integer :type + + t.timestamps + end + end +end diff --git a/db/migrate/20140304020246_create_server_settings.rb b/db/migrate/20140304020246_create_server_settings.rb new file mode 100644 index 0000000..dfdd91b --- /dev/null +++ b/db/migrate/20140304020246_create_server_settings.rb @@ -0,0 +1,8 @@ +class CreateServerSettings < ActiveRecord::Migration + def change + create_table :server_settings do |t| + + t.timestamps + end + end +end diff --git a/db/migrate/20140304020255_create_tournament_options.rb b/db/migrate/20140304020255_create_tournament_options.rb new file mode 100644 index 0000000..d2df22e --- /dev/null +++ b/db/migrate/20140304020255_create_tournament_options.rb @@ -0,0 +1,8 @@ +class CreateTournamentOptions < ActiveRecord::Migration + def change + create_table :tournament_options do |t| + + t.timestamps + end + end +end diff --git a/db/schema.rb b/db/schema.rb new file mode 100644 index 0000000..016476d --- /dev/null +++ b/db/schema.rb @@ -0,0 +1,120 @@ +# encoding: UTF-8 +# This file is auto-generated from the current state of the database. Instead +# of editing this file, please use the migrations feature of Active Record to +# incrementally modify your database, and then regenerate this schema definition. +# +# Note that this schema.rb definition is the authoritative source for your +# database schema. If you need to create the application database on another +# system, you should be using db:schema:load, not running all the migrations +# from scratch. The latter is a flawed and unsustainable approach (the more migrations +# you'll amass, the slower it'll run and the greater likelihood for issues). +# +# It's strongly recommended that you check this file into your version control system. + +ActiveRecord::Schema.define(version: 20140304020255) do + + create_table "alerts", force: true do |t| + t.integer "author_id" + t.text "message" + t.datetime "created_at" + t.datetime "updated_at" + end + + add_index "alerts", ["author_id"], name: "index_alerts_on_author_id" + + create_table "game_attributes", force: true do |t| + t.integer "game_id" + t.text "key" + t.integer "type" + t.datetime "created_at" + t.datetime "updated_at" + end + + add_index "game_attributes", ["game_id"], name: "index_game_attributes_on_game_id" + + create_table "games", force: true do |t| + t.text "name" + t.integer "players_per_team" + t.integer "teams_per_match" + t.integer "set_rounds" + t.integer "randomized_teams" + t.datetime "created_at" + t.datetime "updated_at" + end + + create_table "matches", force: true do |t| + t.integer "tournament_id" + t.datetime "created_at" + t.datetime "updated_at" + end + + add_index "matches", ["tournament_id"], name: "index_matches_on_tournament_id" + + create_table "pms", force: true do |t| + t.integer "author_id" + t.integer "recipient_id" + t.text "message" + t.datetime "created_at" + t.datetime "updated_at" + end + + add_index "pms", ["author_id"], name: "index_pms_on_author_id" + add_index "pms", ["recipient_id"], name: "index_pms_on_recipient_id" + + create_table "server_settings", force: true do |t| + t.datetime "created_at" + t.datetime "updated_at" + end + + create_table "servers", force: true do |t| + t.datetime "created_at" + t.datetime "updated_at" + end + + create_table "team_match_pairs", force: true do |t| + t.integer "team_id" + t.integer "match_id" + t.datetime "created_at" + t.datetime "updated_at" + end + + add_index "team_match_pairs", ["match_id"], name: "index_team_match_pairs_on_match_id" + add_index "team_match_pairs", ["team_id"], name: "index_team_match_pairs_on_team_id" + + create_table "teams", force: true do |t| + t.datetime "created_at" + t.datetime "updated_at" + end + + create_table "tournament_options", force: true do |t| + t.datetime "created_at" + t.datetime "updated_at" + end + + create_table "tournaments", force: true do |t| + t.integer "game_id" + t.datetime "created_at" + t.datetime "updated_at" + end + + add_index "tournaments", ["game_id"], name: "index_tournaments_on_game_id" + + create_table "user_team_pairs", force: true do |t| + t.integer "user_id" + t.integer "team_id" + t.datetime "created_at" + t.datetime "updated_at" + end + + add_index "user_team_pairs", ["team_id"], name: "index_user_team_pairs_on_team_id" + add_index "user_team_pairs", ["user_id"], name: "index_user_team_pairs_on_user_id" + + create_table "users", force: true do |t| + t.string "name" + t.string "email" + t.string "user_name" + t.datetime "created_at" + t.datetime "updated_at" + end + +end diff --git a/generate.sh b/generate.sh index 807b9ef..7f70d56 100755 --- a/generate.sh +++ b/generate.sh @@ -18,6 +18,7 @@ bundle exec rails generate scaffold tournament game:references $NOTEST bundle exec rails generate scaffold match tournament:references $NOTEST bundle exec rails generate scaffold team $NOTEST bundle exec rails generate controller users $NOTEST +bundle exec rails generate controller Sessions bundle exec rails generate model user name:string email:string user_name:string $NOTEST bundle exec rails generate model user_team_pair user:references team:references $NOTEST bundle exec rails generate model team_match_pair team:references match:references $NOTEST diff --git a/spec/controllers/alerts_controller_spec.rb b/spec/controllers/alerts_controller_spec.rb new file mode 100644 index 0000000..82b031b --- /dev/null +++ b/spec/controllers/alerts_controller_spec.rb @@ -0,0 +1,160 @@ +require 'spec_helper' + +# This spec was generated by rspec-rails when you ran the scaffold generator. +# It demonstrates how one might use RSpec to specify the controller code that +# was generated by Rails when you ran the scaffold generator. +# +# It assumes that the implementation code is generated by the rails scaffold +# generator. If you are using any extension libraries to generate different +# controller code, this generated spec may or may not pass. +# +# It only uses APIs available in rails and/or rspec-rails. There are a number +# of tools you can use to make these specs even more expressive, but we're +# sticking to rails and rspec-rails APIs to keep things simple and stable. +# +# Compared to earlier versions of this generator, there is very limited use of +# stubs and message expectations in this spec. Stubs are only used when there +# is no simpler way to get a handle on the object needed for the example. +# Message expectations are only used when there is no simpler way to specify +# that an instance is receiving a specific message. + +describe AlertsController do + + # This should return the minimal set of attributes required to create a valid + # Alert. As you add validations to Alert, be sure to + # adjust the attributes here as well. + let(:valid_attributes) { { "author" => "" } } + + # This should return the minimal set of values that should be in the session + # in order to pass any filters (e.g. authentication) defined in + # AlertsController. Be sure to keep this updated too. + let(:valid_session) { {} } + + describe "GET index" do + it "assigns all alerts as @alerts" do + alert = Alert.create! valid_attributes + get :index, {}, valid_session + assigns(:alerts).should eq([alert]) + end + end + + describe "GET show" do + it "assigns the requested alert as @alert" do + alert = Alert.create! valid_attributes + get :show, {:id => alert.to_param}, valid_session + assigns(:alert).should eq(alert) + end + end + + describe "GET new" do + it "assigns a new alert as @alert" do + get :new, {}, valid_session + assigns(:alert).should be_a_new(Alert) + end + end + + describe "GET edit" do + it "assigns the requested alert as @alert" do + alert = Alert.create! valid_attributes + get :edit, {:id => alert.to_param}, valid_session + assigns(:alert).should eq(alert) + end + end + + describe "POST create" do + describe "with valid params" do + it "creates a new Alert" do + expect { + post :create, {:alert => valid_attributes}, valid_session + }.to change(Alert, :count).by(1) + end + + it "assigns a newly created alert as @alert" do + post :create, {:alert => valid_attributes}, valid_session + assigns(:alert).should be_a(Alert) + assigns(:alert).should be_persisted + end + + it "redirects to the created alert" do + post :create, {:alert => valid_attributes}, valid_session + response.should redirect_to(Alert.last) + end + end + + describe "with invalid params" do + it "assigns a newly created but unsaved alert as @alert" do + # Trigger the behavior that occurs when invalid params are submitted + Alert.any_instance.stub(:save).and_return(false) + post :create, {:alert => { "author" => "invalid value" }}, valid_session + assigns(:alert).should be_a_new(Alert) + end + + it "re-renders the 'new' template" do + # Trigger the behavior that occurs when invalid params are submitted + Alert.any_instance.stub(:save).and_return(false) + post :create, {:alert => { "author" => "invalid value" }}, valid_session + response.should render_template("new") + end + end + end + + describe "PUT update" do + describe "with valid params" do + it "updates the requested alert" do + alert = Alert.create! valid_attributes + # Assuming there are no other alerts in the database, this + # specifies that the Alert created on the previous line + # receives the :update_attributes message with whatever params are + # submitted in the request. + Alert.any_instance.should_receive(:update).with({ "author" => "" }) + put :update, {:id => alert.to_param, :alert => { "author" => "" }}, valid_session + end + + it "assigns the requested alert as @alert" do + alert = Alert.create! valid_attributes + put :update, {:id => alert.to_param, :alert => valid_attributes}, valid_session + assigns(:alert).should eq(alert) + end + + it "redirects to the alert" do + alert = Alert.create! valid_attributes + put :update, {:id => alert.to_param, :alert => valid_attributes}, valid_session + response.should redirect_to(alert) + end + end + + describe "with invalid params" do + it "assigns the alert as @alert" do + alert = Alert.create! valid_attributes + # Trigger the behavior that occurs when invalid params are submitted + Alert.any_instance.stub(:save).and_return(false) + put :update, {:id => alert.to_param, :alert => { "author" => "invalid value" }}, valid_session + assigns(:alert).should eq(alert) + end + + it "re-renders the 'edit' template" do + alert = Alert.create! valid_attributes + # Trigger the behavior that occurs when invalid params are submitted + Alert.any_instance.stub(:save).and_return(false) + put :update, {:id => alert.to_param, :alert => { "author" => "invalid value" }}, valid_session + response.should render_template("edit") + end + end + end + + describe "DELETE destroy" do + it "destroys the requested alert" do + alert = Alert.create! valid_attributes + expect { + delete :destroy, {:id => alert.to_param}, valid_session + }.to change(Alert, :count).by(-1) + end + + it "redirects to the alerts list" do + alert = Alert.create! valid_attributes + delete :destroy, {:id => alert.to_param}, valid_session + response.should redirect_to(alerts_url) + end + end + +end diff --git a/spec/controllers/games_controller_spec.rb b/spec/controllers/games_controller_spec.rb new file mode 100644 index 0000000..ab8b6b2 --- /dev/null +++ b/spec/controllers/games_controller_spec.rb @@ -0,0 +1,160 @@ +require 'spec_helper' + +# This spec was generated by rspec-rails when you ran the scaffold generator. +# It demonstrates how one might use RSpec to specify the controller code that +# was generated by Rails when you ran the scaffold generator. +# +# It assumes that the implementation code is generated by the rails scaffold +# generator. If you are using any extension libraries to generate different +# controller code, this generated spec may or may not pass. +# +# It only uses APIs available in rails and/or rspec-rails. There are a number +# of tools you can use to make these specs even more expressive, but we're +# sticking to rails and rspec-rails APIs to keep things simple and stable. +# +# Compared to earlier versions of this generator, there is very limited use of +# stubs and message expectations in this spec. Stubs are only used when there +# is no simpler way to get a handle on the object needed for the example. +# Message expectations are only used when there is no simpler way to specify +# that an instance is receiving a specific message. + +describe GamesController do + + # This should return the minimal set of attributes required to create a valid + # Game. As you add validations to Game, be sure to + # adjust the attributes here as well. + let(:valid_attributes) { { "name" => "MyText" } } + + # This should return the minimal set of values that should be in the session + # in order to pass any filters (e.g. authentication) defined in + # GamesController. Be sure to keep this updated too. + let(:valid_session) { {} } + + describe "GET index" do + it "assigns all games as @games" do + game = Game.create! valid_attributes + get :index, {}, valid_session + assigns(:games).should eq([game]) + end + end + + describe "GET show" do + it "assigns the requested game as @game" do + game = Game.create! valid_attributes + get :show, {:id => game.to_param}, valid_session + assigns(:game).should eq(game) + end + end + + describe "GET new" do + it "assigns a new game as @game" do + get :new, {}, valid_session + assigns(:game).should be_a_new(Game) + end + end + + describe "GET edit" do + it "assigns the requested game as @game" do + game = Game.create! valid_attributes + get :edit, {:id => game.to_param}, valid_session + assigns(:game).should eq(game) + end + end + + describe "POST create" do + describe "with valid params" do + it "creates a new Game" do + expect { + post :create, {:game => valid_attributes}, valid_session + }.to change(Game, :count).by(1) + end + + it "assigns a newly created game as @game" do + post :create, {:game => valid_attributes}, valid_session + assigns(:game).should be_a(Game) + assigns(:game).should be_persisted + end + + it "redirects to the created game" do + post :create, {:game => valid_attributes}, valid_session + response.should redirect_to(Game.last) + end + end + + describe "with invalid params" do + it "assigns a newly created but unsaved game as @game" do + # Trigger the behavior that occurs when invalid params are submitted + Game.any_instance.stub(:save).and_return(false) + post :create, {:game => { "name" => "invalid value" }}, valid_session + assigns(:game).should be_a_new(Game) + end + + it "re-renders the 'new' template" do + # Trigger the behavior that occurs when invalid params are submitted + Game.any_instance.stub(:save).and_return(false) + post :create, {:game => { "name" => "invalid value" }}, valid_session + response.should render_template("new") + end + end + end + + describe "PUT update" do + describe "with valid params" do + it "updates the requested game" do + game = Game.create! valid_attributes + # Assuming there are no other games in the database, this + # specifies that the Game created on the previous line + # receives the :update_attributes message with whatever params are + # submitted in the request. + Game.any_instance.should_receive(:update).with({ "name" => "MyText" }) + put :update, {:id => game.to_param, :game => { "name" => "MyText" }}, valid_session + end + + it "assigns the requested game as @game" do + game = Game.create! valid_attributes + put :update, {:id => game.to_param, :game => valid_attributes}, valid_session + assigns(:game).should eq(game) + end + + it "redirects to the game" do + game = Game.create! valid_attributes + put :update, {:id => game.to_param, :game => valid_attributes}, valid_session + response.should redirect_to(game) + end + end + + describe "with invalid params" do + it "assigns the game as @game" do + game = Game.create! valid_attributes + # Trigger the behavior that occurs when invalid params are submitted + Game.any_instance.stub(:save).and_return(false) + put :update, {:id => game.to_param, :game => { "name" => "invalid value" }}, valid_session + assigns(:game).should eq(game) + end + + it "re-renders the 'edit' template" do + game = Game.create! valid_attributes + # Trigger the behavior that occurs when invalid params are submitted + Game.any_instance.stub(:save).and_return(false) + put :update, {:id => game.to_param, :game => { "name" => "invalid value" }}, valid_session + response.should render_template("edit") + end + end + end + + describe "DELETE destroy" do + it "destroys the requested game" do + game = Game.create! valid_attributes + expect { + delete :destroy, {:id => game.to_param}, valid_session + }.to change(Game, :count).by(-1) + end + + it "redirects to the games list" do + game = Game.create! valid_attributes + delete :destroy, {:id => game.to_param}, valid_session + response.should redirect_to(games_url) + end + end + +end diff --git a/spec/controllers/main_controller_spec.rb b/spec/controllers/main_controller_spec.rb new file mode 100644 index 0000000..247e21d --- /dev/null +++ b/spec/controllers/main_controller_spec.rb @@ -0,0 +1,5 @@ +require 'spec_helper' + +describe MainController do + +end diff --git a/spec/controllers/matches_controller_spec.rb b/spec/controllers/matches_controller_spec.rb new file mode 100644 index 0000000..1f7adf8 --- /dev/null +++ b/spec/controllers/matches_controller_spec.rb @@ -0,0 +1,160 @@ +require 'spec_helper' + +# This spec was generated by rspec-rails when you ran the scaffold generator. +# It demonstrates how one might use RSpec to specify the controller code that +# was generated by Rails when you ran the scaffold generator. +# +# It assumes that the implementation code is generated by the rails scaffold +# generator. If you are using any extension libraries to generate different +# controller code, this generated spec may or may not pass. +# +# It only uses APIs available in rails and/or rspec-rails. There are a number +# of tools you can use to make these specs even more expressive, but we're +# sticking to rails and rspec-rails APIs to keep things simple and stable. +# +# Compared to earlier versions of this generator, there is very limited use of +# stubs and message expectations in this spec. Stubs are only used when there +# is no simpler way to get a handle on the object needed for the example. +# Message expectations are only used when there is no simpler way to specify +# that an instance is receiving a specific message. + +describe MatchesController do + + # This should return the minimal set of attributes required to create a valid + # Match. As you add validations to Match, be sure to + # adjust the attributes here as well. + let(:valid_attributes) { { "tournament" => "" } } + + # This should return the minimal set of values that should be in the session + # in order to pass any filters (e.g. authentication) defined in + # MatchesController. Be sure to keep this updated too. + let(:valid_session) { {} } + + describe "GET index" do + it "assigns all matches as @matches" do + match = Match.create! valid_attributes + get :index, {}, valid_session + assigns(:matches).should eq([match]) + end + end + + describe "GET show" do + it "assigns the requested match as @match" do + match = Match.create! valid_attributes + get :show, {:id => match.to_param}, valid_session + assigns(:match).should eq(match) + end + end + + describe "GET new" do + it "assigns a new match as @match" do + get :new, {}, valid_session + assigns(:match).should be_a_new(Match) + end + end + + describe "GET edit" do + it "assigns the requested match as @match" do + match = Match.create! valid_attributes + get :edit, {:id => match.to_param}, valid_session + assigns(:match).should eq(match) + end + end + + describe "POST create" do + describe "with valid params" do + it "creates a new Match" do + expect { + post :create, {:match => valid_attributes}, valid_session + }.to change(Match, :count).by(1) + end + + it "assigns a newly created match as @match" do + post :create, {:match => valid_attributes}, valid_session + assigns(:match).should be_a(Match) + assigns(:match).should be_persisted + end + + it "redirects to the created match" do + post :create, {:match => valid_attributes}, valid_session + response.should redirect_to(Match.last) + end + end + + describe "with invalid params" do + it "assigns a newly created but unsaved match as @match" do + # Trigger the behavior that occurs when invalid params are submitted + Match.any_instance.stub(:save).and_return(false) + post :create, {:match => { "tournament" => "invalid value" }}, valid_session + assigns(:match).should be_a_new(Match) + end + + it "re-renders the 'new' template" do + # Trigger the behavior that occurs when invalid params are submitted + Match.any_instance.stub(:save).and_return(false) + post :create, {:match => { "tournament" => "invalid value" }}, valid_session + response.should render_template("new") + end + end + end + + describe "PUT update" do + describe "with valid params" do + it "updates the requested match" do + match = Match.create! valid_attributes + # Assuming there are no other matches in the database, this + # specifies that the Match created on the previous line + # receives the :update_attributes message with whatever params are + # submitted in the request. + Match.any_instance.should_receive(:update).with({ "tournament" => "" }) + put :update, {:id => match.to_param, :match => { "tournament" => "" }}, valid_session + end + + it "assigns the requested match as @match" do + match = Match.create! valid_attributes + put :update, {:id => match.to_param, :match => valid_attributes}, valid_session + assigns(:match).should eq(match) + end + + it "redirects to the match" do + match = Match.create! valid_attributes + put :update, {:id => match.to_param, :match => valid_attributes}, valid_session + response.should redirect_to(match) + end + end + + describe "with invalid params" do + it "assigns the match as @match" do + match = Match.create! valid_attributes + # Trigger the behavior that occurs when invalid params are submitted + Match.any_instance.stub(:save).and_return(false) + put :update, {:id => match.to_param, :match => { "tournament" => "invalid value" }}, valid_session + assigns(:match).should eq(match) + end + + it "re-renders the 'edit' template" do + match = Match.create! valid_attributes + # Trigger the behavior that occurs when invalid params are submitted + Match.any_instance.stub(:save).and_return(false) + put :update, {:id => match.to_param, :match => { "tournament" => "invalid value" }}, valid_session + response.should render_template("edit") + end + end + end + + describe "DELETE destroy" do + it "destroys the requested match" do + match = Match.create! valid_attributes + expect { + delete :destroy, {:id => match.to_param}, valid_session + }.to change(Match, :count).by(-1) + end + + it "redirects to the matches list" do + match = Match.create! valid_attributes + delete :destroy, {:id => match.to_param}, valid_session + response.should redirect_to(matches_url) + end + end + +end diff --git a/spec/controllers/pms_controller_spec.rb b/spec/controllers/pms_controller_spec.rb new file mode 100644 index 0000000..f0822db --- /dev/null +++ b/spec/controllers/pms_controller_spec.rb @@ -0,0 +1,160 @@ +require 'spec_helper' + +# This spec was generated by rspec-rails when you ran the scaffold generator. +# It demonstrates how one might use RSpec to specify the controller code that +# was generated by Rails when you ran the scaffold generator. +# +# It assumes that the implementation code is generated by the rails scaffold +# generator. If you are using any extension libraries to generate different +# controller code, this generated spec may or may not pass. +# +# It only uses APIs available in rails and/or rspec-rails. There are a number +# of tools you can use to make these specs even more expressive, but we're +# sticking to rails and rspec-rails APIs to keep things simple and stable. +# +# Compared to earlier versions of this generator, there is very limited use of +# stubs and message expectations in this spec. Stubs are only used when there +# is no simpler way to get a handle on the object needed for the example. +# Message expectations are only used when there is no simpler way to specify +# that an instance is receiving a specific message. + +describe PmsController do + + # This should return the minimal set of attributes required to create a valid + # Pm. As you add validations to Pm, be sure to + # adjust the attributes here as well. + let(:valid_attributes) { { "author" => "" } } + + # This should return the minimal set of values that should be in the session + # in order to pass any filters (e.g. authentication) defined in + # PmsController. Be sure to keep this updated too. + let(:valid_session) { {} } + + describe "GET index" do + it "assigns all pms as @pms" do + pm = Pm.create! valid_attributes + get :index, {}, valid_session + assigns(:pms).should eq([pm]) + end + end + + describe "GET show" do + it "assigns the requested pm as @pm" do + pm = Pm.create! valid_attributes + get :show, {:id => pm.to_param}, valid_session + assigns(:pm).should eq(pm) + end + end + + describe "GET new" do + it "assigns a new pm as @pm" do + get :new, {}, valid_session + assigns(:pm).should be_a_new(Pm) + end + end + + describe "GET edit" do + it "assigns the requested pm as @pm" do + pm = Pm.create! valid_attributes + get :edit, {:id => pm.to_param}, valid_session + assigns(:pm).should eq(pm) + end + end + + describe "POST create" do + describe "with valid params" do + it "creates a new Pm" do + expect { + post :create, {:pm => valid_attributes}, valid_session + }.to change(Pm, :count).by(1) + end + + it "assigns a newly created pm as @pm" do + post :create, {:pm => valid_attributes}, valid_session + assigns(:pm).should be_a(Pm) + assigns(:pm).should be_persisted + end + + it "redirects to the created pm" do + post :create, {:pm => valid_attributes}, valid_session + response.should redirect_to(Pm.last) + end + end + + describe "with invalid params" do + it "assigns a newly created but unsaved pm as @pm" do + # Trigger the behavior that occurs when invalid params are submitted + Pm.any_instance.stub(:save).and_return(false) + post :create, {:pm => { "author" => "invalid value" }}, valid_session + assigns(:pm).should be_a_new(Pm) + end + + it "re-renders the 'new' template" do + # Trigger the behavior that occurs when invalid params are submitted + Pm.any_instance.stub(:save).and_return(false) + post :create, {:pm => { "author" => "invalid value" }}, valid_session + response.should render_template("new") + end + end + end + + describe "PUT update" do + describe "with valid params" do + it "updates the requested pm" do + pm = Pm.create! valid_attributes + # Assuming there are no other pms in the database, this + # specifies that the Pm created on the previous line + # receives the :update_attributes message with whatever params are + # submitted in the request. + Pm.any_instance.should_receive(:update).with({ "author" => "" }) + put :update, {:id => pm.to_param, :pm => { "author" => "" }}, valid_session + end + + it "assigns the requested pm as @pm" do + pm = Pm.create! valid_attributes + put :update, {:id => pm.to_param, :pm => valid_attributes}, valid_session + assigns(:pm).should eq(pm) + end + + it "redirects to the pm" do + pm = Pm.create! valid_attributes + put :update, {:id => pm.to_param, :pm => valid_attributes}, valid_session + response.should redirect_to(pm) + end + end + + describe "with invalid params" do + it "assigns the pm as @pm" do + pm = Pm.create! valid_attributes + # Trigger the behavior that occurs when invalid params are submitted + Pm.any_instance.stub(:save).and_return(false) + put :update, {:id => pm.to_param, :pm => { "author" => "invalid value" }}, valid_session + assigns(:pm).should eq(pm) + end + + it "re-renders the 'edit' template" do + pm = Pm.create! valid_attributes + # Trigger the behavior that occurs when invalid params are submitted + Pm.any_instance.stub(:save).and_return(false) + put :update, {:id => pm.to_param, :pm => { "author" => "invalid value" }}, valid_session + response.should render_template("edit") + end + end + end + + describe "DELETE destroy" do + it "destroys the requested pm" do + pm = Pm.create! valid_attributes + expect { + delete :destroy, {:id => pm.to_param}, valid_session + }.to change(Pm, :count).by(-1) + end + + it "redirects to the pms list" do + pm = Pm.create! valid_attributes + delete :destroy, {:id => pm.to_param}, valid_session + response.should redirect_to(pms_url) + end + end + +end diff --git a/spec/controllers/search_controller_spec.rb b/spec/controllers/search_controller_spec.rb new file mode 100644 index 0000000..73248fb --- /dev/null +++ b/spec/controllers/search_controller_spec.rb @@ -0,0 +1,5 @@ +require 'spec_helper' + +describe SearchController do + +end diff --git a/spec/controllers/servers_controller_spec.rb b/spec/controllers/servers_controller_spec.rb new file mode 100644 index 0000000..c6f4fa6 --- /dev/null +++ b/spec/controllers/servers_controller_spec.rb @@ -0,0 +1,160 @@ +require 'spec_helper' + +# This spec was generated by rspec-rails when you ran the scaffold generator. +# It demonstrates how one might use RSpec to specify the controller code that +# was generated by Rails when you ran the scaffold generator. +# +# It assumes that the implementation code is generated by the rails scaffold +# generator. If you are using any extension libraries to generate different +# controller code, this generated spec may or may not pass. +# +# It only uses APIs available in rails and/or rspec-rails. There are a number +# of tools you can use to make these specs even more expressive, but we're +# sticking to rails and rspec-rails APIs to keep things simple and stable. +# +# Compared to earlier versions of this generator, there is very limited use of +# stubs and message expectations in this spec. Stubs are only used when there +# is no simpler way to get a handle on the object needed for the example. +# Message expectations are only used when there is no simpler way to specify +# that an instance is receiving a specific message. + +describe ServersController do + + # This should return the minimal set of attributes required to create a valid + # Server. As you add validations to Server, be sure to + # adjust the attributes here as well. + let(:valid_attributes) { { } } + + # This should return the minimal set of values that should be in the session + # in order to pass any filters (e.g. authentication) defined in + # ServersController. Be sure to keep this updated too. + let(:valid_session) { {} } + + describe "GET index" do + it "assigns all servers as @servers" do + server = Server.create! valid_attributes + get :index, {}, valid_session + assigns(:servers).should eq([server]) + end + end + + describe "GET show" do + it "assigns the requested server as @server" do + server = Server.create! valid_attributes + get :show, {:id => server.to_param}, valid_session + assigns(:server).should eq(server) + end + end + + describe "GET new" do + it "assigns a new server as @server" do + get :new, {}, valid_session + assigns(:server).should be_a_new(Server) + end + end + + describe "GET edit" do + it "assigns the requested server as @server" do + server = Server.create! valid_attributes + get :edit, {:id => server.to_param}, valid_session + assigns(:server).should eq(server) + end + end + + describe "POST create" do + describe "with valid params" do + it "creates a new Server" do + expect { + post :create, {:server => valid_attributes}, valid_session + }.to change(Server, :count).by(1) + end + + it "assigns a newly created server as @server" do + post :create, {:server => valid_attributes}, valid_session + assigns(:server).should be_a(Server) + assigns(:server).should be_persisted + end + + it "redirects to the created server" do + post :create, {:server => valid_attributes}, valid_session + response.should redirect_to(Server.last) + end + end + + describe "with invalid params" do + it "assigns a newly created but unsaved server as @server" do + # Trigger the behavior that occurs when invalid params are submitted + Server.any_instance.stub(:save).and_return(false) + post :create, {:server => { }}, valid_session + assigns(:server).should be_a_new(Server) + end + + it "re-renders the 'new' template" do + # Trigger the behavior that occurs when invalid params are submitted + Server.any_instance.stub(:save).and_return(false) + post :create, {:server => { }}, valid_session + response.should render_template("new") + end + end + end + + describe "PUT update" do + describe "with valid params" do + it "updates the requested server" do + server = Server.create! valid_attributes + # Assuming there are no other servers in the database, this + # specifies that the Server created on the previous line + # receives the :update_attributes message with whatever params are + # submitted in the request. + Server.any_instance.should_receive(:update).with({ "these" => "params" }) + put :update, {:id => server.to_param, :server => { "these" => "params" }}, valid_session + end + + it "assigns the requested server as @server" do + server = Server.create! valid_attributes + put :update, {:id => server.to_param, :server => valid_attributes}, valid_session + assigns(:server).should eq(server) + end + + it "redirects to the server" do + server = Server.create! valid_attributes + put :update, {:id => server.to_param, :server => valid_attributes}, valid_session + response.should redirect_to(server) + end + end + + describe "with invalid params" do + it "assigns the server as @server" do + server = Server.create! valid_attributes + # Trigger the behavior that occurs when invalid params are submitted + Server.any_instance.stub(:save).and_return(false) + put :update, {:id => server.to_param, :server => { }}, valid_session + assigns(:server).should eq(server) + end + + it "re-renders the 'edit' template" do + server = Server.create! valid_attributes + # Trigger the behavior that occurs when invalid params are submitted + Server.any_instance.stub(:save).and_return(false) + put :update, {:id => server.to_param, :server => { }}, valid_session + response.should render_template("edit") + end + end + end + + describe "DELETE destroy" do + it "destroys the requested server" do + server = Server.create! valid_attributes + expect { + delete :destroy, {:id => server.to_param}, valid_session + }.to change(Server, :count).by(-1) + end + + it "redirects to the servers list" do + server = Server.create! valid_attributes + delete :destroy, {:id => server.to_param}, valid_session + response.should redirect_to(servers_url) + end + end + +end diff --git a/spec/controllers/sessions_controller_spec.rb b/spec/controllers/sessions_controller_spec.rb new file mode 100644 index 0000000..702c559 --- /dev/null +++ b/spec/controllers/sessions_controller_spec.rb @@ -0,0 +1,5 @@ +require 'spec_helper' + +describe SessionsController do + +end diff --git a/spec/controllers/static_controller_spec.rb b/spec/controllers/static_controller_spec.rb new file mode 100644 index 0000000..a3db7c0 --- /dev/null +++ b/spec/controllers/static_controller_spec.rb @@ -0,0 +1,5 @@ +require 'spec_helper' + +describe StaticController do + +end diff --git a/spec/controllers/teams_controller_spec.rb b/spec/controllers/teams_controller_spec.rb new file mode 100644 index 0000000..9c74d89 --- /dev/null +++ b/spec/controllers/teams_controller_spec.rb @@ -0,0 +1,160 @@ +require 'spec_helper' + +# This spec was generated by rspec-rails when you ran the scaffold generator. +# It demonstrates how one might use RSpec to specify the controller code that +# was generated by Rails when you ran the scaffold generator. +# +# It assumes that the implementation code is generated by the rails scaffold +# generator. If you are using any extension libraries to generate different +# controller code, this generated spec may or may not pass. +# +# It only uses APIs available in rails and/or rspec-rails. There are a number +# of tools you can use to make these specs even more expressive, but we're +# sticking to rails and rspec-rails APIs to keep things simple and stable. +# +# Compared to earlier versions of this generator, there is very limited use of +# stubs and message expectations in this spec. Stubs are only used when there +# is no simpler way to get a handle on the object needed for the example. +# Message expectations are only used when there is no simpler way to specify +# that an instance is receiving a specific message. + +describe TeamsController do + + # This should return the minimal set of attributes required to create a valid + # Team. As you add validations to Team, be sure to + # adjust the attributes here as well. + let(:valid_attributes) { { } } + + # This should return the minimal set of values that should be in the session + # in order to pass any filters (e.g. authentication) defined in + # TeamsController. Be sure to keep this updated too. + let(:valid_session) { {} } + + describe "GET index" do + it "assigns all teams as @teams" do + team = Team.create! valid_attributes + get :index, {}, valid_session + assigns(:teams).should eq([team]) + end + end + + describe "GET show" do + it "assigns the requested team as @team" do + team = Team.create! valid_attributes + get :show, {:id => team.to_param}, valid_session + assigns(:team).should eq(team) + end + end + + describe "GET new" do + it "assigns a new team as @team" do + get :new, {}, valid_session + assigns(:team).should be_a_new(Team) + end + end + + describe "GET edit" do + it "assigns the requested team as @team" do + team = Team.create! valid_attributes + get :edit, {:id => team.to_param}, valid_session + assigns(:team).should eq(team) + end + end + + describe "POST create" do + describe "with valid params" do + it "creates a new Team" do + expect { + post :create, {:team => valid_attributes}, valid_session + }.to change(Team, :count).by(1) + end + + it "assigns a newly created team as @team" do + post :create, {:team => valid_attributes}, valid_session + assigns(:team).should be_a(Team) + assigns(:team).should be_persisted + end + + it "redirects to the created team" do + post :create, {:team => valid_attributes}, valid_session + response.should redirect_to(Team.last) + end + end + + describe "with invalid params" do + it "assigns a newly created but unsaved team as @team" do + # Trigger the behavior that occurs when invalid params are submitted + Team.any_instance.stub(:save).and_return(false) + post :create, {:team => { }}, valid_session + assigns(:team).should be_a_new(Team) + end + + it "re-renders the 'new' template" do + # Trigger the behavior that occurs when invalid params are submitted + Team.any_instance.stub(:save).and_return(false) + post :create, {:team => { }}, valid_session + response.should render_template("new") + end + end + end + + describe "PUT update" do + describe "with valid params" do + it "updates the requested team" do + team = Team.create! valid_attributes + # Assuming there are no other teams in the database, this + # specifies that the Team created on the previous line + # receives the :update_attributes message with whatever params are + # submitted in the request. + Team.any_instance.should_receive(:update).with({ "these" => "params" }) + put :update, {:id => team.to_param, :team => { "these" => "params" }}, valid_session + end + + it "assigns the requested team as @team" do + team = Team.create! valid_attributes + put :update, {:id => team.to_param, :team => valid_attributes}, valid_session + assigns(:team).should eq(team) + end + + it "redirects to the team" do + team = Team.create! valid_attributes + put :update, {:id => team.to_param, :team => valid_attributes}, valid_session + response.should redirect_to(team) + end + end + + describe "with invalid params" do + it "assigns the team as @team" do + team = Team.create! valid_attributes + # Trigger the behavior that occurs when invalid params are submitted + Team.any_instance.stub(:save).and_return(false) + put :update, {:id => team.to_param, :team => { }}, valid_session + assigns(:team).should eq(team) + end + + it "re-renders the 'edit' template" do + team = Team.create! valid_attributes + # Trigger the behavior that occurs when invalid params are submitted + Team.any_instance.stub(:save).and_return(false) + put :update, {:id => team.to_param, :team => { }}, valid_session + response.should render_template("edit") + end + end + end + + describe "DELETE destroy" do + it "destroys the requested team" do + team = Team.create! valid_attributes + expect { + delete :destroy, {:id => team.to_param}, valid_session + }.to change(Team, :count).by(-1) + end + + it "redirects to the teams list" do + team = Team.create! valid_attributes + delete :destroy, {:id => team.to_param}, valid_session + response.should redirect_to(teams_url) + end + end + +end diff --git a/spec/controllers/tournaments_controller_spec.rb b/spec/controllers/tournaments_controller_spec.rb new file mode 100644 index 0000000..f7b6e19 --- /dev/null +++ b/spec/controllers/tournaments_controller_spec.rb @@ -0,0 +1,160 @@ +require 'spec_helper' + +# This spec was generated by rspec-rails when you ran the scaffold generator. +# It demonstrates how one might use RSpec to specify the controller code that +# was generated by Rails when you ran the scaffold generator. +# +# It assumes that the implementation code is generated by the rails scaffold +# generator. If you are using any extension libraries to generate different +# controller code, this generated spec may or may not pass. +# +# It only uses APIs available in rails and/or rspec-rails. There are a number +# of tools you can use to make these specs even more expressive, but we're +# sticking to rails and rspec-rails APIs to keep things simple and stable. +# +# Compared to earlier versions of this generator, there is very limited use of +# stubs and message expectations in this spec. Stubs are only used when there +# is no simpler way to get a handle on the object needed for the example. +# Message expectations are only used when there is no simpler way to specify +# that an instance is receiving a specific message. + +describe TournamentsController do + + # This should return the minimal set of attributes required to create a valid + # Tournament. As you add validations to Tournament, be sure to + # adjust the attributes here as well. + let(:valid_attributes) { { "game" => "" } } + + # This should return the minimal set of values that should be in the session + # in order to pass any filters (e.g. authentication) defined in + # TournamentsController. Be sure to keep this updated too. + let(:valid_session) { {} } + + describe "GET index" do + it "assigns all tournaments as @tournaments" do + tournament = Tournament.create! valid_attributes + get :index, {}, valid_session + assigns(:tournaments).should eq([tournament]) + end + end + + describe "GET show" do + it "assigns the requested tournament as @tournament" do + tournament = Tournament.create! valid_attributes + get :show, {:id => tournament.to_param}, valid_session + assigns(:tournament).should eq(tournament) + end + end + + describe "GET new" do + it "assigns a new tournament as @tournament" do + get :new, {}, valid_session + assigns(:tournament).should be_a_new(Tournament) + end + end + + describe "GET edit" do + it "assigns the requested tournament as @tournament" do + tournament = Tournament.create! valid_attributes + get :edit, {:id => tournament.to_param}, valid_session + assigns(:tournament).should eq(tournament) + end + end + + describe "POST create" do + describe "with valid params" do + it "creates a new Tournament" do + expect { + post :create, {:tournament => valid_attributes}, valid_session + }.to change(Tournament, :count).by(1) + end + + it "assigns a newly created tournament as @tournament" do + post :create, {:tournament => valid_attributes}, valid_session + assigns(:tournament).should be_a(Tournament) + assigns(:tournament).should be_persisted + end + + it "redirects to the created tournament" do + post :create, {:tournament => valid_attributes}, valid_session + response.should redirect_to(Tournament.last) + end + end + + describe "with invalid params" do + it "assigns a newly created but unsaved tournament as @tournament" do + # Trigger the behavior that occurs when invalid params are submitted + Tournament.any_instance.stub(:save).and_return(false) + post :create, {:tournament => { "game" => "invalid value" }}, valid_session + assigns(:tournament).should be_a_new(Tournament) + end + + it "re-renders the 'new' template" do + # Trigger the behavior that occurs when invalid params are submitted + Tournament.any_instance.stub(:save).and_return(false) + post :create, {:tournament => { "game" => "invalid value" }}, valid_session + response.should render_template("new") + end + end + end + + describe "PUT update" do + describe "with valid params" do + it "updates the requested tournament" do + tournament = Tournament.create! valid_attributes + # Assuming there are no other tournaments in the database, this + # specifies that the Tournament created on the previous line + # receives the :update_attributes message with whatever params are + # submitted in the request. + Tournament.any_instance.should_receive(:update).with({ "game" => "" }) + put :update, {:id => tournament.to_param, :tournament => { "game" => "" }}, valid_session + end + + it "assigns the requested tournament as @tournament" do + tournament = Tournament.create! valid_attributes + put :update, {:id => tournament.to_param, :tournament => valid_attributes}, valid_session + assigns(:tournament).should eq(tournament) + end + + it "redirects to the tournament" do + tournament = Tournament.create! valid_attributes + put :update, {:id => tournament.to_param, :tournament => valid_attributes}, valid_session + response.should redirect_to(tournament) + end + end + + describe "with invalid params" do + it "assigns the tournament as @tournament" do + tournament = Tournament.create! valid_attributes + # Trigger the behavior that occurs when invalid params are submitted + Tournament.any_instance.stub(:save).and_return(false) + put :update, {:id => tournament.to_param, :tournament => { "game" => "invalid value" }}, valid_session + assigns(:tournament).should eq(tournament) + end + + it "re-renders the 'edit' template" do + tournament = Tournament.create! valid_attributes + # Trigger the behavior that occurs when invalid params are submitted + Tournament.any_instance.stub(:save).and_return(false) + put :update, {:id => tournament.to_param, :tournament => { "game" => "invalid value" }}, valid_session + response.should render_template("edit") + end + end + end + + describe "DELETE destroy" do + it "destroys the requested tournament" do + tournament = Tournament.create! valid_attributes + expect { + delete :destroy, {:id => tournament.to_param}, valid_session + }.to change(Tournament, :count).by(-1) + end + + it "redirects to the tournaments list" do + tournament = Tournament.create! valid_attributes + delete :destroy, {:id => tournament.to_param}, valid_session + response.should redirect_to(tournaments_url) + end + end + +end diff --git a/spec/controllers/users_controller_spec.rb b/spec/controllers/users_controller_spec.rb new file mode 100644 index 0000000..142455c --- /dev/null +++ b/spec/controllers/users_controller_spec.rb @@ -0,0 +1,5 @@ +require 'spec_helper' + +describe UsersController do + +end diff --git a/spec/helpers/alerts_helper_spec.rb b/spec/helpers/alerts_helper_spec.rb new file mode 100644 index 0000000..812e415 --- /dev/null +++ b/spec/helpers/alerts_helper_spec.rb @@ -0,0 +1,15 @@ +require 'spec_helper' + +# Specs in this file have access to a helper object that includes +# the AlertsHelper. For example: +# +# describe AlertsHelper do +# describe "string concat" do +# it "concats two strings with spaces" do +# helper.concat_strings("this","that").should == "this that" +# end +# end +# end +describe AlertsHelper do + pending "add some examples to (or delete) #{__FILE__}" +end diff --git a/spec/helpers/games_helper_spec.rb b/spec/helpers/games_helper_spec.rb new file mode 100644 index 0000000..72addeb --- /dev/null +++ b/spec/helpers/games_helper_spec.rb @@ -0,0 +1,15 @@ +require 'spec_helper' + +# Specs in this file have access to a helper object that includes +# the GamesHelper. For example: +# +# describe GamesHelper do +# describe "string concat" do +# it "concats two strings with spaces" do +# helper.concat_strings("this","that").should == "this that" +# end +# end +# end +describe GamesHelper do + pending "add some examples to (or delete) #{__FILE__}" +end diff --git a/spec/helpers/main_helper_spec.rb b/spec/helpers/main_helper_spec.rb new file mode 100644 index 0000000..9d316c5 --- /dev/null +++ b/spec/helpers/main_helper_spec.rb @@ -0,0 +1,15 @@ +require 'spec_helper' + +# Specs in this file have access to a helper object that includes +# the MainHelper. For example: +# +# describe MainHelper do +# describe "string concat" do +# it "concats two strings with spaces" do +# helper.concat_strings("this","that").should == "this that" +# end +# end +# end +describe MainHelper do + pending "add some examples to (or delete) #{__FILE__}" +end diff --git a/spec/helpers/matches_helper_spec.rb b/spec/helpers/matches_helper_spec.rb new file mode 100644 index 0000000..271cd00 --- /dev/null +++ b/spec/helpers/matches_helper_spec.rb @@ -0,0 +1,15 @@ +require 'spec_helper' + +# Specs in this file have access to a helper object that includes +# the MatchesHelper. For example: +# +# describe MatchesHelper do +# describe "string concat" do +# it "concats two strings with spaces" do +# helper.concat_strings("this","that").should == "this that" +# end +# end +# end +describe MatchesHelper do + pending "add some examples to (or delete) #{__FILE__}" +end diff --git a/spec/helpers/pms_helper_spec.rb b/spec/helpers/pms_helper_spec.rb new file mode 100644 index 0000000..5ebf709 --- /dev/null +++ b/spec/helpers/pms_helper_spec.rb @@ -0,0 +1,15 @@ +require 'spec_helper' + +# Specs in this file have access to a helper object that includes +# the PmsHelper. For example: +# +# describe PmsHelper do +# describe "string concat" do +# it "concats two strings with spaces" do +# helper.concat_strings("this","that").should == "this that" +# end +# end +# end +describe PmsHelper do + pending "add some examples to (or delete) #{__FILE__}" +end diff --git a/spec/helpers/search_helper_spec.rb b/spec/helpers/search_helper_spec.rb new file mode 100644 index 0000000..fabfe99 --- /dev/null +++ b/spec/helpers/search_helper_spec.rb @@ -0,0 +1,15 @@ +require 'spec_helper' + +# Specs in this file have access to a helper object that includes +# the SearchHelper. For example: +# +# describe SearchHelper do +# describe "string concat" do +# it "concats two strings with spaces" do +# helper.concat_strings("this","that").should == "this that" +# end +# end +# end +describe SearchHelper do + pending "add some examples to (or delete) #{__FILE__}" +end diff --git a/spec/helpers/servers_helper_spec.rb b/spec/helpers/servers_helper_spec.rb new file mode 100644 index 0000000..487d1e4 --- /dev/null +++ b/spec/helpers/servers_helper_spec.rb @@ -0,0 +1,15 @@ +require 'spec_helper' + +# Specs in this file have access to a helper object that includes +# the ServersHelper. For example: +# +# describe ServersHelper do +# describe "string concat" do +# it "concats two strings with spaces" do +# helper.concat_strings("this","that").should == "this that" +# end +# end +# end +describe ServersHelper do + pending "add some examples to (or delete) #{__FILE__}" +end diff --git a/spec/helpers/sessions_helper_spec.rb b/spec/helpers/sessions_helper_spec.rb new file mode 100644 index 0000000..c14cfa5 --- /dev/null +++ b/spec/helpers/sessions_helper_spec.rb @@ -0,0 +1,15 @@ +require 'spec_helper' + +# Specs in this file have access to a helper object that includes +# the SessionsHelper. For example: +# +# describe SessionsHelper do +# describe "string concat" do +# it "concats two strings with spaces" do +# helper.concat_strings("this","that").should == "this that" +# end +# end +# end +describe SessionsHelper do + pending "add some examples to (or delete) #{__FILE__}" +end diff --git a/spec/helpers/static_helper_spec.rb b/spec/helpers/static_helper_spec.rb new file mode 100644 index 0000000..6a1bf5c --- /dev/null +++ b/spec/helpers/static_helper_spec.rb @@ -0,0 +1,15 @@ +require 'spec_helper' + +# Specs in this file have access to a helper object that includes +# the StaticHelper. For example: +# +# describe StaticHelper do +# describe "string concat" do +# it "concats two strings with spaces" do +# helper.concat_strings("this","that").should == "this that" +# end +# end +# end +describe StaticHelper do + pending "add some examples to (or delete) #{__FILE__}" +end diff --git a/spec/helpers/teams_helper_spec.rb b/spec/helpers/teams_helper_spec.rb new file mode 100644 index 0000000..9572616 --- /dev/null +++ b/spec/helpers/teams_helper_spec.rb @@ -0,0 +1,15 @@ +require 'spec_helper' + +# Specs in this file have access to a helper object that includes +# the TeamsHelper. For example: +# +# describe TeamsHelper do +# describe "string concat" do +# it "concats two strings with spaces" do +# helper.concat_strings("this","that").should == "this that" +# end +# end +# end +describe TeamsHelper do + pending "add some examples to (or delete) #{__FILE__}" +end diff --git a/spec/helpers/tournaments_helper_spec.rb b/spec/helpers/tournaments_helper_spec.rb new file mode 100644 index 0000000..c7eb224 --- /dev/null +++ b/spec/helpers/tournaments_helper_spec.rb @@ -0,0 +1,15 @@ +require 'spec_helper' + +# Specs in this file have access to a helper object that includes +# the TournamentsHelper. For example: +# +# describe TournamentsHelper do +# describe "string concat" do +# it "concats two strings with spaces" do +# helper.concat_strings("this","that").should == "this that" +# end +# end +# end +describe TournamentsHelper do + pending "add some examples to (or delete) #{__FILE__}" +end diff --git a/spec/helpers/users_helper_spec.rb b/spec/helpers/users_helper_spec.rb new file mode 100644 index 0000000..e65fff9 --- /dev/null +++ b/spec/helpers/users_helper_spec.rb @@ -0,0 +1,15 @@ +require 'spec_helper' + +# Specs in this file have access to a helper object that includes +# the UsersHelper. For example: +# +# describe UsersHelper do +# describe "string concat" do +# it "concats two strings with spaces" do +# helper.concat_strings("this","that").should == "this that" +# end +# end +# end +describe UsersHelper do + pending "add some examples to (or delete) #{__FILE__}" +end diff --git a/spec/models/alert_spec.rb b/spec/models/alert_spec.rb new file mode 100644 index 0000000..d7fa4af --- /dev/null +++ b/spec/models/alert_spec.rb @@ -0,0 +1,5 @@ +require 'spec_helper' + +describe Alert do + pending "add some examples to (or delete) #{__FILE__}" +end diff --git a/spec/models/game_attribute_spec.rb b/spec/models/game_attribute_spec.rb new file mode 100644 index 0000000..200e59b --- /dev/null +++ b/spec/models/game_attribute_spec.rb @@ -0,0 +1,5 @@ +require 'spec_helper' + +describe GameAttribute do + pending "add some examples to (or delete) #{__FILE__}" +end diff --git a/spec/models/game_spec.rb b/spec/models/game_spec.rb new file mode 100644 index 0000000..8c56446 --- /dev/null +++ b/spec/models/game_spec.rb @@ -0,0 +1,5 @@ +require 'spec_helper' + +describe Game do + pending "add some examples to (or delete) #{__FILE__}" +end diff --git a/spec/models/match_spec.rb b/spec/models/match_spec.rb new file mode 100644 index 0000000..86931c9 --- /dev/null +++ b/spec/models/match_spec.rb @@ -0,0 +1,5 @@ +require 'spec_helper' + +describe Match do + pending "add some examples to (or delete) #{__FILE__}" +end diff --git a/spec/models/pm_spec.rb b/spec/models/pm_spec.rb new file mode 100644 index 0000000..d56845b --- /dev/null +++ b/spec/models/pm_spec.rb @@ -0,0 +1,5 @@ +require 'spec_helper' + +describe Pm do + pending "add some examples to (or delete) #{__FILE__}" +end diff --git a/spec/models/server_settings_spec.rb b/spec/models/server_settings_spec.rb new file mode 100644 index 0000000..d579746 --- /dev/null +++ b/spec/models/server_settings_spec.rb @@ -0,0 +1,5 @@ +require 'spec_helper' + +describe ServerSettings do + pending "add some examples to (or delete) #{__FILE__}" +end diff --git a/spec/models/server_spec.rb b/spec/models/server_spec.rb new file mode 100644 index 0000000..646344a --- /dev/null +++ b/spec/models/server_spec.rb @@ -0,0 +1,5 @@ +require 'spec_helper' + +describe Server do + pending "add some examples to (or delete) #{__FILE__}" +end diff --git a/spec/models/team_match_pair_spec.rb b/spec/models/team_match_pair_spec.rb new file mode 100644 index 0000000..676c563 --- /dev/null +++ b/spec/models/team_match_pair_spec.rb @@ -0,0 +1,5 @@ +require 'spec_helper' + +describe TeamMatchPair do + pending "add some examples to (or delete) #{__FILE__}" +end diff --git a/spec/models/team_spec.rb b/spec/models/team_spec.rb new file mode 100644 index 0000000..666a904 --- /dev/null +++ b/spec/models/team_spec.rb @@ -0,0 +1,5 @@ +require 'spec_helper' + +describe Team do + pending "add some examples to (or delete) #{__FILE__}" +end diff --git a/spec/models/tournament_option_spec.rb b/spec/models/tournament_option_spec.rb new file mode 100644 index 0000000..501b316 --- /dev/null +++ b/spec/models/tournament_option_spec.rb @@ -0,0 +1,5 @@ +require 'spec_helper' + +describe TournamentOption do + pending "add some examples to (or delete) #{__FILE__}" +end diff --git a/spec/models/tournament_spec.rb b/spec/models/tournament_spec.rb new file mode 100644 index 0000000..56c919d --- /dev/null +++ b/spec/models/tournament_spec.rb @@ -0,0 +1,5 @@ +require 'spec_helper' + +describe Tournament do + pending "add some examples to (or delete) #{__FILE__}" +end diff --git a/spec/models/user_spec.rb b/spec/models/user_spec.rb new file mode 100644 index 0000000..44032b4 --- /dev/null +++ b/spec/models/user_spec.rb @@ -0,0 +1,5 @@ +require 'spec_helper' + +describe User do + pending "add some examples to (or delete) #{__FILE__}" +end diff --git a/spec/models/user_team_pair_spec.rb b/spec/models/user_team_pair_spec.rb new file mode 100644 index 0000000..9947368 --- /dev/null +++ b/spec/models/user_team_pair_spec.rb @@ -0,0 +1,5 @@ +require 'spec_helper' + +describe UserTeamPair do + pending "add some examples to (or delete) #{__FILE__}" +end diff --git a/spec/requests/alerts_spec.rb b/spec/requests/alerts_spec.rb new file mode 100644 index 0000000..03c332a --- /dev/null +++ b/spec/requests/alerts_spec.rb @@ -0,0 +1,11 @@ +require 'spec_helper' + +describe "Alerts" do + describe "GET /alerts" do + it "works! (now write some real specs)" do + # Run the generator again with the --webrat flag if you want to use webrat methods/matchers + get alerts_path + response.status.should be(200) + end + end +end diff --git a/spec/requests/games_spec.rb b/spec/requests/games_spec.rb new file mode 100644 index 0000000..1a84608 --- /dev/null +++ b/spec/requests/games_spec.rb @@ -0,0 +1,11 @@ +require 'spec_helper' + +describe "Games" do + describe "GET /games" do + it "works! (now write some real specs)" do + # Run the generator again with the --webrat flag if you want to use webrat methods/matchers + get games_path + response.status.should be(200) + end + end +end diff --git a/spec/requests/matches_spec.rb b/spec/requests/matches_spec.rb new file mode 100644 index 0000000..250f746 --- /dev/null +++ b/spec/requests/matches_spec.rb @@ -0,0 +1,11 @@ +require 'spec_helper' + +describe "Matches" do + describe "GET /matches" do + it "works! (now write some real specs)" do + # Run the generator again with the --webrat flag if you want to use webrat methods/matchers + get matches_path + response.status.should be(200) + end + end +end diff --git a/spec/requests/pms_spec.rb b/spec/requests/pms_spec.rb new file mode 100644 index 0000000..1862b87 --- /dev/null +++ b/spec/requests/pms_spec.rb @@ -0,0 +1,11 @@ +require 'spec_helper' + +describe "Pms" do + describe "GET /pms" do + it "works! (now write some real specs)" do + # Run the generator again with the --webrat flag if you want to use webrat methods/matchers + get pms_path + response.status.should be(200) + end + end +end diff --git a/spec/requests/servers_spec.rb b/spec/requests/servers_spec.rb new file mode 100644 index 0000000..2a1562e --- /dev/null +++ b/spec/requests/servers_spec.rb @@ -0,0 +1,11 @@ +require 'spec_helper' + +describe "Servers" do + describe "GET /servers" do + it "works! (now write some real specs)" do + # Run the generator again with the --webrat flag if you want to use webrat methods/matchers + get servers_path + response.status.should be(200) + end + end +end diff --git a/spec/requests/teams_spec.rb b/spec/requests/teams_spec.rb new file mode 100644 index 0000000..f0caf7a --- /dev/null +++ b/spec/requests/teams_spec.rb @@ -0,0 +1,11 @@ +require 'spec_helper' + +describe "Teams" do + describe "GET /teams" do + it "works! (now write some real specs)" do + # Run the generator again with the --webrat flag if you want to use webrat methods/matchers + get teams_path + response.status.should be(200) + end + end +end diff --git a/spec/requests/tournaments_spec.rb b/spec/requests/tournaments_spec.rb new file mode 100644 index 0000000..09b4b55 --- /dev/null +++ b/spec/requests/tournaments_spec.rb @@ -0,0 +1,11 @@ +require 'spec_helper' + +describe "Tournaments" do + describe "GET /tournaments" do + it "works! (now write some real specs)" do + # Run the generator again with the --webrat flag if you want to use webrat methods/matchers + get tournaments_path + response.status.should be(200) + end + end +end diff --git a/spec/routing/alerts_routing_spec.rb b/spec/routing/alerts_routing_spec.rb new file mode 100644 index 0000000..9485907 --- /dev/null +++ b/spec/routing/alerts_routing_spec.rb @@ -0,0 +1,35 @@ +require "spec_helper" + +describe AlertsController do + describe "routing" do + + it "routes to #index" do + get("/alerts").should route_to("alerts#index") + end + + it "routes to #new" do + get("/alerts/new").should route_to("alerts#new") + end + + it "routes to #show" do + get("/alerts/1").should route_to("alerts#show", :id => "1") + end + + it "routes to #edit" do + get("/alerts/1/edit").should route_to("alerts#edit", :id => "1") + end + + it "routes to #create" do + post("/alerts").should route_to("alerts#create") + end + + it "routes to #update" do + put("/alerts/1").should route_to("alerts#update", :id => "1") + end + + it "routes to #destroy" do + delete("/alerts/1").should route_to("alerts#destroy", :id => "1") + end + + end +end diff --git a/spec/routing/games_routing_spec.rb b/spec/routing/games_routing_spec.rb new file mode 100644 index 0000000..3b3ec0c --- /dev/null +++ b/spec/routing/games_routing_spec.rb @@ -0,0 +1,35 @@ +require "spec_helper" + +describe GamesController do + describe "routing" do + + it "routes to #index" do + get("/games").should route_to("games#index") + end + + it "routes to #new" do + get("/games/new").should route_to("games#new") + end + + it "routes to #show" do + get("/games/1").should route_to("games#show", :id => "1") + end + + it "routes to #edit" do + get("/games/1/edit").should route_to("games#edit", :id => "1") + end + + it "routes to #create" do + post("/games").should route_to("games#create") + end + + it "routes to #update" do + put("/games/1").should route_to("games#update", :id => "1") + end + + it "routes to #destroy" do + delete("/games/1").should route_to("games#destroy", :id => "1") + end + + end +end diff --git a/spec/routing/matches_routing_spec.rb b/spec/routing/matches_routing_spec.rb new file mode 100644 index 0000000..a9f8254 --- /dev/null +++ b/spec/routing/matches_routing_spec.rb @@ -0,0 +1,35 @@ +require "spec_helper" + +describe MatchesController do + describe "routing" do + + it "routes to #index" do + get("/matches").should route_to("matches#index") + end + + it "routes to #new" do + get("/matches/new").should route_to("matches#new") + end + + it "routes to #show" do + get("/matches/1").should route_to("matches#show", :id => "1") + end + + it "routes to #edit" do + get("/matches/1/edit").should route_to("matches#edit", :id => "1") + end + + it "routes to #create" do + post("/matches").should route_to("matches#create") + end + + it "routes to #update" do + put("/matches/1").should route_to("matches#update", :id => "1") + end + + it "routes to #destroy" do + delete("/matches/1").should route_to("matches#destroy", :id => "1") + end + + end +end diff --git a/spec/routing/pms_routing_spec.rb b/spec/routing/pms_routing_spec.rb new file mode 100644 index 0000000..839b0a9 --- /dev/null +++ b/spec/routing/pms_routing_spec.rb @@ -0,0 +1,35 @@ +require "spec_helper" + +describe PmsController do + describe "routing" do + + it "routes to #index" do + get("/pms").should route_to("pms#index") + end + + it "routes to #new" do + get("/pms/new").should route_to("pms#new") + end + + it "routes to #show" do + get("/pms/1").should route_to("pms#show", :id => "1") + end + + it "routes to #edit" do + get("/pms/1/edit").should route_to("pms#edit", :id => "1") + end + + it "routes to #create" do + post("/pms").should route_to("pms#create") + end + + it "routes to #update" do + put("/pms/1").should route_to("pms#update", :id => "1") + end + + it "routes to #destroy" do + delete("/pms/1").should route_to("pms#destroy", :id => "1") + end + + end +end diff --git a/spec/routing/servers_routing_spec.rb b/spec/routing/servers_routing_spec.rb new file mode 100644 index 0000000..e514d15 --- /dev/null +++ b/spec/routing/servers_routing_spec.rb @@ -0,0 +1,35 @@ +require "spec_helper" + +describe ServersController do + describe "routing" do + + it "routes to #index" do + get("/servers").should route_to("servers#index") + end + + it "routes to #new" do + get("/servers/new").should route_to("servers#new") + end + + it "routes to #show" do + get("/servers/1").should route_to("servers#show", :id => "1") + end + + it "routes to #edit" do + get("/servers/1/edit").should route_to("servers#edit", :id => "1") + end + + it "routes to #create" do + post("/servers").should route_to("servers#create") + end + + it "routes to #update" do + put("/servers/1").should route_to("servers#update", :id => "1") + end + + it "routes to #destroy" do + delete("/servers/1").should route_to("servers#destroy", :id => "1") + end + + end +end diff --git a/spec/routing/teams_routing_spec.rb b/spec/routing/teams_routing_spec.rb new file mode 100644 index 0000000..818fa7b --- /dev/null +++ b/spec/routing/teams_routing_spec.rb @@ -0,0 +1,35 @@ +require "spec_helper" + +describe TeamsController do + describe "routing" do + + it "routes to #index" do + get("/teams").should route_to("teams#index") + end + + it "routes to #new" do + get("/teams/new").should route_to("teams#new") + end + + it "routes to #show" do + get("/teams/1").should route_to("teams#show", :id => "1") + end + + it "routes to #edit" do + get("/teams/1/edit").should route_to("teams#edit", :id => "1") + end + + it "routes to #create" do + post("/teams").should route_to("teams#create") + end + + it "routes to #update" do + put("/teams/1").should route_to("teams#update", :id => "1") + end + + it "routes to #destroy" do + delete("/teams/1").should route_to("teams#destroy", :id => "1") + end + + end +end diff --git a/spec/routing/tournaments_routing_spec.rb b/spec/routing/tournaments_routing_spec.rb new file mode 100644 index 0000000..e4a229c --- /dev/null +++ b/spec/routing/tournaments_routing_spec.rb @@ -0,0 +1,35 @@ +require "spec_helper" + +describe TournamentsController do + describe "routing" do + + it "routes to #index" do + get("/tournaments").should route_to("tournaments#index") + end + + it "routes to #new" do + get("/tournaments/new").should route_to("tournaments#new") + end + + it "routes to #show" do + get("/tournaments/1").should route_to("tournaments#show", :id => "1") + end + + it "routes to #edit" do + get("/tournaments/1/edit").should route_to("tournaments#edit", :id => "1") + end + + it "routes to #create" do + post("/tournaments").should route_to("tournaments#create") + end + + it "routes to #update" do + put("/tournaments/1").should route_to("tournaments#update", :id => "1") + end + + it "routes to #destroy" do + delete("/tournaments/1").should route_to("tournaments#destroy", :id => "1") + end + + end +end diff --git a/spec/views/alerts/edit.html.erb_spec.rb b/spec/views/alerts/edit.html.erb_spec.rb new file mode 100644 index 0000000..d837f26 --- /dev/null +++ b/spec/views/alerts/edit.html.erb_spec.rb @@ -0,0 +1,20 @@ +require 'spec_helper' + +describe "alerts/edit" do + before(:each) do + @alert = assign(:alert, stub_model(Alert, + :author => nil, + :message => "MyText" + )) + end + + it "renders the edit alert form" do + render + + # Run the generator again with the --webrat flag if you want to use webrat matchers + assert_select "form[action=?][method=?]", alert_path(@alert), "post" do + assert_select "input#alert_author[name=?]", "alert[author]" + assert_select "textarea#alert_message[name=?]", "alert[message]" + end + end +end diff --git a/spec/views/alerts/index.html.erb_spec.rb b/spec/views/alerts/index.html.erb_spec.rb new file mode 100644 index 0000000..a5b4f3c --- /dev/null +++ b/spec/views/alerts/index.html.erb_spec.rb @@ -0,0 +1,23 @@ +require 'spec_helper' + +describe "alerts/index" do + before(:each) do + assign(:alerts, [ + stub_model(Alert, + :author => nil, + :message => "MyText" + ), + stub_model(Alert, + :author => nil, + :message => "MyText" + ) + ]) + end + + it "renders a list of alerts" do + render + # Run the generator again with the --webrat flag if you want to use webrat matchers + assert_select "tr>td", :text => nil.to_s, :count => 2 + assert_select "tr>td", :text => "MyText".to_s, :count => 2 + end +end diff --git a/spec/views/alerts/new.html.erb_spec.rb b/spec/views/alerts/new.html.erb_spec.rb new file mode 100644 index 0000000..e38cbd3 --- /dev/null +++ b/spec/views/alerts/new.html.erb_spec.rb @@ -0,0 +1,20 @@ +require 'spec_helper' + +describe "alerts/new" do + before(:each) do + assign(:alert, stub_model(Alert, + :author => nil, + :message => "MyText" + ).as_new_record) + end + + it "renders new alert form" do + render + + # Run the generator again with the --webrat flag if you want to use webrat matchers + assert_select "form[action=?][method=?]", alerts_path, "post" do + assert_select "input#alert_author[name=?]", "alert[author]" + assert_select "textarea#alert_message[name=?]", "alert[message]" + end + end +end diff --git a/spec/views/alerts/show.html.erb_spec.rb b/spec/views/alerts/show.html.erb_spec.rb new file mode 100644 index 0000000..267c9f1 --- /dev/null +++ b/spec/views/alerts/show.html.erb_spec.rb @@ -0,0 +1,17 @@ +require 'spec_helper' + +describe "alerts/show" do + before(:each) do + @alert = assign(:alert, stub_model(Alert, + :author => nil, + :message => "MyText" + )) + end + + it "renders attributes in

" do + render + # Run the generator again with the --webrat flag if you want to use webrat matchers + rendered.should match(//) + rendered.should match(/MyText/) + end +end diff --git a/spec/views/games/edit.html.erb_spec.rb b/spec/views/games/edit.html.erb_spec.rb new file mode 100644 index 0000000..d568c90 --- /dev/null +++ b/spec/views/games/edit.html.erb_spec.rb @@ -0,0 +1,26 @@ +require 'spec_helper' + +describe "games/edit" do + before(:each) do + @game = assign(:game, stub_model(Game, + :name => "MyText", + :players_per_team => 1, + :teams_per_match => 1, + :set_rounds => 1, + :randomized_teams => 1 + )) + end + + it "renders the edit game form" do + render + + # Run the generator again with the --webrat flag if you want to use webrat matchers + assert_select "form[action=?][method=?]", game_path(@game), "post" do + assert_select "textarea#game_name[name=?]", "game[name]" + assert_select "input#game_players_per_team[name=?]", "game[players_per_team]" + assert_select "input#game_teams_per_match[name=?]", "game[teams_per_match]" + assert_select "input#game_set_rounds[name=?]", "game[set_rounds]" + assert_select "input#game_randomized_teams[name=?]", "game[randomized_teams]" + end + end +end diff --git a/spec/views/games/index.html.erb_spec.rb b/spec/views/games/index.html.erb_spec.rb new file mode 100644 index 0000000..3107393 --- /dev/null +++ b/spec/views/games/index.html.erb_spec.rb @@ -0,0 +1,32 @@ +require 'spec_helper' + +describe "games/index" do + before(:each) do + assign(:games, [ + stub_model(Game, + :name => "MyText", + :players_per_team => 1, + :teams_per_match => 2, + :set_rounds => 3, + :randomized_teams => 4 + ), + stub_model(Game, + :name => "MyText", + :players_per_team => 1, + :teams_per_match => 2, + :set_rounds => 3, + :randomized_teams => 4 + ) + ]) + end + + it "renders a list of games" do + render + # Run the generator again with the --webrat flag if you want to use webrat matchers + assert_select "tr>td", :text => "MyText".to_s, :count => 2 + assert_select "tr>td", :text => 1.to_s, :count => 2 + assert_select "tr>td", :text => 2.to_s, :count => 2 + assert_select "tr>td", :text => 3.to_s, :count => 2 + assert_select "tr>td", :text => 4.to_s, :count => 2 + end +end diff --git a/spec/views/games/new.html.erb_spec.rb b/spec/views/games/new.html.erb_spec.rb new file mode 100644 index 0000000..ebe6113 --- /dev/null +++ b/spec/views/games/new.html.erb_spec.rb @@ -0,0 +1,26 @@ +require 'spec_helper' + +describe "games/new" do + before(:each) do + assign(:game, stub_model(Game, + :name => "MyText", + :players_per_team => 1, + :teams_per_match => 1, + :set_rounds => 1, + :randomized_teams => 1 + ).as_new_record) + end + + it "renders new game form" do + render + + # Run the generator again with the --webrat flag if you want to use webrat matchers + assert_select "form[action=?][method=?]", games_path, "post" do + assert_select "textarea#game_name[name=?]", "game[name]" + assert_select "input#game_players_per_team[name=?]", "game[players_per_team]" + assert_select "input#game_teams_per_match[name=?]", "game[teams_per_match]" + assert_select "input#game_set_rounds[name=?]", "game[set_rounds]" + assert_select "input#game_randomized_teams[name=?]", "game[randomized_teams]" + end + end +end diff --git a/spec/views/games/show.html.erb_spec.rb b/spec/views/games/show.html.erb_spec.rb new file mode 100644 index 0000000..fb75ad6 --- /dev/null +++ b/spec/views/games/show.html.erb_spec.rb @@ -0,0 +1,23 @@ +require 'spec_helper' + +describe "games/show" do + before(:each) do + @game = assign(:game, stub_model(Game, + :name => "MyText", + :players_per_team => 1, + :teams_per_match => 2, + :set_rounds => 3, + :randomized_teams => 4 + )) + end + + it "renders attributes in

" do + render + # Run the generator again with the --webrat flag if you want to use webrat matchers + rendered.should match(/MyText/) + rendered.should match(/1/) + rendered.should match(/2/) + rendered.should match(/3/) + rendered.should match(/4/) + end +end diff --git a/spec/views/matches/edit.html.erb_spec.rb b/spec/views/matches/edit.html.erb_spec.rb new file mode 100644 index 0000000..0f7c673 --- /dev/null +++ b/spec/views/matches/edit.html.erb_spec.rb @@ -0,0 +1,18 @@ +require 'spec_helper' + +describe "matches/edit" do + before(:each) do + @match = assign(:match, stub_model(Match, + :tournament => nil + )) + end + + it "renders the edit match form" do + render + + # Run the generator again with the --webrat flag if you want to use webrat matchers + assert_select "form[action=?][method=?]", match_path(@match), "post" do + assert_select "input#match_tournament[name=?]", "match[tournament]" + end + end +end diff --git a/spec/views/matches/index.html.erb_spec.rb b/spec/views/matches/index.html.erb_spec.rb new file mode 100644 index 0000000..e920f16 --- /dev/null +++ b/spec/views/matches/index.html.erb_spec.rb @@ -0,0 +1,20 @@ +require 'spec_helper' + +describe "matches/index" do + before(:each) do + assign(:matches, [ + stub_model(Match, + :tournament => nil + ), + stub_model(Match, + :tournament => nil + ) + ]) + end + + it "renders a list of matches" do + render + # Run the generator again with the --webrat flag if you want to use webrat matchers + assert_select "tr>td", :text => nil.to_s, :count => 2 + end +end diff --git a/spec/views/matches/new.html.erb_spec.rb b/spec/views/matches/new.html.erb_spec.rb new file mode 100644 index 0000000..c3537dc --- /dev/null +++ b/spec/views/matches/new.html.erb_spec.rb @@ -0,0 +1,18 @@ +require 'spec_helper' + +describe "matches/new" do + before(:each) do + assign(:match, stub_model(Match, + :tournament => nil + ).as_new_record) + end + + it "renders new match form" do + render + + # Run the generator again with the --webrat flag if you want to use webrat matchers + assert_select "form[action=?][method=?]", matches_path, "post" do + assert_select "input#match_tournament[name=?]", "match[tournament]" + end + end +end diff --git a/spec/views/matches/show.html.erb_spec.rb b/spec/views/matches/show.html.erb_spec.rb new file mode 100644 index 0000000..4460feb --- /dev/null +++ b/spec/views/matches/show.html.erb_spec.rb @@ -0,0 +1,15 @@ +require 'spec_helper' + +describe "matches/show" do + before(:each) do + @match = assign(:match, stub_model(Match, + :tournament => nil + )) + end + + it "renders attributes in

" do + render + # Run the generator again with the --webrat flag if you want to use webrat matchers + rendered.should match(//) + end +end diff --git a/spec/views/pms/edit.html.erb_spec.rb b/spec/views/pms/edit.html.erb_spec.rb new file mode 100644 index 0000000..5ec0de5 --- /dev/null +++ b/spec/views/pms/edit.html.erb_spec.rb @@ -0,0 +1,22 @@ +require 'spec_helper' + +describe "pms/edit" do + before(:each) do + @pm = assign(:pm, stub_model(Pm, + :author => nil, + :recipient => nil, + :message => "MyText" + )) + end + + it "renders the edit pm form" do + render + + # Run the generator again with the --webrat flag if you want to use webrat matchers + assert_select "form[action=?][method=?]", pm_path(@pm), "post" do + assert_select "input#pm_author[name=?]", "pm[author]" + assert_select "input#pm_recipient[name=?]", "pm[recipient]" + assert_select "textarea#pm_message[name=?]", "pm[message]" + end + end +end diff --git a/spec/views/pms/index.html.erb_spec.rb b/spec/views/pms/index.html.erb_spec.rb new file mode 100644 index 0000000..a3bc733 --- /dev/null +++ b/spec/views/pms/index.html.erb_spec.rb @@ -0,0 +1,26 @@ +require 'spec_helper' + +describe "pms/index" do + before(:each) do + assign(:pms, [ + stub_model(Pm, + :author => nil, + :recipient => nil, + :message => "MyText" + ), + stub_model(Pm, + :author => nil, + :recipient => nil, + :message => "MyText" + ) + ]) + end + + it "renders a list of pms" do + render + # Run the generator again with the --webrat flag if you want to use webrat matchers + assert_select "tr>td", :text => nil.to_s, :count => 2 + assert_select "tr>td", :text => nil.to_s, :count => 2 + assert_select "tr>td", :text => "MyText".to_s, :count => 2 + end +end diff --git a/spec/views/pms/new.html.erb_spec.rb b/spec/views/pms/new.html.erb_spec.rb new file mode 100644 index 0000000..342af96 --- /dev/null +++ b/spec/views/pms/new.html.erb_spec.rb @@ -0,0 +1,22 @@ +require 'spec_helper' + +describe "pms/new" do + before(:each) do + assign(:pm, stub_model(Pm, + :author => nil, + :recipient => nil, + :message => "MyText" + ).as_new_record) + end + + it "renders new pm form" do + render + + # Run the generator again with the --webrat flag if you want to use webrat matchers + assert_select "form[action=?][method=?]", pms_path, "post" do + assert_select "input#pm_author[name=?]", "pm[author]" + assert_select "input#pm_recipient[name=?]", "pm[recipient]" + assert_select "textarea#pm_message[name=?]", "pm[message]" + end + end +end diff --git a/spec/views/pms/show.html.erb_spec.rb b/spec/views/pms/show.html.erb_spec.rb new file mode 100644 index 0000000..5802887 --- /dev/null +++ b/spec/views/pms/show.html.erb_spec.rb @@ -0,0 +1,19 @@ +require 'spec_helper' + +describe "pms/show" do + before(:each) do + @pm = assign(:pm, stub_model(Pm, + :author => nil, + :recipient => nil, + :message => "MyText" + )) + end + + it "renders attributes in

" do + render + # Run the generator again with the --webrat flag if you want to use webrat matchers + rendered.should match(//) + rendered.should match(//) + rendered.should match(/MyText/) + end +end diff --git a/spec/views/servers/edit.html.erb_spec.rb b/spec/views/servers/edit.html.erb_spec.rb new file mode 100644 index 0000000..870126c --- /dev/null +++ b/spec/views/servers/edit.html.erb_spec.rb @@ -0,0 +1,15 @@ +require 'spec_helper' + +describe "servers/edit" do + before(:each) do + @server = assign(:server, stub_model(Server)) + end + + it "renders the edit server form" do + render + + # Run the generator again with the --webrat flag if you want to use webrat matchers + assert_select "form[action=?][method=?]", server_path(@server), "post" do + end + end +end diff --git a/spec/views/servers/index.html.erb_spec.rb b/spec/views/servers/index.html.erb_spec.rb new file mode 100644 index 0000000..9af4a19 --- /dev/null +++ b/spec/views/servers/index.html.erb_spec.rb @@ -0,0 +1,15 @@ +require 'spec_helper' + +describe "servers/index" do + before(:each) do + assign(:servers, [ + stub_model(Server), + stub_model(Server) + ]) + end + + it "renders a list of servers" do + render + # Run the generator again with the --webrat flag if you want to use webrat matchers + end +end diff --git a/spec/views/servers/new.html.erb_spec.rb b/spec/views/servers/new.html.erb_spec.rb new file mode 100644 index 0000000..bfc69c5 --- /dev/null +++ b/spec/views/servers/new.html.erb_spec.rb @@ -0,0 +1,15 @@ +require 'spec_helper' + +describe "servers/new" do + before(:each) do + assign(:server, stub_model(Server).as_new_record) + end + + it "renders new server form" do + render + + # Run the generator again with the --webrat flag if you want to use webrat matchers + assert_select "form[action=?][method=?]", servers_path, "post" do + end + end +end diff --git a/spec/views/servers/show.html.erb_spec.rb b/spec/views/servers/show.html.erb_spec.rb new file mode 100644 index 0000000..3762389 --- /dev/null +++ b/spec/views/servers/show.html.erb_spec.rb @@ -0,0 +1,12 @@ +require 'spec_helper' + +describe "servers/show" do + before(:each) do + @server = assign(:server, stub_model(Server)) + end + + it "renders attributes in

" do + render + # Run the generator again with the --webrat flag if you want to use webrat matchers + end +end diff --git a/spec/views/teams/edit.html.erb_spec.rb b/spec/views/teams/edit.html.erb_spec.rb new file mode 100644 index 0000000..1153b6d --- /dev/null +++ b/spec/views/teams/edit.html.erb_spec.rb @@ -0,0 +1,15 @@ +require 'spec_helper' + +describe "teams/edit" do + before(:each) do + @team = assign(:team, stub_model(Team)) + end + + it "renders the edit team form" do + render + + # Run the generator again with the --webrat flag if you want to use webrat matchers + assert_select "form[action=?][method=?]", team_path(@team), "post" do + end + end +end diff --git a/spec/views/teams/index.html.erb_spec.rb b/spec/views/teams/index.html.erb_spec.rb new file mode 100644 index 0000000..e894f36 --- /dev/null +++ b/spec/views/teams/index.html.erb_spec.rb @@ -0,0 +1,15 @@ +require 'spec_helper' + +describe "teams/index" do + before(:each) do + assign(:teams, [ + stub_model(Team), + stub_model(Team) + ]) + end + + it "renders a list of teams" do + render + # Run the generator again with the --webrat flag if you want to use webrat matchers + end +end diff --git a/spec/views/teams/new.html.erb_spec.rb b/spec/views/teams/new.html.erb_spec.rb new file mode 100644 index 0000000..6a05475 --- /dev/null +++ b/spec/views/teams/new.html.erb_spec.rb @@ -0,0 +1,15 @@ +require 'spec_helper' + +describe "teams/new" do + before(:each) do + assign(:team, stub_model(Team).as_new_record) + end + + it "renders new team form" do + render + + # Run the generator again with the --webrat flag if you want to use webrat matchers + assert_select "form[action=?][method=?]", teams_path, "post" do + end + end +end diff --git a/spec/views/teams/show.html.erb_spec.rb b/spec/views/teams/show.html.erb_spec.rb new file mode 100644 index 0000000..1d8ebd5 --- /dev/null +++ b/spec/views/teams/show.html.erb_spec.rb @@ -0,0 +1,12 @@ +require 'spec_helper' + +describe "teams/show" do + before(:each) do + @team = assign(:team, stub_model(Team)) + end + + it "renders attributes in

" do + render + # Run the generator again with the --webrat flag if you want to use webrat matchers + end +end diff --git a/spec/views/tournaments/edit.html.erb_spec.rb b/spec/views/tournaments/edit.html.erb_spec.rb new file mode 100644 index 0000000..db7cbb5 --- /dev/null +++ b/spec/views/tournaments/edit.html.erb_spec.rb @@ -0,0 +1,18 @@ +require 'spec_helper' + +describe "tournaments/edit" do + before(:each) do + @tournament = assign(:tournament, stub_model(Tournament, + :game => nil + )) + end + + it "renders the edit tournament form" do + render + + # Run the generator again with the --webrat flag if you want to use webrat matchers + assert_select "form[action=?][method=?]", tournament_path(@tournament), "post" do + assert_select "input#tournament_game[name=?]", "tournament[game]" + end + end +end diff --git a/spec/views/tournaments/index.html.erb_spec.rb b/spec/views/tournaments/index.html.erb_spec.rb new file mode 100644 index 0000000..bf36e06 --- /dev/null +++ b/spec/views/tournaments/index.html.erb_spec.rb @@ -0,0 +1,20 @@ +require 'spec_helper' + +describe "tournaments/index" do + before(:each) do + assign(:tournaments, [ + stub_model(Tournament, + :game => nil + ), + stub_model(Tournament, + :game => nil + ) + ]) + end + + it "renders a list of tournaments" do + render + # Run the generator again with the --webrat flag if you want to use webrat matchers + assert_select "tr>td", :text => nil.to_s, :count => 2 + end +end diff --git a/spec/views/tournaments/new.html.erb_spec.rb b/spec/views/tournaments/new.html.erb_spec.rb new file mode 100644 index 0000000..49785a4 --- /dev/null +++ b/spec/views/tournaments/new.html.erb_spec.rb @@ -0,0 +1,18 @@ +require 'spec_helper' + +describe "tournaments/new" do + before(:each) do + assign(:tournament, stub_model(Tournament, + :game => nil + ).as_new_record) + end + + it "renders new tournament form" do + render + + # Run the generator again with the --webrat flag if you want to use webrat matchers + assert_select "form[action=?][method=?]", tournaments_path, "post" do + assert_select "input#tournament_game[name=?]", "tournament[game]" + end + end +end diff --git a/spec/views/tournaments/show.html.erb_spec.rb b/spec/views/tournaments/show.html.erb_spec.rb new file mode 100644 index 0000000..abb1879 --- /dev/null +++ b/spec/views/tournaments/show.html.erb_spec.rb @@ -0,0 +1,15 @@ +require 'spec_helper' + +describe "tournaments/show" do + before(:each) do + @tournament = assign(:tournament, stub_model(Tournament, + :game => nil + )) + end + + it "renders attributes in

" do + render + # Run the generator again with the --webrat flag if you want to use webrat matchers + rendered.should match(//) + end +end -- cgit v1.1-4-g5e80