From 94a5654371812905c154f29cef393d42f13c5eaa Mon Sep 17 00:00:00 2001 From: AndrewMurrell Date: Tue, 18 Feb 2014 18:16:28 -0500 Subject: Added the generate shell command. Please do not commit the generated files. --- app/assets/javascripts/matches.js.coffee | 3 + app/assets/javascripts/servers.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/matches.css.scss | 3 + app/assets/stylesheets/scaffolds.css.scss | 69 +++++++++++++++++++++++ app/assets/stylesheets/servers.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/matches_controller.rb | 74 +++++++++++++++++++++++++ app/controllers/servers_controller.rb | 74 +++++++++++++++++++++++++ app/controllers/teams_controller.rb | 74 +++++++++++++++++++++++++ app/controllers/tournaments_controller.rb | 74 +++++++++++++++++++++++++ app/controllers/users_controller.rb | 74 +++++++++++++++++++++++++ app/helpers/matches_helper.rb | 2 + app/helpers/servers_helper.rb | 2 + app/helpers/teams_helper.rb | 2 + app/helpers/tournaments_helper.rb | 2 + app/helpers/users_helper.rb | 2 + app/models/match.rb | 2 + app/models/server.rb | 2 + app/models/team.rb | 2 + app/models/tournament.rb | 2 + app/models/user.rb | 2 + app/views/matches/_form.html.erb | 17 ++++++ app/views/matches/edit.html.erb | 6 ++ app/views/matches/index.html.erb | 25 +++++++++ app/views/matches/index.json.jbuilder | 4 ++ app/views/matches/new.html.erb | 5 ++ app/views/matches/show.html.erb | 4 ++ app/views/matches/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 | 17 ++++++ app/views/tournaments/edit.html.erb | 6 ++ app/views/tournaments/index.html.erb | 25 +++++++++ app/views/tournaments/index.json.jbuilder | 4 ++ app/views/tournaments/new.html.erb | 5 ++ app/views/tournaments/show.html.erb | 4 ++ app/views/tournaments/show.json.jbuilder | 1 + app/views/users/_form.html.erb | 17 ++++++ app/views/users/edit.html.erb | 6 ++ app/views/users/index.html.erb | 25 +++++++++ app/views/users/index.json.jbuilder | 4 ++ app/views/users/new.html.erb | 5 ++ app/views/users/show.html.erb | 4 ++ app/views/users/show.json.jbuilder | 1 + config/routes.rb | 10 ++++ db/migrate/20140304014711_create_servers.rb | 8 +++ db/migrate/20140304014713_create_tournaments.rb | 8 +++ db/migrate/20140304014715_create_matches.rb | 8 +++ db/migrate/20140304014718_create_teams.rb | 8 +++ db/migrate/20140304014720_create_users.rb | 8 +++ generate.sh | 8 +++ test/controllers/matches_controller_test.rb | 49 ++++++++++++++++ test/controllers/servers_controller_test.rb | 49 ++++++++++++++++ test/controllers/teams_controller_test.rb | 49 ++++++++++++++++ test/controllers/tournaments_controller_test.rb | 49 ++++++++++++++++ test/controllers/users_controller_test.rb | 49 ++++++++++++++++ test/fixtures/matches.yml | 11 ++++ test/fixtures/servers.yml | 11 ++++ test/fixtures/teams.yml | 11 ++++ test/fixtures/tournaments.yml | 11 ++++ test/fixtures/users.yml | 11 ++++ test/helpers/matches_helper_test.rb | 4 ++ test/helpers/servers_helper_test.rb | 4 ++ test/helpers/teams_helper_test.rb | 4 ++ test/helpers/tournaments_helper_test.rb | 4 ++ test/helpers/users_helper_test.rb | 4 ++ test/models/match_test.rb | 7 +++ test/models/server_test.rb | 7 +++ test/models/team_test.rb | 7 +++ test/models/tournament_test.rb | 7 +++ test/models/user_test.rb | 7 +++ 88 files changed, 1212 insertions(+) create mode 100644 app/assets/javascripts/matches.js.coffee create mode 100644 app/assets/javascripts/servers.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/matches.css.scss create mode 100644 app/assets/stylesheets/scaffolds.css.scss create mode 100644 app/assets/stylesheets/servers.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/matches_controller.rb create mode 100644 app/controllers/servers_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/matches_helper.rb create mode 100644 app/helpers/servers_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/match.rb create mode 100644 app/models/server.rb create mode 100644 app/models/team.rb create mode 100644 app/models/tournament.rb create mode 100644 app/models/user.rb 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/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 app/views/users/_form.html.erb create mode 100644 app/views/users/edit.html.erb create mode 100644 app/views/users/index.html.erb create mode 100644 app/views/users/index.json.jbuilder create mode 100644 app/views/users/new.html.erb create mode 100644 app/views/users/show.html.erb create mode 100644 app/views/users/show.json.jbuilder create mode 100644 db/migrate/20140304014711_create_servers.rb create mode 100644 db/migrate/20140304014713_create_tournaments.rb create mode 100644 db/migrate/20140304014715_create_matches.rb create mode 100644 db/migrate/20140304014718_create_teams.rb create mode 100644 db/migrate/20140304014720_create_users.rb create mode 100755 generate.sh create mode 100644 test/controllers/matches_controller_test.rb create mode 100644 test/controllers/servers_controller_test.rb create mode 100644 test/controllers/teams_controller_test.rb create mode 100644 test/controllers/tournaments_controller_test.rb create mode 100644 test/controllers/users_controller_test.rb create mode 100644 test/fixtures/matches.yml create mode 100644 test/fixtures/servers.yml create mode 100644 test/fixtures/teams.yml create mode 100644 test/fixtures/tournaments.yml create mode 100644 test/fixtures/users.yml create mode 100644 test/helpers/matches_helper_test.rb create mode 100644 test/helpers/servers_helper_test.rb create mode 100644 test/helpers/teams_helper_test.rb create mode 100644 test/helpers/tournaments_helper_test.rb create mode 100644 test/helpers/users_helper_test.rb create mode 100644 test/models/match_test.rb create mode 100644 test/models/server_test.rb create mode 100644 test/models/team_test.rb create mode 100644 test/models/tournament_test.rb create mode 100644 test/models/user_test.rb 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/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/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/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/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/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/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/matches_controller.rb b/app/controllers/matches_controller.rb new file mode 100644 index 0000000..4c0c4e4 --- /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[:match] + end +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/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..ea3857c --- /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[:tournament] + end +end diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb new file mode 100644 index 0000000..da49625 --- /dev/null +++ b/app/controllers/users_controller.rb @@ -0,0 +1,74 @@ +class UsersController < ApplicationController + before_action :set_user, only: [:show, :edit, :update, :destroy] + + # GET /users + # GET /users.json + def index + @users = User.all + end + + # GET /users/1 + # GET /users/1.json + def show + end + + # GET /users/new + def new + @user = User.new + end + + # GET /users/1/edit + def edit + end + + # POST /users + # POST /users.json + def create + @user = User.new(user_params) + + respond_to do |format| + if @user.save + format.html { redirect_to @user, notice: 'User was successfully created.' } + format.json { render action: 'show', status: :created, location: @user } + else + format.html { render action: 'new' } + format.json { render json: @user.errors, status: :unprocessable_entity } + end + end + end + + # PATCH/PUT /users/1 + # PATCH/PUT /users/1.json + def update + respond_to do |format| + if @user.update(user_params) + format.html { redirect_to @user, notice: 'User was successfully updated.' } + format.json { head :no_content } + else + format.html { render action: 'edit' } + format.json { render json: @user.errors, status: :unprocessable_entity } + end + end + end + + # DELETE /users/1 + # DELETE /users/1.json + def destroy + @user.destroy + respond_to do |format| + format.html { redirect_to users_url } + format.json { head :no_content } + end + end + + private + # Use callbacks to share common setup or constraints between actions. + def set_user + @user = User.find(params[:id]) + end + + # Never trust parameters from the scary internet, only allow the white list through. + def user_params + params[:user] + end +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/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/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/match.rb b/app/models/match.rb new file mode 100644 index 0000000..0836114 --- /dev/null +++ b/app/models/match.rb @@ -0,0 +1,2 @@ +class Match < ActiveRecord::Base +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/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/tournament.rb b/app/models/tournament.rb new file mode 100644 index 0000000..da3da0e --- /dev/null +++ b/app/models/tournament.rb @@ -0,0 +1,2 @@ +class Tournament < 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/views/matches/_form.html.erb b/app/views/matches/_form.html.erb new file mode 100644 index 0000000..c772c7f --- /dev/null +++ b/app/views/matches/_form.html.erb @@ -0,0 +1,17 @@ +<%= form_for(@match) do |f| %> + <% if @match.errors.any? %> +
+

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

+ + +
+ <% end %> + +
+ <%= 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..22ae41e --- /dev/null +++ b/app/views/matches/index.html.erb @@ -0,0 +1,25 @@ +

Listing matches

+ + + + + + + + + + + + <% @matches.each do |match| %> + + + + + + <% end %> + +
<%= 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..08daa52 --- /dev/null +++ b/app/views/matches/index.json.jbuilder @@ -0,0 +1,4 @@ +json.array!(@matches) do |match| + json.extract! match, :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..453985b --- /dev/null +++ b/app/views/matches/show.html.erb @@ -0,0 +1,4 @@ +

<%= notice %>

+ +<%= 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..7190e4c --- /dev/null +++ b/app/views/matches/show.json.jbuilder @@ -0,0 +1 @@ +json.extract! @match, :id, :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..8996266 --- /dev/null +++ b/app/views/tournaments/_form.html.erb @@ -0,0 +1,17 @@ +<%= form_for(@tournament) do |f| %> + <% if @tournament.errors.any? %> +
+

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

+ + +
+ <% end %> + +
+ <%= 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..7124111 --- /dev/null +++ b/app/views/tournaments/index.html.erb @@ -0,0 +1,25 @@ +

Listing tournaments

+ + + + + + + + + + + + <% @tournaments.each do |tournament| %> + + + + + + <% end %> + +
<%= 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..28d6960 --- /dev/null +++ b/app/views/tournaments/index.json.jbuilder @@ -0,0 +1,4 @@ +json.array!(@tournaments) do |tournament| + json.extract! tournament, :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..2c280ba --- /dev/null +++ b/app/views/tournaments/show.html.erb @@ -0,0 +1,4 @@ +

<%= notice %>

+ +<%= 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..211799a --- /dev/null +++ b/app/views/tournaments/show.json.jbuilder @@ -0,0 +1 @@ +json.extract! @tournament, :id, :created_at, :updated_at diff --git a/app/views/users/_form.html.erb b/app/views/users/_form.html.erb new file mode 100644 index 0000000..4835056 --- /dev/null +++ b/app/views/users/_form.html.erb @@ -0,0 +1,17 @@ +<%= form_for(@user) do |f| %> + <% if @user.errors.any? %> +
+

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

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

Editing user

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

Listing users

+ + + + + + + + + + + + <% @users.each do |user| %> + + + + + + <% end %> + +
<%= link_to 'Show', user %><%= link_to 'Edit', edit_user_path(user) %><%= link_to 'Destroy', user, method: :delete, data: { confirm: 'Are you sure?' } %>
+ +
+ +<%= link_to 'New User', new_user_path %> diff --git a/app/views/users/index.json.jbuilder b/app/views/users/index.json.jbuilder new file mode 100644 index 0000000..6684a9c --- /dev/null +++ b/app/views/users/index.json.jbuilder @@ -0,0 +1,4 @@ +json.array!(@users) do |user| + json.extract! user, :id + json.url user_url(user, format: :json) +end diff --git a/app/views/users/new.html.erb b/app/views/users/new.html.erb new file mode 100644 index 0000000..efc0404 --- /dev/null +++ b/app/views/users/new.html.erb @@ -0,0 +1,5 @@ +

New user

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

<%= notice %>

+ +<%= link_to 'Edit', edit_user_path(@user) %> | +<%= link_to 'Back', users_path %> diff --git a/app/views/users/show.json.jbuilder b/app/views/users/show.json.jbuilder new file mode 100644 index 0000000..80ed63e --- /dev/null +++ b/app/views/users/show.json.jbuilder @@ -0,0 +1 @@ +json.extract! @user, :id, :created_at, :updated_at diff --git a/config/routes.rb b/config/routes.rb index 876667f..b954a33 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -1,4 +1,14 @@ Leaguer::Application.routes.draw do + resources :users + + 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/20140304014711_create_servers.rb b/db/migrate/20140304014711_create_servers.rb new file mode 100644 index 0000000..f33241a --- /dev/null +++ b/db/migrate/20140304014711_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/20140304014713_create_tournaments.rb b/db/migrate/20140304014713_create_tournaments.rb new file mode 100644 index 0000000..2095590 --- /dev/null +++ b/db/migrate/20140304014713_create_tournaments.rb @@ -0,0 +1,8 @@ +class CreateTournaments < ActiveRecord::Migration + def change + create_table :tournaments do |t| + + t.timestamps + end + end +end diff --git a/db/migrate/20140304014715_create_matches.rb b/db/migrate/20140304014715_create_matches.rb new file mode 100644 index 0000000..1478e75 --- /dev/null +++ b/db/migrate/20140304014715_create_matches.rb @@ -0,0 +1,8 @@ +class CreateMatches < ActiveRecord::Migration + def change + create_table :matches do |t| + + t.timestamps + end + end +end diff --git a/db/migrate/20140304014718_create_teams.rb b/db/migrate/20140304014718_create_teams.rb new file mode 100644 index 0000000..dd8397d --- /dev/null +++ b/db/migrate/20140304014718_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/20140304014720_create_users.rb b/db/migrate/20140304014720_create_users.rb new file mode 100644 index 0000000..163109f --- /dev/null +++ b/db/migrate/20140304014720_create_users.rb @@ -0,0 +1,8 @@ +class CreateUsers < ActiveRecord::Migration + def change + create_table :users do |t| + + t.timestamps + end + end +end diff --git a/generate.sh b/generate.sh new file mode 100755 index 0000000..04a1294 --- /dev/null +++ b/generate.sh @@ -0,0 +1,8 @@ +#!/bin/bash + +bundle exec rails generate scaffold server +bundle exec rails generate scaffold tournament +bundle exec rails generate scaffold match +bundle exec rails generate scaffold team +bundle exec rails generate scaffold user +#bundle exec rails generate scaffold diff --git a/test/controllers/matches_controller_test.rb b/test/controllers/matches_controller_test.rb new file mode 100644 index 0000000..353ff4b --- /dev/null +++ b/test/controllers/matches_controller_test.rb @@ -0,0 +1,49 @@ +require 'test_helper' + +class MatchesControllerTest < ActionController::TestCase + setup do + @match = matches(:one) + end + + test "should get index" do + get :index + assert_response :success + assert_not_nil assigns(:matches) + end + + test "should get new" do + get :new + assert_response :success + end + + test "should create match" do + assert_difference('Match.count') do + post :create, match: { } + end + + assert_redirected_to match_path(assigns(:match)) + end + + test "should show match" do + get :show, id: @match + assert_response :success + end + + test "should get edit" do + get :edit, id: @match + assert_response :success + end + + test "should update match" do + patch :update, id: @match, match: { } + assert_redirected_to match_path(assigns(:match)) + end + + test "should destroy match" do + assert_difference('Match.count', -1) do + delete :destroy, id: @match + end + + assert_redirected_to matches_path + end +end diff --git a/test/controllers/servers_controller_test.rb b/test/controllers/servers_controller_test.rb new file mode 100644 index 0000000..5891bb0 --- /dev/null +++ b/test/controllers/servers_controller_test.rb @@ -0,0 +1,49 @@ +require 'test_helper' + +class ServersControllerTest < ActionController::TestCase + setup do + @server = servers(:one) + end + + test "should get index" do + get :index + assert_response :success + assert_not_nil assigns(:servers) + end + + test "should get new" do + get :new + assert_response :success + end + + test "should create server" do + assert_difference('Server.count') do + post :create, server: { } + end + + assert_redirected_to server_path(assigns(:server)) + end + + test "should show server" do + get :show, id: @server + assert_response :success + end + + test "should get edit" do + get :edit, id: @server + assert_response :success + end + + test "should update server" do + patch :update, id: @server, server: { } + assert_redirected_to server_path(assigns(:server)) + end + + test "should destroy server" do + assert_difference('Server.count', -1) do + delete :destroy, id: @server + end + + assert_redirected_to servers_path + end +end diff --git a/test/controllers/teams_controller_test.rb b/test/controllers/teams_controller_test.rb new file mode 100644 index 0000000..8bf60be --- /dev/null +++ b/test/controllers/teams_controller_test.rb @@ -0,0 +1,49 @@ +require 'test_helper' + +class TeamsControllerTest < ActionController::TestCase + setup do + @team = teams(:one) + end + + test "should get index" do + get :index + assert_response :success + assert_not_nil assigns(:teams) + end + + test "should get new" do + get :new + assert_response :success + end + + test "should create team" do + assert_difference('Team.count') do + post :create, team: { } + end + + assert_redirected_to team_path(assigns(:team)) + end + + test "should show team" do + get :show, id: @team + assert_response :success + end + + test "should get edit" do + get :edit, id: @team + assert_response :success + end + + test "should update team" do + patch :update, id: @team, team: { } + assert_redirected_to team_path(assigns(:team)) + end + + test "should destroy team" do + assert_difference('Team.count', -1) do + delete :destroy, id: @team + end + + assert_redirected_to teams_path + end +end diff --git a/test/controllers/tournaments_controller_test.rb b/test/controllers/tournaments_controller_test.rb new file mode 100644 index 0000000..9363bdf --- /dev/null +++ b/test/controllers/tournaments_controller_test.rb @@ -0,0 +1,49 @@ +require 'test_helper' + +class TournamentsControllerTest < ActionController::TestCase + setup do + @tournament = tournaments(:one) + end + + test "should get index" do + get :index + assert_response :success + assert_not_nil assigns(:tournaments) + end + + test "should get new" do + get :new + assert_response :success + end + + test "should create tournament" do + assert_difference('Tournament.count') do + post :create, tournament: { } + end + + assert_redirected_to tournament_path(assigns(:tournament)) + end + + test "should show tournament" do + get :show, id: @tournament + assert_response :success + end + + test "should get edit" do + get :edit, id: @tournament + assert_response :success + end + + test "should update tournament" do + patch :update, id: @tournament, tournament: { } + assert_redirected_to tournament_path(assigns(:tournament)) + end + + test "should destroy tournament" do + assert_difference('Tournament.count', -1) do + delete :destroy, id: @tournament + end + + assert_redirected_to tournaments_path + end +end diff --git a/test/controllers/users_controller_test.rb b/test/controllers/users_controller_test.rb new file mode 100644 index 0000000..846e74c --- /dev/null +++ b/test/controllers/users_controller_test.rb @@ -0,0 +1,49 @@ +require 'test_helper' + +class UsersControllerTest < ActionController::TestCase + setup do + @user = users(:one) + end + + test "should get index" do + get :index + assert_response :success + assert_not_nil assigns(:users) + end + + test "should get new" do + get :new + assert_response :success + end + + test "should create user" do + assert_difference('User.count') do + post :create, user: { } + end + + assert_redirected_to user_path(assigns(:user)) + end + + test "should show user" do + get :show, id: @user + assert_response :success + end + + test "should get edit" do + get :edit, id: @user + assert_response :success + end + + test "should update user" do + patch :update, id: @user, user: { } + assert_redirected_to user_path(assigns(:user)) + end + + test "should destroy user" do + assert_difference('User.count', -1) do + delete :destroy, id: @user + end + + assert_redirected_to users_path + end +end diff --git a/test/fixtures/matches.yml b/test/fixtures/matches.yml new file mode 100644 index 0000000..937a0c0 --- /dev/null +++ b/test/fixtures/matches.yml @@ -0,0 +1,11 @@ +# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html + +# This model initially had no columns defined. If you add columns to the +# model remove the '{}' from the fixture names and add the columns immediately +# below each fixture, per the syntax in the comments below +# +one: {} +# column: value +# +two: {} +# column: value diff --git a/test/fixtures/servers.yml b/test/fixtures/servers.yml new file mode 100644 index 0000000..937a0c0 --- /dev/null +++ b/test/fixtures/servers.yml @@ -0,0 +1,11 @@ +# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html + +# This model initially had no columns defined. If you add columns to the +# model remove the '{}' from the fixture names and add the columns immediately +# below each fixture, per the syntax in the comments below +# +one: {} +# column: value +# +two: {} +# column: value diff --git a/test/fixtures/teams.yml b/test/fixtures/teams.yml new file mode 100644 index 0000000..937a0c0 --- /dev/null +++ b/test/fixtures/teams.yml @@ -0,0 +1,11 @@ +# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html + +# This model initially had no columns defined. If you add columns to the +# model remove the '{}' from the fixture names and add the columns immediately +# below each fixture, per the syntax in the comments below +# +one: {} +# column: value +# +two: {} +# column: value diff --git a/test/fixtures/tournaments.yml b/test/fixtures/tournaments.yml new file mode 100644 index 0000000..937a0c0 --- /dev/null +++ b/test/fixtures/tournaments.yml @@ -0,0 +1,11 @@ +# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html + +# This model initially had no columns defined. If you add columns to the +# model remove the '{}' from the fixture names and add the columns immediately +# below each fixture, per the syntax in the comments below +# +one: {} +# column: value +# +two: {} +# column: value diff --git a/test/fixtures/users.yml b/test/fixtures/users.yml new file mode 100644 index 0000000..937a0c0 --- /dev/null +++ b/test/fixtures/users.yml @@ -0,0 +1,11 @@ +# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html + +# This model initially had no columns defined. If you add columns to the +# model remove the '{}' from the fixture names and add the columns immediately +# below each fixture, per the syntax in the comments below +# +one: {} +# column: value +# +two: {} +# column: value diff --git a/test/helpers/matches_helper_test.rb b/test/helpers/matches_helper_test.rb new file mode 100644 index 0000000..4cc472f --- /dev/null +++ b/test/helpers/matches_helper_test.rb @@ -0,0 +1,4 @@ +require 'test_helper' + +class MatchesHelperTest < ActionView::TestCase +end diff --git a/test/helpers/servers_helper_test.rb b/test/helpers/servers_helper_test.rb new file mode 100644 index 0000000..8fddf34 --- /dev/null +++ b/test/helpers/servers_helper_test.rb @@ -0,0 +1,4 @@ +require 'test_helper' + +class ServersHelperTest < ActionView::TestCase +end diff --git a/test/helpers/teams_helper_test.rb b/test/helpers/teams_helper_test.rb new file mode 100644 index 0000000..b736483 --- /dev/null +++ b/test/helpers/teams_helper_test.rb @@ -0,0 +1,4 @@ +require 'test_helper' + +class TeamsHelperTest < ActionView::TestCase +end diff --git a/test/helpers/tournaments_helper_test.rb b/test/helpers/tournaments_helper_test.rb new file mode 100644 index 0000000..1cf5269 --- /dev/null +++ b/test/helpers/tournaments_helper_test.rb @@ -0,0 +1,4 @@ +require 'test_helper' + +class TournamentsHelperTest < ActionView::TestCase +end diff --git a/test/helpers/users_helper_test.rb b/test/helpers/users_helper_test.rb new file mode 100644 index 0000000..96af37a --- /dev/null +++ b/test/helpers/users_helper_test.rb @@ -0,0 +1,4 @@ +require 'test_helper' + +class UsersHelperTest < ActionView::TestCase +end diff --git a/test/models/match_test.rb b/test/models/match_test.rb new file mode 100644 index 0000000..14436b1 --- /dev/null +++ b/test/models/match_test.rb @@ -0,0 +1,7 @@ +require 'test_helper' + +class MatchTest < ActiveSupport::TestCase + # test "the truth" do + # assert true + # end +end diff --git a/test/models/server_test.rb b/test/models/server_test.rb new file mode 100644 index 0000000..125ffc9 --- /dev/null +++ b/test/models/server_test.rb @@ -0,0 +1,7 @@ +require 'test_helper' + +class ServerTest < ActiveSupport::TestCase + # test "the truth" do + # assert true + # end +end diff --git a/test/models/team_test.rb b/test/models/team_test.rb new file mode 100644 index 0000000..8b101cb --- /dev/null +++ b/test/models/team_test.rb @@ -0,0 +1,7 @@ +require 'test_helper' + +class TeamTest < ActiveSupport::TestCase + # test "the truth" do + # assert true + # end +end diff --git a/test/models/tournament_test.rb b/test/models/tournament_test.rb new file mode 100644 index 0000000..24a7e5f --- /dev/null +++ b/test/models/tournament_test.rb @@ -0,0 +1,7 @@ +require 'test_helper' + +class TournamentTest < ActiveSupport::TestCase + # test "the truth" do + # assert true + # end +end diff --git a/test/models/user_test.rb b/test/models/user_test.rb new file mode 100644 index 0000000..82f61e0 --- /dev/null +++ b/test/models/user_test.rb @@ -0,0 +1,7 @@ +require 'test_helper' + +class UserTest < ActiveSupport::TestCase + # test "the truth" do + # assert true + # end +end -- cgit v1.1-4-g5e80 From 1b95d76d2bded709f512ccdca851388b8691708f Mon Sep 17 00:00:00 2001 From: AndrewMurrell Date: Tue, 18 Feb 2014 18:34:50 -0500 Subject: Updated generate and added basic instruction block comment. --- db/migrate/20140304014711_create_servers.rb | 8 ----- db/migrate/20140304014713_create_tournaments.rb | 8 ----- db/migrate/20140304014715_create_matches.rb | 8 ----- db/migrate/20140304014718_create_teams.rb | 8 ----- db/migrate/20140304014720_create_users.rb | 8 ----- db/migrate/20140304014722_create_servers.rb | 8 +++++ db/migrate/20140304014725_create_tournaments.rb | 8 +++++ db/migrate/20140304014727_create_matches.rb | 8 +++++ db/migrate/20140304014729_create_teams.rb | 8 +++++ db/migrate/20140304014731_create_users.rb | 8 +++++ db/schema.rb | 41 +++++++++++++++++++++++++ generate.sh | 10 ++++++ 12 files changed, 91 insertions(+), 40 deletions(-) delete mode 100644 db/migrate/20140304014711_create_servers.rb delete mode 100644 db/migrate/20140304014713_create_tournaments.rb delete mode 100644 db/migrate/20140304014715_create_matches.rb delete mode 100644 db/migrate/20140304014718_create_teams.rb delete mode 100644 db/migrate/20140304014720_create_users.rb create mode 100644 db/migrate/20140304014722_create_servers.rb create mode 100644 db/migrate/20140304014725_create_tournaments.rb create mode 100644 db/migrate/20140304014727_create_matches.rb create mode 100644 db/migrate/20140304014729_create_teams.rb create mode 100644 db/migrate/20140304014731_create_users.rb create mode 100644 db/schema.rb diff --git a/db/migrate/20140304014711_create_servers.rb b/db/migrate/20140304014711_create_servers.rb deleted file mode 100644 index f33241a..0000000 --- a/db/migrate/20140304014711_create_servers.rb +++ /dev/null @@ -1,8 +0,0 @@ -class CreateServers < ActiveRecord::Migration - def change - create_table :servers do |t| - - t.timestamps - end - end -end diff --git a/db/migrate/20140304014713_create_tournaments.rb b/db/migrate/20140304014713_create_tournaments.rb deleted file mode 100644 index 2095590..0000000 --- a/db/migrate/20140304014713_create_tournaments.rb +++ /dev/null @@ -1,8 +0,0 @@ -class CreateTournaments < ActiveRecord::Migration - def change - create_table :tournaments do |t| - - t.timestamps - end - end -end diff --git a/db/migrate/20140304014715_create_matches.rb b/db/migrate/20140304014715_create_matches.rb deleted file mode 100644 index 1478e75..0000000 --- a/db/migrate/20140304014715_create_matches.rb +++ /dev/null @@ -1,8 +0,0 @@ -class CreateMatches < ActiveRecord::Migration - def change - create_table :matches do |t| - - t.timestamps - end - end -end diff --git a/db/migrate/20140304014718_create_teams.rb b/db/migrate/20140304014718_create_teams.rb deleted file mode 100644 index dd8397d..0000000 --- a/db/migrate/20140304014718_create_teams.rb +++ /dev/null @@ -1,8 +0,0 @@ -class CreateTeams < ActiveRecord::Migration - def change - create_table :teams do |t| - - t.timestamps - end - end -end diff --git a/db/migrate/20140304014720_create_users.rb b/db/migrate/20140304014720_create_users.rb deleted file mode 100644 index 163109f..0000000 --- a/db/migrate/20140304014720_create_users.rb +++ /dev/null @@ -1,8 +0,0 @@ -class CreateUsers < ActiveRecord::Migration - def change - create_table :users do |t| - - t.timestamps - end - end -end diff --git a/db/migrate/20140304014722_create_servers.rb b/db/migrate/20140304014722_create_servers.rb new file mode 100644 index 0000000..f33241a --- /dev/null +++ b/db/migrate/20140304014722_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/20140304014725_create_tournaments.rb b/db/migrate/20140304014725_create_tournaments.rb new file mode 100644 index 0000000..2095590 --- /dev/null +++ b/db/migrate/20140304014725_create_tournaments.rb @@ -0,0 +1,8 @@ +class CreateTournaments < ActiveRecord::Migration + def change + create_table :tournaments do |t| + + t.timestamps + end + end +end diff --git a/db/migrate/20140304014727_create_matches.rb b/db/migrate/20140304014727_create_matches.rb new file mode 100644 index 0000000..1478e75 --- /dev/null +++ b/db/migrate/20140304014727_create_matches.rb @@ -0,0 +1,8 @@ +class CreateMatches < ActiveRecord::Migration + def change + create_table :matches do |t| + + t.timestamps + end + end +end diff --git a/db/migrate/20140304014729_create_teams.rb b/db/migrate/20140304014729_create_teams.rb new file mode 100644 index 0000000..dd8397d --- /dev/null +++ b/db/migrate/20140304014729_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/20140304014731_create_users.rb b/db/migrate/20140304014731_create_users.rb new file mode 100644 index 0000000..163109f --- /dev/null +++ b/db/migrate/20140304014731_create_users.rb @@ -0,0 +1,8 @@ +class CreateUsers < ActiveRecord::Migration + def change + create_table :users do |t| + + t.timestamps + end + end +end diff --git a/db/schema.rb b/db/schema.rb new file mode 100644 index 0000000..1f34ab7 --- /dev/null +++ b/db/schema.rb @@ -0,0 +1,41 @@ +# 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: 20140304014731) do + + create_table "matches", 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 "teams", force: true do |t| + t.datetime "created_at" + t.datetime "updated_at" + end + + create_table "tournaments", force: true do |t| + t.datetime "created_at" + t.datetime "updated_at" + end + + create_table "users", force: true do |t| + t.datetime "created_at" + t.datetime "updated_at" + end + +end diff --git a/generate.sh b/generate.sh index 04a1294..95f00cc 100755 --- a/generate.sh +++ b/generate.sh @@ -1,8 +1,18 @@ #!/bin/bash +# +# To Start Rails Server: +# bundle exec rails server +# +# +# + + bundle exec rails generate scaffold server bundle exec rails generate scaffold tournament bundle exec rails generate scaffold match bundle exec rails generate scaffold team bundle exec rails generate scaffold user +bundle exec rake db:drop RAILS_ENV=development +bundle exec rake db:migrate RAILS_ENV=development #bundle exec rails generate scaffold -- cgit v1.1-4-g5e80 From 96b97d691f6889004c38bef15411bc27e448fda1 Mon Sep 17 00:00:00 2001 From: AndrewMurrell Date: Tue, 18 Feb 2014 20:42:51 -0500 Subject: Changes to generate.sh --- app/assets/javascripts/alerts.js.coffee | 3 + app/assets/javascripts/main.js.coffee | 3 + app/assets/javascripts/pms.js.coffee | 3 + app/assets/javascripts/search.js.coffee | 3 + app/assets/stylesheets/alerts.css.scss | 3 + app/assets/stylesheets/main.css.scss | 3 + app/assets/stylesheets/pms.css.scss | 3 + app/assets/stylesheets/search.css.scss | 3 + app/controllers/alerts_controller.rb | 74 ++++++++++++++++++++++ app/controllers/main_controller.rb | 2 + app/controllers/matches_controller.rb | 2 +- app/controllers/pms_controller.rb | 74 ++++++++++++++++++++++ app/controllers/search_controller.rb | 2 + app/controllers/users_controller.rb | 2 +- app/helpers/alerts_helper.rb | 2 + app/helpers/main_helper.rb | 2 + app/helpers/pms_helper.rb | 2 + app/helpers/search_helper.rb | 2 + app/models/alert.rb | 2 + app/models/pm.rb | 2 + app/models/server_settings.rb | 2 + app/models/team_match_pair.rb | 2 + app/models/user_team_pair.rb | 2 + 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/matches/_form.html.erb | 4 ++ app/views/matches/index.html.erb | 2 + app/views/matches/index.json.jbuilder | 2 +- app/views/matches/show.html.erb | 5 ++ app/views/matches/show.json.jbuilder | 2 +- 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/users/_form.html.erb | 12 ++++ app/views/users/index.html.erb | 6 ++ app/views/users/index.json.jbuilder | 2 +- app/views/users/show.html.erb | 15 +++++ app/views/users/show.json.jbuilder | 2 +- config/routes.rb | 4 ++ db/migrate/20140304014722_create_servers.rb | 8 --- db/migrate/20140304014725_create_tournaments.rb | 8 --- db/migrate/20140304014727_create_matches.rb | 8 --- db/migrate/20140304014729_create_teams.rb | 8 --- db/migrate/20140304014731_create_users.rb | 8 --- db/migrate/20140304014738_create_servers.rb | 8 +++ db/migrate/20140304014740_create_tournaments.rb | 8 +++ db/migrate/20140304014742_create_matches.rb | 9 +++ db/migrate/20140304014745_create_teams.rb | 8 +++ db/migrate/20140304014747_create_users.rb | 11 ++++ .../20140304014749_create_user_team_pairs.rb | 10 +++ .../20140304014751_create_team_match_pairs.rb | 10 +++ db/migrate/20140304014753_create_alerts.rb | 10 +++ db/migrate/20140304014755_create_pms.rb | 11 ++++ .../20140304014757_create_server_settings.rb | 8 +++ db/schema.rb | 41 ------------ generate.sh | 15 +++-- test/controllers/alerts_controller_test.rb | 49 ++++++++++++++ test/controllers/main_controller_test.rb | 7 ++ test/controllers/matches_controller_test.rb | 4 +- test/controllers/pms_controller_test.rb | 49 ++++++++++++++ test/controllers/search_controller_test.rb | 7 ++ test/controllers/users_controller_test.rb | 4 +- test/fixtures/alerts.yml | 9 +++ test/fixtures/matches.yml | 14 ++-- test/fixtures/pms.yml | 11 ++++ test/fixtures/server_settings.yml | 11 ++++ test/fixtures/team_match_pairs.yml | 9 +++ test/fixtures/user_team_pairs.yml | 9 +++ test/fixtures/users.yml | 18 +++--- test/helpers/alerts_helper_test.rb | 4 ++ test/helpers/main_helper_test.rb | 4 ++ test/helpers/pms_helper_test.rb | 4 ++ test/helpers/search_helper_test.rb | 4 ++ test/models/alert_test.rb | 7 ++ test/models/pm_test.rb | 7 ++ test/models/server_settings_test.rb | 7 ++ test/models/team_match_pair_test.rb | 7 ++ test/models/user_team_pair_test.rb | 7 ++ 87 files changed, 761 insertions(+), 113 deletions(-) create mode 100644 app/assets/javascripts/alerts.js.coffee create mode 100644 app/assets/javascripts/main.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/stylesheets/alerts.css.scss create mode 100644 app/assets/stylesheets/main.css.scss create mode 100644 app/assets/stylesheets/pms.css.scss create mode 100644 app/assets/stylesheets/search.css.scss create mode 100644 app/controllers/alerts_controller.rb create mode 100644 app/controllers/main_controller.rb create mode 100644 app/controllers/pms_controller.rb create mode 100644 app/controllers/search_controller.rb create mode 100644 app/helpers/alerts_helper.rb create mode 100644 app/helpers/main_helper.rb create mode 100644 app/helpers/pms_helper.rb create mode 100644 app/helpers/search_helper.rb create mode 100644 app/models/alert.rb create mode 100644 app/models/pm.rb create mode 100644 app/models/server_settings.rb create mode 100644 app/models/team_match_pair.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/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 delete mode 100644 db/migrate/20140304014722_create_servers.rb delete mode 100644 db/migrate/20140304014725_create_tournaments.rb delete mode 100644 db/migrate/20140304014727_create_matches.rb delete mode 100644 db/migrate/20140304014729_create_teams.rb delete mode 100644 db/migrate/20140304014731_create_users.rb create mode 100644 db/migrate/20140304014738_create_servers.rb create mode 100644 db/migrate/20140304014740_create_tournaments.rb create mode 100644 db/migrate/20140304014742_create_matches.rb create mode 100644 db/migrate/20140304014745_create_teams.rb create mode 100644 db/migrate/20140304014747_create_users.rb create mode 100644 db/migrate/20140304014749_create_user_team_pairs.rb create mode 100644 db/migrate/20140304014751_create_team_match_pairs.rb create mode 100644 db/migrate/20140304014753_create_alerts.rb create mode 100644 db/migrate/20140304014755_create_pms.rb create mode 100644 db/migrate/20140304014757_create_server_settings.rb delete mode 100644 db/schema.rb create mode 100644 test/controllers/alerts_controller_test.rb create mode 100644 test/controllers/main_controller_test.rb create mode 100644 test/controllers/pms_controller_test.rb create mode 100644 test/controllers/search_controller_test.rb create mode 100644 test/fixtures/alerts.yml create mode 100644 test/fixtures/pms.yml create mode 100644 test/fixtures/server_settings.yml create mode 100644 test/fixtures/team_match_pairs.yml create mode 100644 test/fixtures/user_team_pairs.yml create mode 100644 test/helpers/alerts_helper_test.rb create mode 100644 test/helpers/main_helper_test.rb create mode 100644 test/helpers/pms_helper_test.rb create mode 100644 test/helpers/search_helper_test.rb create mode 100644 test/models/alert_test.rb create mode 100644 test/models/pm_test.rb create mode 100644 test/models/server_settings_test.rb create mode 100644 test/models/team_match_pair_test.rb create mode 100644 test/models/user_team_pair_test.rb 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/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/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/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/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/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/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/controllers/alerts_controller.rb b/app/controllers/alerts_controller.rb new file mode 100644 index 0000000..e6158f4 --- /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, :message) + 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 index 4c0c4e4..bb2a67a 100644 --- a/app/controllers/matches_controller.rb +++ b/app/controllers/matches_controller.rb @@ -69,6 +69,6 @@ class MatchesController < ApplicationController # Never trust parameters from the scary internet, only allow the white list through. def match_params - params[:match] + params.require(:match).permit(:tournament) end end diff --git a/app/controllers/pms_controller.rb b/app/controllers/pms_controller.rb new file mode 100644 index 0000000..6eb94f9 --- /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, :recipient, :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/users_controller.rb b/app/controllers/users_controller.rb index da49625..4db617e 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -69,6 +69,6 @@ class UsersController < ApplicationController # Never trust parameters from the scary internet, only allow the white list through. def user_params - params[:user] + params.require(:user).permit(:name, :pw_hash, :groups) end 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/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/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/models/alert.rb b/app/models/alert.rb new file mode 100644 index 0000000..e61a702 --- /dev/null +++ b/app/models/alert.rb @@ -0,0 +1,2 @@ +class Alert < ActiveRecord::Base +end diff --git a/app/models/pm.rb b/app/models/pm.rb new file mode 100644 index 0000000..24d6eb4 --- /dev/null +++ b/app/models/pm.rb @@ -0,0 +1,2 @@ +class Pm < 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_match_pair.rb b/app/models/team_match_pair.rb new file mode 100644 index 0000000..24a4e86 --- /dev/null +++ b/app/models/team_match_pair.rb @@ -0,0 +1,2 @@ +class TeamMatchPair < 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..7694996 --- /dev/null +++ b/app/models/user_team_pair.rb @@ -0,0 +1,2 @@ +class UserTeamPair < ActiveRecord::Base +end diff --git a/app/views/alerts/_form.html.erb b/app/views/alerts/_form.html.erb new file mode 100644 index 0000000..f0da996 --- /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:

+ +
    + <% @alert.errors.full_messages.each do |msg| %> +
  • <%= msg %>
  • + <% end %> +
+
+ <% end %> + +
+ <%= f.label :author %>
+ <%= f.text_field :author %> +
+
+ <%= 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..685157e --- /dev/null +++ b/app/views/alerts/index.json.jbuilder @@ -0,0 +1,4 @@ +json.array!(@alerts) do |alert| + json.extract! alert, :id, :author, :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..83fe24a --- /dev/null +++ b/app/views/alerts/show.json.jbuilder @@ -0,0 +1 @@ +json.extract! @alert, :id, :author, :message, :created_at, :updated_at diff --git a/app/views/matches/_form.html.erb b/app/views/matches/_form.html.erb index c772c7f..7d0a371 100644 --- a/app/views/matches/_form.html.erb +++ b/app/views/matches/_form.html.erb @@ -11,6 +11,10 @@ <% end %> +
+ <%= f.label :tournament %>
+ <%= f.text_field :tournament %> +
<%= f.submit %>
diff --git a/app/views/matches/index.html.erb b/app/views/matches/index.html.erb index 22ae41e..d8122ac 100644 --- a/app/views/matches/index.html.erb +++ b/app/views/matches/index.html.erb @@ -3,6 +3,7 @@ + @@ -12,6 +13,7 @@ <% @matches.each do |match| %> + diff --git a/app/views/matches/index.json.jbuilder b/app/views/matches/index.json.jbuilder index 08daa52..0839c83 100644 --- a/app/views/matches/index.json.jbuilder +++ b/app/views/matches/index.json.jbuilder @@ -1,4 +1,4 @@ json.array!(@matches) do |match| - json.extract! match, :id + json.extract! match, :id, :tournament json.url match_url(match, format: :json) end diff --git a/app/views/matches/show.html.erb b/app/views/matches/show.html.erb index 453985b..7bab721 100644 --- a/app/views/matches/show.html.erb +++ b/app/views/matches/show.html.erb @@ -1,4 +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 index 7190e4c..a381f65 100644 --- a/app/views/matches/show.json.jbuilder +++ b/app/views/matches/show.json.jbuilder @@ -1 +1 @@ -json.extract! @match, :id, :created_at, :updated_at +json.extract! @match, :id, :tournament, :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..bbc6aee --- /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:

+ +
    + <% @pm.errors.full_messages.each do |msg| %> +
  • <%= msg %>
  • + <% end %> +
+
+ <% end %> + +
+ <%= f.label :author %>
+ <%= f.text_field :author %> +
+
+ <%= f.label :recipient %>
+ <%= f.text_field :recipient %> +
+
+ <%= 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

+ +
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?' } %>
+ + + + + + + + + + + + + <% @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..aebdc08 --- /dev/null +++ b/app/views/pms/index.json.jbuilder @@ -0,0 +1,4 @@ +json.array!(@pms) do |pm| + json.extract! pm, :id, :author, :recipient, :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..651e78f --- /dev/null +++ b/app/views/pms/show.json.jbuilder @@ -0,0 +1 @@ +json.extract! @pm, :id, :author, :recipient, :message, :created_at, :updated_at diff --git a/app/views/users/_form.html.erb b/app/views/users/_form.html.erb index 4835056..a7ead1b 100644 --- a/app/views/users/_form.html.erb +++ b/app/views/users/_form.html.erb @@ -11,6 +11,18 @@ <% end %> +
+ <%= f.label :name %>
+ <%= f.text_area :name %> +
+
+ <%= f.label :pw_hash %>
+ <%= f.text_field :pw_hash %> +
+
+ <%= f.label :groups %>
+ <%= f.text_field :groups %> +
<%= f.submit %>
diff --git a/app/views/users/index.html.erb b/app/views/users/index.html.erb index 24a2548..14739ae 100644 --- a/app/views/users/index.html.erb +++ b/app/views/users/index.html.erb @@ -3,6 +3,9 @@ + + + @@ -12,6 +15,9 @@ <% @users.each do |user| %> + + + diff --git a/app/views/users/index.json.jbuilder b/app/views/users/index.json.jbuilder index 6684a9c..58c42c1 100644 --- a/app/views/users/index.json.jbuilder +++ b/app/views/users/index.json.jbuilder @@ -1,4 +1,4 @@ json.array!(@users) do |user| - json.extract! user, :id + json.extract! user, :id, :name, :pw_hash, :groups json.url user_url(user, format: :json) end diff --git a/app/views/users/show.html.erb b/app/views/users/show.html.erb index 32abeb0..05150f5 100644 --- a/app/views/users/show.html.erb +++ b/app/views/users/show.html.erb @@ -1,4 +1,19 @@

<%= notice %>

+

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

+ +

+ Pw hash: + <%= @user.pw_hash %> +

+ +

+ Groups: + <%= @user.groups %> +

+ <%= link_to 'Edit', edit_user_path(@user) %> | <%= link_to 'Back', users_path %> diff --git a/app/views/users/show.json.jbuilder b/app/views/users/show.json.jbuilder index 80ed63e..968b383 100644 --- a/app/views/users/show.json.jbuilder +++ b/app/views/users/show.json.jbuilder @@ -1 +1 @@ -json.extract! @user, :id, :created_at, :updated_at +json.extract! @user, :id, :name, :pw_hash, :groups, :created_at, :updated_at diff --git a/config/routes.rb b/config/routes.rb index b954a33..f13c891 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -1,4 +1,8 @@ Leaguer::Application.routes.draw do + resources :pms + + resources :alerts + resources :users resources :teams diff --git a/db/migrate/20140304014722_create_servers.rb b/db/migrate/20140304014722_create_servers.rb deleted file mode 100644 index f33241a..0000000 --- a/db/migrate/20140304014722_create_servers.rb +++ /dev/null @@ -1,8 +0,0 @@ -class CreateServers < ActiveRecord::Migration - def change - create_table :servers do |t| - - t.timestamps - end - end -end diff --git a/db/migrate/20140304014725_create_tournaments.rb b/db/migrate/20140304014725_create_tournaments.rb deleted file mode 100644 index 2095590..0000000 --- a/db/migrate/20140304014725_create_tournaments.rb +++ /dev/null @@ -1,8 +0,0 @@ -class CreateTournaments < ActiveRecord::Migration - def change - create_table :tournaments do |t| - - t.timestamps - end - end -end diff --git a/db/migrate/20140304014727_create_matches.rb b/db/migrate/20140304014727_create_matches.rb deleted file mode 100644 index 1478e75..0000000 --- a/db/migrate/20140304014727_create_matches.rb +++ /dev/null @@ -1,8 +0,0 @@ -class CreateMatches < ActiveRecord::Migration - def change - create_table :matches do |t| - - t.timestamps - end - end -end diff --git a/db/migrate/20140304014729_create_teams.rb b/db/migrate/20140304014729_create_teams.rb deleted file mode 100644 index dd8397d..0000000 --- a/db/migrate/20140304014729_create_teams.rb +++ /dev/null @@ -1,8 +0,0 @@ -class CreateTeams < ActiveRecord::Migration - def change - create_table :teams do |t| - - t.timestamps - end - end -end diff --git a/db/migrate/20140304014731_create_users.rb b/db/migrate/20140304014731_create_users.rb deleted file mode 100644 index 163109f..0000000 --- a/db/migrate/20140304014731_create_users.rb +++ /dev/null @@ -1,8 +0,0 @@ -class CreateUsers < ActiveRecord::Migration - def change - create_table :users do |t| - - t.timestamps - end - end -end diff --git a/db/migrate/20140304014738_create_servers.rb b/db/migrate/20140304014738_create_servers.rb new file mode 100644 index 0000000..f33241a --- /dev/null +++ b/db/migrate/20140304014738_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/20140304014740_create_tournaments.rb b/db/migrate/20140304014740_create_tournaments.rb new file mode 100644 index 0000000..2095590 --- /dev/null +++ b/db/migrate/20140304014740_create_tournaments.rb @@ -0,0 +1,8 @@ +class CreateTournaments < ActiveRecord::Migration + def change + create_table :tournaments do |t| + + t.timestamps + end + end +end diff --git a/db/migrate/20140304014742_create_matches.rb b/db/migrate/20140304014742_create_matches.rb new file mode 100644 index 0000000..288ce6a --- /dev/null +++ b/db/migrate/20140304014742_create_matches.rb @@ -0,0 +1,9 @@ +class CreateMatches < ActiveRecord::Migration + def change + create_table :matches do |t| + t.reference :tournament + + t.timestamps + end + end +end diff --git a/db/migrate/20140304014745_create_teams.rb b/db/migrate/20140304014745_create_teams.rb new file mode 100644 index 0000000..dd8397d --- /dev/null +++ b/db/migrate/20140304014745_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/20140304014747_create_users.rb b/db/migrate/20140304014747_create_users.rb new file mode 100644 index 0000000..3723908 --- /dev/null +++ b/db/migrate/20140304014747_create_users.rb @@ -0,0 +1,11 @@ +class CreateUsers < ActiveRecord::Migration + def change + create_table :users do |t| + t.text :name + t.varchar :pw_hash + t.int :groups + + t.timestamps + end + end +end diff --git a/db/migrate/20140304014749_create_user_team_pairs.rb b/db/migrate/20140304014749_create_user_team_pairs.rb new file mode 100644 index 0000000..3b60212 --- /dev/null +++ b/db/migrate/20140304014749_create_user_team_pairs.rb @@ -0,0 +1,10 @@ +class CreateUserTeamPairs < ActiveRecord::Migration + def change + create_table :user_team_pairs do |t| + t.reference :user + t.reference :team + + t.timestamps + end + end +end diff --git a/db/migrate/20140304014751_create_team_match_pairs.rb b/db/migrate/20140304014751_create_team_match_pairs.rb new file mode 100644 index 0000000..c489495 --- /dev/null +++ b/db/migrate/20140304014751_create_team_match_pairs.rb @@ -0,0 +1,10 @@ +class CreateTeamMatchPairs < ActiveRecord::Migration + def change + create_table :team_match_pairs do |t| + t.reference :team + t.reference :match + + t.timestamps + end + end +end diff --git a/db/migrate/20140304014753_create_alerts.rb b/db/migrate/20140304014753_create_alerts.rb new file mode 100644 index 0000000..6167f33 --- /dev/null +++ b/db/migrate/20140304014753_create_alerts.rb @@ -0,0 +1,10 @@ +class CreateAlerts < ActiveRecord::Migration + def change + create_table :alerts do |t| + t.reference :author + t.text :message + + t.timestamps + end + end +end diff --git a/db/migrate/20140304014755_create_pms.rb b/db/migrate/20140304014755_create_pms.rb new file mode 100644 index 0000000..f3b27fb --- /dev/null +++ b/db/migrate/20140304014755_create_pms.rb @@ -0,0 +1,11 @@ +class CreatePms < ActiveRecord::Migration + def change + create_table :pms do |t| + t.reference :author + t.reference :recipient + t.text :message + + t.timestamps + end + end +end diff --git a/db/migrate/20140304014757_create_server_settings.rb b/db/migrate/20140304014757_create_server_settings.rb new file mode 100644 index 0000000..dfdd91b --- /dev/null +++ b/db/migrate/20140304014757_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/schema.rb b/db/schema.rb deleted file mode 100644 index 1f34ab7..0000000 --- a/db/schema.rb +++ /dev/null @@ -1,41 +0,0 @@ -# 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: 20140304014731) do - - create_table "matches", 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 "teams", force: true do |t| - t.datetime "created_at" - t.datetime "updated_at" - end - - create_table "tournaments", force: true do |t| - t.datetime "created_at" - t.datetime "updated_at" - end - - create_table "users", force: true do |t| - t.datetime "created_at" - t.datetime "updated_at" - end - -end diff --git a/generate.sh b/generate.sh index 95f00cc..28d1936 100755 --- a/generate.sh +++ b/generate.sh @@ -7,12 +7,19 @@ # # - +set -x bundle exec rails generate scaffold server bundle exec rails generate scaffold tournament -bundle exec rails generate scaffold match -bundle exec rails generate scaffold team -bundle exec rails generate scaffold user +bundle exec rails generate scaffold match tournament:reference +bundle exec rails generate scaffold team +bundle exec rails generate scaffold user name:text pw_hash:varchar groups:int +bundle exec rails generate model user_team_pair user:reference team:reference +bundle exec rails generate model team_match_pair team:reference match:reference +bundle exec rails generate scaffold alert author:reference message:text +bundle exec rails generate scaffold pm author:reference recipient:reference message:text +bundle exec rails generate model server_settings +bundle exec rails generate controller search +bundle exec rails generate controller main bundle exec rake db:drop RAILS_ENV=development bundle exec rake db:migrate RAILS_ENV=development #bundle exec rails generate scaffold diff --git a/test/controllers/alerts_controller_test.rb b/test/controllers/alerts_controller_test.rb new file mode 100644 index 0000000..29e58e9 --- /dev/null +++ b/test/controllers/alerts_controller_test.rb @@ -0,0 +1,49 @@ +require 'test_helper' + +class AlertsControllerTest < ActionController::TestCase + setup do + @alert = alerts(:one) + end + + test "should get index" do + get :index + assert_response :success + assert_not_nil assigns(:alerts) + end + + test "should get new" do + get :new + assert_response :success + end + + test "should create alert" do + assert_difference('Alert.count') do + post :create, alert: { author: @alert.author, message: @alert.message } + end + + assert_redirected_to alert_path(assigns(:alert)) + end + + test "should show alert" do + get :show, id: @alert + assert_response :success + end + + test "should get edit" do + get :edit, id: @alert + assert_response :success + end + + test "should update alert" do + patch :update, id: @alert, alert: { author: @alert.author, message: @alert.message } + assert_redirected_to alert_path(assigns(:alert)) + end + + test "should destroy alert" do + assert_difference('Alert.count', -1) do + delete :destroy, id: @alert + end + + assert_redirected_to alerts_path + end +end diff --git a/test/controllers/main_controller_test.rb b/test/controllers/main_controller_test.rb new file mode 100644 index 0000000..b7ec6bf --- /dev/null +++ b/test/controllers/main_controller_test.rb @@ -0,0 +1,7 @@ +require 'test_helper' + +class MainControllerTest < ActionController::TestCase + # test "the truth" do + # assert true + # end +end diff --git a/test/controllers/matches_controller_test.rb b/test/controllers/matches_controller_test.rb index 353ff4b..629622b 100644 --- a/test/controllers/matches_controller_test.rb +++ b/test/controllers/matches_controller_test.rb @@ -18,7 +18,7 @@ class MatchesControllerTest < ActionController::TestCase test "should create match" do assert_difference('Match.count') do - post :create, match: { } + post :create, match: { tournament: @match.tournament } end assert_redirected_to match_path(assigns(:match)) @@ -35,7 +35,7 @@ class MatchesControllerTest < ActionController::TestCase end test "should update match" do - patch :update, id: @match, match: { } + patch :update, id: @match, match: { tournament: @match.tournament } assert_redirected_to match_path(assigns(:match)) end diff --git a/test/controllers/pms_controller_test.rb b/test/controllers/pms_controller_test.rb new file mode 100644 index 0000000..ccbe7b1 --- /dev/null +++ b/test/controllers/pms_controller_test.rb @@ -0,0 +1,49 @@ +require 'test_helper' + +class PmsControllerTest < ActionController::TestCase + setup do + @pm = pms(:one) + end + + test "should get index" do + get :index + assert_response :success + assert_not_nil assigns(:pms) + end + + test "should get new" do + get :new + assert_response :success + end + + test "should create pm" do + assert_difference('Pm.count') do + post :create, pm: { author: @pm.author, message: @pm.message, recipient: @pm.recipient } + end + + assert_redirected_to pm_path(assigns(:pm)) + end + + test "should show pm" do + get :show, id: @pm + assert_response :success + end + + test "should get edit" do + get :edit, id: @pm + assert_response :success + end + + test "should update pm" do + patch :update, id: @pm, pm: { author: @pm.author, message: @pm.message, recipient: @pm.recipient } + assert_redirected_to pm_path(assigns(:pm)) + end + + test "should destroy pm" do + assert_difference('Pm.count', -1) do + delete :destroy, id: @pm + end + + assert_redirected_to pms_path + end +end diff --git a/test/controllers/search_controller_test.rb b/test/controllers/search_controller_test.rb new file mode 100644 index 0000000..bfbf22d --- /dev/null +++ b/test/controllers/search_controller_test.rb @@ -0,0 +1,7 @@ +require 'test_helper' + +class SearchControllerTest < ActionController::TestCase + # test "the truth" do + # assert true + # end +end diff --git a/test/controllers/users_controller_test.rb b/test/controllers/users_controller_test.rb index 846e74c..8bcd10b 100644 --- a/test/controllers/users_controller_test.rb +++ b/test/controllers/users_controller_test.rb @@ -18,7 +18,7 @@ class UsersControllerTest < ActionController::TestCase test "should create user" do assert_difference('User.count') do - post :create, user: { } + post :create, user: { groups: @user.groups, name: @user.name, pw_hash: @user.pw_hash } end assert_redirected_to user_path(assigns(:user)) @@ -35,7 +35,7 @@ class UsersControllerTest < ActionController::TestCase end test "should update user" do - patch :update, id: @user, user: { } + patch :update, id: @user, user: { groups: @user.groups, name: @user.name, pw_hash: @user.pw_hash } assert_redirected_to user_path(assigns(:user)) end diff --git a/test/fixtures/alerts.yml b/test/fixtures/alerts.yml new file mode 100644 index 0000000..92ee1b0 --- /dev/null +++ b/test/fixtures/alerts.yml @@ -0,0 +1,9 @@ +# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html + +one: + author: + message: MyText + +two: + author: + message: MyText diff --git a/test/fixtures/matches.yml b/test/fixtures/matches.yml index 937a0c0..48c08a5 100644 --- a/test/fixtures/matches.yml +++ b/test/fixtures/matches.yml @@ -1,11 +1,7 @@ # Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html -# This model initially had no columns defined. If you add columns to the -# model remove the '{}' from the fixture names and add the columns immediately -# below each fixture, per the syntax in the comments below -# -one: {} -# column: value -# -two: {} -# column: value +one: + tournament: + +two: + tournament: diff --git a/test/fixtures/pms.yml b/test/fixtures/pms.yml new file mode 100644 index 0000000..4ad9af3 --- /dev/null +++ b/test/fixtures/pms.yml @@ -0,0 +1,11 @@ +# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html + +one: + author: + recipient: + message: MyText + +two: + author: + recipient: + message: MyText diff --git a/test/fixtures/server_settings.yml b/test/fixtures/server_settings.yml new file mode 100644 index 0000000..937a0c0 --- /dev/null +++ b/test/fixtures/server_settings.yml @@ -0,0 +1,11 @@ +# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html + +# This model initially had no columns defined. If you add columns to the +# model remove the '{}' from the fixture names and add the columns immediately +# below each fixture, per the syntax in the comments below +# +one: {} +# column: value +# +two: {} +# column: value diff --git a/test/fixtures/team_match_pairs.yml b/test/fixtures/team_match_pairs.yml new file mode 100644 index 0000000..1a81ab4 --- /dev/null +++ b/test/fixtures/team_match_pairs.yml @@ -0,0 +1,9 @@ +# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html + +one: + team: + match: + +two: + team: + match: diff --git a/test/fixtures/user_team_pairs.yml b/test/fixtures/user_team_pairs.yml new file mode 100644 index 0000000..bda8bd3 --- /dev/null +++ b/test/fixtures/user_team_pairs.yml @@ -0,0 +1,9 @@ +# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html + +one: + user: + team: + +two: + user: + team: diff --git a/test/fixtures/users.yml b/test/fixtures/users.yml index 937a0c0..02ffdbb 100644 --- a/test/fixtures/users.yml +++ b/test/fixtures/users.yml @@ -1,11 +1,11 @@ # Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html -# This model initially had no columns defined. If you add columns to the -# model remove the '{}' from the fixture names and add the columns immediately -# below each fixture, per the syntax in the comments below -# -one: {} -# column: value -# -two: {} -# column: value +one: + name: MyText + pw_hash: + groups: + +two: + name: MyText + pw_hash: + groups: diff --git a/test/helpers/alerts_helper_test.rb b/test/helpers/alerts_helper_test.rb new file mode 100644 index 0000000..1d9079d --- /dev/null +++ b/test/helpers/alerts_helper_test.rb @@ -0,0 +1,4 @@ +require 'test_helper' + +class AlertsHelperTest < ActionView::TestCase +end diff --git a/test/helpers/main_helper_test.rb b/test/helpers/main_helper_test.rb new file mode 100644 index 0000000..22da3c4 --- /dev/null +++ b/test/helpers/main_helper_test.rb @@ -0,0 +1,4 @@ +require 'test_helper' + +class MainHelperTest < ActionView::TestCase +end diff --git a/test/helpers/pms_helper_test.rb b/test/helpers/pms_helper_test.rb new file mode 100644 index 0000000..af80f10 --- /dev/null +++ b/test/helpers/pms_helper_test.rb @@ -0,0 +1,4 @@ +require 'test_helper' + +class PmsHelperTest < ActionView::TestCase +end diff --git a/test/helpers/search_helper_test.rb b/test/helpers/search_helper_test.rb new file mode 100644 index 0000000..3034163 --- /dev/null +++ b/test/helpers/search_helper_test.rb @@ -0,0 +1,4 @@ +require 'test_helper' + +class SearchHelperTest < ActionView::TestCase +end diff --git a/test/models/alert_test.rb b/test/models/alert_test.rb new file mode 100644 index 0000000..b59c65e --- /dev/null +++ b/test/models/alert_test.rb @@ -0,0 +1,7 @@ +require 'test_helper' + +class AlertTest < ActiveSupport::TestCase + # test "the truth" do + # assert true + # end +end diff --git a/test/models/pm_test.rb b/test/models/pm_test.rb new file mode 100644 index 0000000..e7f6b8f --- /dev/null +++ b/test/models/pm_test.rb @@ -0,0 +1,7 @@ +require 'test_helper' + +class PmTest < ActiveSupport::TestCase + # test "the truth" do + # assert true + # end +end diff --git a/test/models/server_settings_test.rb b/test/models/server_settings_test.rb new file mode 100644 index 0000000..470b316 --- /dev/null +++ b/test/models/server_settings_test.rb @@ -0,0 +1,7 @@ +require 'test_helper' + +class ServerSettingsTest < ActiveSupport::TestCase + # test "the truth" do + # assert true + # end +end diff --git a/test/models/team_match_pair_test.rb b/test/models/team_match_pair_test.rb new file mode 100644 index 0000000..c250b3c --- /dev/null +++ b/test/models/team_match_pair_test.rb @@ -0,0 +1,7 @@ +require 'test_helper' + +class TeamMatchPairTest < ActiveSupport::TestCase + # test "the truth" do + # assert true + # end +end diff --git a/test/models/user_team_pair_test.rb b/test/models/user_team_pair_test.rb new file mode 100644 index 0000000..55f5c58 --- /dev/null +++ b/test/models/user_team_pair_test.rb @@ -0,0 +1,7 @@ +require 'test_helper' + +class UserTeamPairTest < ActiveSupport::TestCase + # test "the truth" do + # assert true + # end +end -- cgit v1.1-4-g5e80 From cd1fabe40ca4d290df33a2590f3a1f2072103972 Mon Sep 17 00:00:00 2001 From: DavisLWebb Date: Thu, 20 Feb 2014 17:13:51 -0500 Subject: fix datatype names in generate.sh --- app/controllers/alerts_controller.rb | 2 +- app/controllers/matches_controller.rb | 2 +- app/controllers/pms_controller.rb | 2 +- app/models/alert.rb | 1 + app/models/match.rb | 1 + app/models/pm.rb | 2 + app/models/team_match_pair.rb | 2 + app/models/user_team_pair.rb | 2 + app/views/alerts/_form.html.erb | 4 +- app/views/alerts/index.json.jbuilder | 2 +- app/views/alerts/show.json.jbuilder | 2 +- app/views/matches/_form.html.erb | 4 +- app/views/matches/index.json.jbuilder | 2 +- app/views/matches/show.json.jbuilder | 2 +- app/views/pms/_form.html.erb | 8 +- app/views/pms/index.json.jbuilder | 2 +- app/views/pms/show.json.jbuilder | 2 +- app/views/users/_form.html.erb | 4 +- db/migrate/20140304014808_create_servers.rb | 8 -- db/migrate/20140304014810_create_tournaments.rb | 8 -- db/migrate/20140304014812_create_matches.rb | 9 --- db/migrate/20140304014814_create_teams.rb | 8 -- db/migrate/20140304014816_create_users.rb | 11 --- .../20140304014819_create_user_team_pairs.rb | 10 --- .../20140304014821_create_team_match_pairs.rb | 10 --- db/migrate/20140304014823_create_alerts.rb | 10 --- db/migrate/20140304014825_create_pms.rb | 11 --- .../20140304014827_create_server_settings.rb | 8 -- db/migrate/20140304014838_create_servers.rb | 8 ++ db/migrate/20140304014840_create_tournaments.rb | 8 ++ db/migrate/20140304014842_create_matches.rb | 9 +++ db/migrate/20140304014844_create_teams.rb | 8 ++ db/migrate/20140304014846_create_users.rb | 11 +++ .../20140304014848_create_user_team_pairs.rb | 10 +++ .../20140304014850_create_team_match_pairs.rb | 10 +++ db/migrate/20140304014852_create_alerts.rb | 10 +++ db/migrate/20140304014855_create_pms.rb | 11 +++ .../20140304014857_create_server_settings.rb | 8 ++ db/schema.rb | 92 ++++++++++++++++++++++ generate.sh | 12 +-- test/controllers/alerts_controller_test.rb | 4 +- test/controllers/matches_controller_test.rb | 4 +- test/controllers/pms_controller_test.rb | 4 +- test/fixtures/alerts.yml | 4 +- test/fixtures/matches.yml | 4 +- test/fixtures/pms.yml | 8 +- test/fixtures/team_match_pairs.yml | 8 +- test/fixtures/user_team_pairs.yml | 8 +- test/fixtures/users.yml | 8 +- 49 files changed, 244 insertions(+), 144 deletions(-) delete mode 100644 db/migrate/20140304014808_create_servers.rb delete mode 100644 db/migrate/20140304014810_create_tournaments.rb delete mode 100644 db/migrate/20140304014812_create_matches.rb delete mode 100644 db/migrate/20140304014814_create_teams.rb delete mode 100644 db/migrate/20140304014816_create_users.rb delete mode 100644 db/migrate/20140304014819_create_user_team_pairs.rb delete mode 100644 db/migrate/20140304014821_create_team_match_pairs.rb delete mode 100644 db/migrate/20140304014823_create_alerts.rb delete mode 100644 db/migrate/20140304014825_create_pms.rb delete mode 100644 db/migrate/20140304014827_create_server_settings.rb create mode 100644 db/migrate/20140304014838_create_servers.rb create mode 100644 db/migrate/20140304014840_create_tournaments.rb create mode 100644 db/migrate/20140304014842_create_matches.rb create mode 100644 db/migrate/20140304014844_create_teams.rb create mode 100644 db/migrate/20140304014846_create_users.rb create mode 100644 db/migrate/20140304014848_create_user_team_pairs.rb create mode 100644 db/migrate/20140304014850_create_team_match_pairs.rb create mode 100644 db/migrate/20140304014852_create_alerts.rb create mode 100644 db/migrate/20140304014855_create_pms.rb create mode 100644 db/migrate/20140304014857_create_server_settings.rb create mode 100644 db/schema.rb diff --git a/app/controllers/alerts_controller.rb b/app/controllers/alerts_controller.rb index e6158f4..873e9b7 100644 --- a/app/controllers/alerts_controller.rb +++ b/app/controllers/alerts_controller.rb @@ -69,6 +69,6 @@ class AlertsController < ApplicationController # Never trust parameters from the scary internet, only allow the white list through. def alert_params - params.require(:alert).permit(:author, :message) + params.require(:alert).permit(:author_id, :message) end end diff --git a/app/controllers/matches_controller.rb b/app/controllers/matches_controller.rb index bb2a67a..e9f3c5a 100644 --- a/app/controllers/matches_controller.rb +++ b/app/controllers/matches_controller.rb @@ -69,6 +69,6 @@ class MatchesController < ApplicationController # Never trust parameters from the scary internet, only allow the white list through. def match_params - params.require(:match).permit(:tournament) + params.require(:match).permit(:tournament_id) end end diff --git a/app/controllers/pms_controller.rb b/app/controllers/pms_controller.rb index 6eb94f9..5dd0d69 100644 --- a/app/controllers/pms_controller.rb +++ b/app/controllers/pms_controller.rb @@ -69,6 +69,6 @@ class PmsController < ApplicationController # Never trust parameters from the scary internet, only allow the white list through. def pm_params - params.require(:pm).permit(:author, :recipient, :message) + params.require(:pm).permit(:author_id, :recipient_id, :message) end end diff --git a/app/models/alert.rb b/app/models/alert.rb index e61a702..343c269 100644 --- a/app/models/alert.rb +++ b/app/models/alert.rb @@ -1,2 +1,3 @@ class Alert < ActiveRecord::Base + belongs_to :author end diff --git a/app/models/match.rb b/app/models/match.rb index 0836114..533435a 100644 --- a/app/models/match.rb +++ b/app/models/match.rb @@ -1,2 +1,3 @@ class Match < ActiveRecord::Base + belongs_to :tournament end diff --git a/app/models/pm.rb b/app/models/pm.rb index 24d6eb4..ab5af3b 100644 --- a/app/models/pm.rb +++ b/app/models/pm.rb @@ -1,2 +1,4 @@ class Pm < ActiveRecord::Base + belongs_to :author + belongs_to :recipient end diff --git a/app/models/team_match_pair.rb b/app/models/team_match_pair.rb index 24a4e86..85f8eaa 100644 --- a/app/models/team_match_pair.rb +++ b/app/models/team_match_pair.rb @@ -1,2 +1,4 @@ class TeamMatchPair < ActiveRecord::Base + belongs_to :team + belongs_to :match end diff --git a/app/models/user_team_pair.rb b/app/models/user_team_pair.rb index 7694996..c55dc2e 100644 --- a/app/models/user_team_pair.rb +++ b/app/models/user_team_pair.rb @@ -1,2 +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 index f0da996..b60eaf2 100644 --- a/app/views/alerts/_form.html.erb +++ b/app/views/alerts/_form.html.erb @@ -12,8 +12,8 @@ <% end %>
- <%= f.label :author %>
- <%= f.text_field :author %> + <%= f.label :author_id %>
+ <%= f.text_field :author_id %>
<%= f.label :message %>
diff --git a/app/views/alerts/index.json.jbuilder b/app/views/alerts/index.json.jbuilder index 685157e..0911a5c 100644 --- a/app/views/alerts/index.json.jbuilder +++ b/app/views/alerts/index.json.jbuilder @@ -1,4 +1,4 @@ json.array!(@alerts) do |alert| - json.extract! alert, :id, :author, :message + json.extract! alert, :id, :author_id, :message json.url alert_url(alert, format: :json) end diff --git a/app/views/alerts/show.json.jbuilder b/app/views/alerts/show.json.jbuilder index 83fe24a..95481eb 100644 --- a/app/views/alerts/show.json.jbuilder +++ b/app/views/alerts/show.json.jbuilder @@ -1 +1 @@ -json.extract! @alert, :id, :author, :message, :created_at, :updated_at +json.extract! @alert, :id, :author_id, :message, :created_at, :updated_at diff --git a/app/views/matches/_form.html.erb b/app/views/matches/_form.html.erb index 7d0a371..34494c3 100644 --- a/app/views/matches/_form.html.erb +++ b/app/views/matches/_form.html.erb @@ -12,8 +12,8 @@ <% end %>
- <%= f.label :tournament %>
- <%= f.text_field :tournament %> + <%= f.label :tournament_id %>
+ <%= f.text_field :tournament_id %>
<%= f.submit %> diff --git a/app/views/matches/index.json.jbuilder b/app/views/matches/index.json.jbuilder index 0839c83..c8ada7a 100644 --- a/app/views/matches/index.json.jbuilder +++ b/app/views/matches/index.json.jbuilder @@ -1,4 +1,4 @@ json.array!(@matches) do |match| - json.extract! match, :id, :tournament + json.extract! match, :id, :tournament_id json.url match_url(match, format: :json) end diff --git a/app/views/matches/show.json.jbuilder b/app/views/matches/show.json.jbuilder index a381f65..2e45395 100644 --- a/app/views/matches/show.json.jbuilder +++ b/app/views/matches/show.json.jbuilder @@ -1 +1 @@ -json.extract! @match, :id, :tournament, :created_at, :updated_at +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 index bbc6aee..480e308 100644 --- a/app/views/pms/_form.html.erb +++ b/app/views/pms/_form.html.erb @@ -12,12 +12,12 @@ <% end %>
- <%= f.label :author %>
- <%= f.text_field :author %> + <%= f.label :author_id %>
+ <%= f.text_field :author_id %>
- <%= f.label :recipient %>
- <%= f.text_field :recipient %> + <%= f.label :recipient_id %>
+ <%= f.text_field :recipient_id %>
<%= f.label :message %>
diff --git a/app/views/pms/index.json.jbuilder b/app/views/pms/index.json.jbuilder index aebdc08..fcfca84 100644 --- a/app/views/pms/index.json.jbuilder +++ b/app/views/pms/index.json.jbuilder @@ -1,4 +1,4 @@ json.array!(@pms) do |pm| - json.extract! pm, :id, :author, :recipient, :message + json.extract! pm, :id, :author_id, :recipient_id, :message json.url pm_url(pm, format: :json) end diff --git a/app/views/pms/show.json.jbuilder b/app/views/pms/show.json.jbuilder index 651e78f..94252e9 100644 --- a/app/views/pms/show.json.jbuilder +++ b/app/views/pms/show.json.jbuilder @@ -1 +1 @@ -json.extract! @pm, :id, :author, :recipient, :message, :created_at, :updated_at +json.extract! @pm, :id, :author_id, :recipient_id, :message, :created_at, :updated_at diff --git a/app/views/users/_form.html.erb b/app/views/users/_form.html.erb index a7ead1b..2d1ad24 100644 --- a/app/views/users/_form.html.erb +++ b/app/views/users/_form.html.erb @@ -17,11 +17,11 @@
<%= f.label :pw_hash %>
- <%= f.text_field :pw_hash %> + <%= f.text_area :pw_hash %>
<%= f.label :groups %>
- <%= f.text_field :groups %> + <%= f.number_field :groups %>
<%= f.submit %> diff --git a/db/migrate/20140304014808_create_servers.rb b/db/migrate/20140304014808_create_servers.rb deleted file mode 100644 index f33241a..0000000 --- a/db/migrate/20140304014808_create_servers.rb +++ /dev/null @@ -1,8 +0,0 @@ -class CreateServers < ActiveRecord::Migration - def change - create_table :servers do |t| - - t.timestamps - end - end -end diff --git a/db/migrate/20140304014810_create_tournaments.rb b/db/migrate/20140304014810_create_tournaments.rb deleted file mode 100644 index 2095590..0000000 --- a/db/migrate/20140304014810_create_tournaments.rb +++ /dev/null @@ -1,8 +0,0 @@ -class CreateTournaments < ActiveRecord::Migration - def change - create_table :tournaments do |t| - - t.timestamps - end - end -end diff --git a/db/migrate/20140304014812_create_matches.rb b/db/migrate/20140304014812_create_matches.rb deleted file mode 100644 index 288ce6a..0000000 --- a/db/migrate/20140304014812_create_matches.rb +++ /dev/null @@ -1,9 +0,0 @@ -class CreateMatches < ActiveRecord::Migration - def change - create_table :matches do |t| - t.reference :tournament - - t.timestamps - end - end -end diff --git a/db/migrate/20140304014814_create_teams.rb b/db/migrate/20140304014814_create_teams.rb deleted file mode 100644 index dd8397d..0000000 --- a/db/migrate/20140304014814_create_teams.rb +++ /dev/null @@ -1,8 +0,0 @@ -class CreateTeams < ActiveRecord::Migration - def change - create_table :teams do |t| - - t.timestamps - end - end -end diff --git a/db/migrate/20140304014816_create_users.rb b/db/migrate/20140304014816_create_users.rb deleted file mode 100644 index 3723908..0000000 --- a/db/migrate/20140304014816_create_users.rb +++ /dev/null @@ -1,11 +0,0 @@ -class CreateUsers < ActiveRecord::Migration - def change - create_table :users do |t| - t.text :name - t.varchar :pw_hash - t.int :groups - - t.timestamps - end - end -end diff --git a/db/migrate/20140304014819_create_user_team_pairs.rb b/db/migrate/20140304014819_create_user_team_pairs.rb deleted file mode 100644 index 3b60212..0000000 --- a/db/migrate/20140304014819_create_user_team_pairs.rb +++ /dev/null @@ -1,10 +0,0 @@ -class CreateUserTeamPairs < ActiveRecord::Migration - def change - create_table :user_team_pairs do |t| - t.reference :user - t.reference :team - - t.timestamps - end - end -end diff --git a/db/migrate/20140304014821_create_team_match_pairs.rb b/db/migrate/20140304014821_create_team_match_pairs.rb deleted file mode 100644 index c489495..0000000 --- a/db/migrate/20140304014821_create_team_match_pairs.rb +++ /dev/null @@ -1,10 +0,0 @@ -class CreateTeamMatchPairs < ActiveRecord::Migration - def change - create_table :team_match_pairs do |t| - t.reference :team - t.reference :match - - t.timestamps - end - end -end diff --git a/db/migrate/20140304014823_create_alerts.rb b/db/migrate/20140304014823_create_alerts.rb deleted file mode 100644 index 6167f33..0000000 --- a/db/migrate/20140304014823_create_alerts.rb +++ /dev/null @@ -1,10 +0,0 @@ -class CreateAlerts < ActiveRecord::Migration - def change - create_table :alerts do |t| - t.reference :author - t.text :message - - t.timestamps - end - end -end diff --git a/db/migrate/20140304014825_create_pms.rb b/db/migrate/20140304014825_create_pms.rb deleted file mode 100644 index f3b27fb..0000000 --- a/db/migrate/20140304014825_create_pms.rb +++ /dev/null @@ -1,11 +0,0 @@ -class CreatePms < ActiveRecord::Migration - def change - create_table :pms do |t| - t.reference :author - t.reference :recipient - t.text :message - - t.timestamps - end - end -end diff --git a/db/migrate/20140304014827_create_server_settings.rb b/db/migrate/20140304014827_create_server_settings.rb deleted file mode 100644 index dfdd91b..0000000 --- a/db/migrate/20140304014827_create_server_settings.rb +++ /dev/null @@ -1,8 +0,0 @@ -class CreateServerSettings < ActiveRecord::Migration - def change - create_table :server_settings do |t| - - t.timestamps - end - end -end diff --git a/db/migrate/20140304014838_create_servers.rb b/db/migrate/20140304014838_create_servers.rb new file mode 100644 index 0000000..f33241a --- /dev/null +++ b/db/migrate/20140304014838_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/20140304014840_create_tournaments.rb b/db/migrate/20140304014840_create_tournaments.rb new file mode 100644 index 0000000..2095590 --- /dev/null +++ b/db/migrate/20140304014840_create_tournaments.rb @@ -0,0 +1,8 @@ +class CreateTournaments < ActiveRecord::Migration + def change + create_table :tournaments do |t| + + t.timestamps + end + end +end diff --git a/db/migrate/20140304014842_create_matches.rb b/db/migrate/20140304014842_create_matches.rb new file mode 100644 index 0000000..6c0c157 --- /dev/null +++ b/db/migrate/20140304014842_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/20140304014844_create_teams.rb b/db/migrate/20140304014844_create_teams.rb new file mode 100644 index 0000000..dd8397d --- /dev/null +++ b/db/migrate/20140304014844_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/20140304014846_create_users.rb b/db/migrate/20140304014846_create_users.rb new file mode 100644 index 0000000..6a500e5 --- /dev/null +++ b/db/migrate/20140304014846_create_users.rb @@ -0,0 +1,11 @@ +class CreateUsers < ActiveRecord::Migration + def change + create_table :users do |t| + t.text :name + t.text :pw_hash + t.integer :groups + + t.timestamps + end + end +end diff --git a/db/migrate/20140304014848_create_user_team_pairs.rb b/db/migrate/20140304014848_create_user_team_pairs.rb new file mode 100644 index 0000000..2c492ac --- /dev/null +++ b/db/migrate/20140304014848_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/20140304014850_create_team_match_pairs.rb b/db/migrate/20140304014850_create_team_match_pairs.rb new file mode 100644 index 0000000..8fac07e --- /dev/null +++ b/db/migrate/20140304014850_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/20140304014852_create_alerts.rb b/db/migrate/20140304014852_create_alerts.rb new file mode 100644 index 0000000..68a8e10 --- /dev/null +++ b/db/migrate/20140304014852_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/20140304014855_create_pms.rb b/db/migrate/20140304014855_create_pms.rb new file mode 100644 index 0000000..93bb5c6 --- /dev/null +++ b/db/migrate/20140304014855_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/20140304014857_create_server_settings.rb b/db/migrate/20140304014857_create_server_settings.rb new file mode 100644 index 0000000..dfdd91b --- /dev/null +++ b/db/migrate/20140304014857_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/schema.rb b/db/schema.rb new file mode 100644 index 0000000..88dfa1a --- /dev/null +++ b/db/schema.rb @@ -0,0 +1,92 @@ +# 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: 20140304014857) 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 "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 "tournaments", force: true do |t| + t.datetime "created_at" + t.datetime "updated_at" + end + + 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.text "name" + t.text "pw_hash" + t.integer "groups" + t.datetime "created_at" + t.datetime "updated_at" + end + +end diff --git a/generate.sh b/generate.sh index 28d1936..666869c 100755 --- a/generate.sh +++ b/generate.sh @@ -10,13 +10,13 @@ set -x bundle exec rails generate scaffold server bundle exec rails generate scaffold tournament -bundle exec rails generate scaffold match tournament:reference +bundle exec rails generate scaffold match tournament:references bundle exec rails generate scaffold team -bundle exec rails generate scaffold user name:text pw_hash:varchar groups:int -bundle exec rails generate model user_team_pair user:reference team:reference -bundle exec rails generate model team_match_pair team:reference match:reference -bundle exec rails generate scaffold alert author:reference message:text -bundle exec rails generate scaffold pm author:reference recipient:reference message:text +bundle exec rails generate scaffold user name:text pw_hash:text groups:integer +bundle exec rails generate model user_team_pair user:references team:references +bundle exec rails generate model team_match_pair team:references match:references +bundle exec rails generate scaffold alert author:references message:text +bundle exec rails generate scaffold pm author:references recipient:references message:text bundle exec rails generate model server_settings bundle exec rails generate controller search bundle exec rails generate controller main diff --git a/test/controllers/alerts_controller_test.rb b/test/controllers/alerts_controller_test.rb index 29e58e9..4a5d911 100644 --- a/test/controllers/alerts_controller_test.rb +++ b/test/controllers/alerts_controller_test.rb @@ -18,7 +18,7 @@ class AlertsControllerTest < ActionController::TestCase test "should create alert" do assert_difference('Alert.count') do - post :create, alert: { author: @alert.author, message: @alert.message } + post :create, alert: { author_id: @alert.author_id, message: @alert.message } end assert_redirected_to alert_path(assigns(:alert)) @@ -35,7 +35,7 @@ class AlertsControllerTest < ActionController::TestCase end test "should update alert" do - patch :update, id: @alert, alert: { author: @alert.author, message: @alert.message } + patch :update, id: @alert, alert: { author_id: @alert.author_id, message: @alert.message } assert_redirected_to alert_path(assigns(:alert)) end diff --git a/test/controllers/matches_controller_test.rb b/test/controllers/matches_controller_test.rb index 629622b..75c9dcf 100644 --- a/test/controllers/matches_controller_test.rb +++ b/test/controllers/matches_controller_test.rb @@ -18,7 +18,7 @@ class MatchesControllerTest < ActionController::TestCase test "should create match" do assert_difference('Match.count') do - post :create, match: { tournament: @match.tournament } + post :create, match: { tournament_id: @match.tournament_id } end assert_redirected_to match_path(assigns(:match)) @@ -35,7 +35,7 @@ class MatchesControllerTest < ActionController::TestCase end test "should update match" do - patch :update, id: @match, match: { tournament: @match.tournament } + patch :update, id: @match, match: { tournament_id: @match.tournament_id } assert_redirected_to match_path(assigns(:match)) end diff --git a/test/controllers/pms_controller_test.rb b/test/controllers/pms_controller_test.rb index ccbe7b1..18b2449 100644 --- a/test/controllers/pms_controller_test.rb +++ b/test/controllers/pms_controller_test.rb @@ -18,7 +18,7 @@ class PmsControllerTest < ActionController::TestCase test "should create pm" do assert_difference('Pm.count') do - post :create, pm: { author: @pm.author, message: @pm.message, recipient: @pm.recipient } + post :create, pm: { author_id: @pm.author_id, message: @pm.message, recipient_id: @pm.recipient_id } end assert_redirected_to pm_path(assigns(:pm)) @@ -35,7 +35,7 @@ class PmsControllerTest < ActionController::TestCase end test "should update pm" do - patch :update, id: @pm, pm: { author: @pm.author, message: @pm.message, recipient: @pm.recipient } + patch :update, id: @pm, pm: { author_id: @pm.author_id, message: @pm.message, recipient_id: @pm.recipient_id } assert_redirected_to pm_path(assigns(:pm)) end diff --git a/test/fixtures/alerts.yml b/test/fixtures/alerts.yml index 92ee1b0..52959af 100644 --- a/test/fixtures/alerts.yml +++ b/test/fixtures/alerts.yml @@ -1,9 +1,9 @@ # Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html one: - author: + author_id: message: MyText two: - author: + author_id: message: MyText diff --git a/test/fixtures/matches.yml b/test/fixtures/matches.yml index 48c08a5..0356cee 100644 --- a/test/fixtures/matches.yml +++ b/test/fixtures/matches.yml @@ -1,7 +1,7 @@ # Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html one: - tournament: + tournament_id: two: - tournament: + tournament_id: diff --git a/test/fixtures/pms.yml b/test/fixtures/pms.yml index 4ad9af3..f77e727 100644 --- a/test/fixtures/pms.yml +++ b/test/fixtures/pms.yml @@ -1,11 +1,11 @@ # Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html one: - author: - recipient: + author_id: + recipient_id: message: MyText two: - author: - recipient: + author_id: + recipient_id: message: MyText diff --git a/test/fixtures/team_match_pairs.yml b/test/fixtures/team_match_pairs.yml index 1a81ab4..5f9cf2f 100644 --- a/test/fixtures/team_match_pairs.yml +++ b/test/fixtures/team_match_pairs.yml @@ -1,9 +1,9 @@ # Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html one: - team: - match: + team_id: + match_id: two: - team: - match: + team_id: + match_id: diff --git a/test/fixtures/user_team_pairs.yml b/test/fixtures/user_team_pairs.yml index bda8bd3..a76036f 100644 --- a/test/fixtures/user_team_pairs.yml +++ b/test/fixtures/user_team_pairs.yml @@ -1,9 +1,9 @@ # Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html one: - user: - team: + user_id: + team_id: two: - user: - team: + user_id: + team_id: diff --git a/test/fixtures/users.yml b/test/fixtures/users.yml index 02ffdbb..9f593bc 100644 --- a/test/fixtures/users.yml +++ b/test/fixtures/users.yml @@ -2,10 +2,10 @@ one: name: MyText - pw_hash: - groups: + pw_hash: MyText + groups: 1 two: name: MyText - pw_hash: - groups: + pw_hash: MyText + groups: 1 -- cgit v1.1-4-g5e80 From 8e3e88f52c1f2d73acdcb7fdf60326b5f7717068 Mon Sep 17 00:00:00 2001 From: AndrewMurrell Date: Wed, 26 Feb 2014 20:07:42 -0500 Subject: Possibly broke everything. Added another model for populating tournament options. --- app/models/tournament_options.rb | 2 ++ db/migrate/20140304014838_create_servers.rb | 8 -------- db/migrate/20140304014840_create_tournaments.rb | 8 -------- db/migrate/20140304014842_create_matches.rb | 9 --------- db/migrate/20140304014844_create_teams.rb | 8 -------- db/migrate/20140304014846_create_users.rb | 11 ----------- db/migrate/20140304014848_create_user_team_pairs.rb | 10 ---------- db/migrate/20140304014850_create_team_match_pairs.rb | 10 ---------- db/migrate/20140304014852_create_alerts.rb | 10 ---------- db/migrate/20140304014855_create_pms.rb | 11 ----------- db/migrate/20140304014857_create_server_settings.rb | 8 -------- db/migrate/20140304014940_create_servers.rb | 8 ++++++++ db/migrate/20140304014942_create_tournaments.rb | 8 ++++++++ db/migrate/20140304014944_create_matches.rb | 9 +++++++++ db/migrate/20140304014946_create_teams.rb | 8 ++++++++ db/migrate/20140304014948_create_users.rb | 11 +++++++++++ db/migrate/20140304014950_create_user_team_pairs.rb | 10 ++++++++++ db/migrate/20140304014952_create_team_match_pairs.rb | 10 ++++++++++ db/migrate/20140304014954_create_alerts.rb | 10 ++++++++++ db/migrate/20140304014957_create_pms.rb | 11 +++++++++++ db/migrate/20140304014959_create_server_settings.rb | 8 ++++++++ db/migrate/20140304015005_create_tournament_options.rb | 8 ++++++++ db/schema.rb | 7 ++++++- generate.sh | 8 +++++++- test/fixtures/tournament_options.yml | 11 +++++++++++ test/models/tournament_options_test.rb | 7 +++++++ 26 files changed, 134 insertions(+), 95 deletions(-) create mode 100644 app/models/tournament_options.rb delete mode 100644 db/migrate/20140304014838_create_servers.rb delete mode 100644 db/migrate/20140304014840_create_tournaments.rb delete mode 100644 db/migrate/20140304014842_create_matches.rb delete mode 100644 db/migrate/20140304014844_create_teams.rb delete mode 100644 db/migrate/20140304014846_create_users.rb delete mode 100644 db/migrate/20140304014848_create_user_team_pairs.rb delete mode 100644 db/migrate/20140304014850_create_team_match_pairs.rb delete mode 100644 db/migrate/20140304014852_create_alerts.rb delete mode 100644 db/migrate/20140304014855_create_pms.rb delete mode 100644 db/migrate/20140304014857_create_server_settings.rb create mode 100644 db/migrate/20140304014940_create_servers.rb create mode 100644 db/migrate/20140304014942_create_tournaments.rb create mode 100644 db/migrate/20140304014944_create_matches.rb create mode 100644 db/migrate/20140304014946_create_teams.rb create mode 100644 db/migrate/20140304014948_create_users.rb create mode 100644 db/migrate/20140304014950_create_user_team_pairs.rb create mode 100644 db/migrate/20140304014952_create_team_match_pairs.rb create mode 100644 db/migrate/20140304014954_create_alerts.rb create mode 100644 db/migrate/20140304014957_create_pms.rb create mode 100644 db/migrate/20140304014959_create_server_settings.rb create mode 100644 db/migrate/20140304015005_create_tournament_options.rb create mode 100644 test/fixtures/tournament_options.yml create mode 100644 test/models/tournament_options_test.rb diff --git a/app/models/tournament_options.rb b/app/models/tournament_options.rb new file mode 100644 index 0000000..8ed6433 --- /dev/null +++ b/app/models/tournament_options.rb @@ -0,0 +1,2 @@ +class TournamentOptions < ActiveRecord::Base +end diff --git a/db/migrate/20140304014838_create_servers.rb b/db/migrate/20140304014838_create_servers.rb deleted file mode 100644 index f33241a..0000000 --- a/db/migrate/20140304014838_create_servers.rb +++ /dev/null @@ -1,8 +0,0 @@ -class CreateServers < ActiveRecord::Migration - def change - create_table :servers do |t| - - t.timestamps - end - end -end diff --git a/db/migrate/20140304014840_create_tournaments.rb b/db/migrate/20140304014840_create_tournaments.rb deleted file mode 100644 index 2095590..0000000 --- a/db/migrate/20140304014840_create_tournaments.rb +++ /dev/null @@ -1,8 +0,0 @@ -class CreateTournaments < ActiveRecord::Migration - def change - create_table :tournaments do |t| - - t.timestamps - end - end -end diff --git a/db/migrate/20140304014842_create_matches.rb b/db/migrate/20140304014842_create_matches.rb deleted file mode 100644 index 6c0c157..0000000 --- a/db/migrate/20140304014842_create_matches.rb +++ /dev/null @@ -1,9 +0,0 @@ -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/20140304014844_create_teams.rb b/db/migrate/20140304014844_create_teams.rb deleted file mode 100644 index dd8397d..0000000 --- a/db/migrate/20140304014844_create_teams.rb +++ /dev/null @@ -1,8 +0,0 @@ -class CreateTeams < ActiveRecord::Migration - def change - create_table :teams do |t| - - t.timestamps - end - end -end diff --git a/db/migrate/20140304014846_create_users.rb b/db/migrate/20140304014846_create_users.rb deleted file mode 100644 index 6a500e5..0000000 --- a/db/migrate/20140304014846_create_users.rb +++ /dev/null @@ -1,11 +0,0 @@ -class CreateUsers < ActiveRecord::Migration - def change - create_table :users do |t| - t.text :name - t.text :pw_hash - t.integer :groups - - t.timestamps - end - end -end diff --git a/db/migrate/20140304014848_create_user_team_pairs.rb b/db/migrate/20140304014848_create_user_team_pairs.rb deleted file mode 100644 index 2c492ac..0000000 --- a/db/migrate/20140304014848_create_user_team_pairs.rb +++ /dev/null @@ -1,10 +0,0 @@ -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/20140304014850_create_team_match_pairs.rb b/db/migrate/20140304014850_create_team_match_pairs.rb deleted file mode 100644 index 8fac07e..0000000 --- a/db/migrate/20140304014850_create_team_match_pairs.rb +++ /dev/null @@ -1,10 +0,0 @@ -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/20140304014852_create_alerts.rb b/db/migrate/20140304014852_create_alerts.rb deleted file mode 100644 index 68a8e10..0000000 --- a/db/migrate/20140304014852_create_alerts.rb +++ /dev/null @@ -1,10 +0,0 @@ -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/20140304014855_create_pms.rb b/db/migrate/20140304014855_create_pms.rb deleted file mode 100644 index 93bb5c6..0000000 --- a/db/migrate/20140304014855_create_pms.rb +++ /dev/null @@ -1,11 +0,0 @@ -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/20140304014857_create_server_settings.rb b/db/migrate/20140304014857_create_server_settings.rb deleted file mode 100644 index dfdd91b..0000000 --- a/db/migrate/20140304014857_create_server_settings.rb +++ /dev/null @@ -1,8 +0,0 @@ -class CreateServerSettings < ActiveRecord::Migration - def change - create_table :server_settings do |t| - - t.timestamps - end - end -end diff --git a/db/migrate/20140304014940_create_servers.rb b/db/migrate/20140304014940_create_servers.rb new file mode 100644 index 0000000..f33241a --- /dev/null +++ b/db/migrate/20140304014940_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/20140304014942_create_tournaments.rb b/db/migrate/20140304014942_create_tournaments.rb new file mode 100644 index 0000000..2095590 --- /dev/null +++ b/db/migrate/20140304014942_create_tournaments.rb @@ -0,0 +1,8 @@ +class CreateTournaments < ActiveRecord::Migration + def change + create_table :tournaments do |t| + + t.timestamps + end + end +end diff --git a/db/migrate/20140304014944_create_matches.rb b/db/migrate/20140304014944_create_matches.rb new file mode 100644 index 0000000..6c0c157 --- /dev/null +++ b/db/migrate/20140304014944_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/20140304014946_create_teams.rb b/db/migrate/20140304014946_create_teams.rb new file mode 100644 index 0000000..dd8397d --- /dev/null +++ b/db/migrate/20140304014946_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/20140304014948_create_users.rb b/db/migrate/20140304014948_create_users.rb new file mode 100644 index 0000000..6a500e5 --- /dev/null +++ b/db/migrate/20140304014948_create_users.rb @@ -0,0 +1,11 @@ +class CreateUsers < ActiveRecord::Migration + def change + create_table :users do |t| + t.text :name + t.text :pw_hash + t.integer :groups + + t.timestamps + end + end +end diff --git a/db/migrate/20140304014950_create_user_team_pairs.rb b/db/migrate/20140304014950_create_user_team_pairs.rb new file mode 100644 index 0000000..2c492ac --- /dev/null +++ b/db/migrate/20140304014950_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/20140304014952_create_team_match_pairs.rb b/db/migrate/20140304014952_create_team_match_pairs.rb new file mode 100644 index 0000000..8fac07e --- /dev/null +++ b/db/migrate/20140304014952_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/20140304014954_create_alerts.rb b/db/migrate/20140304014954_create_alerts.rb new file mode 100644 index 0000000..68a8e10 --- /dev/null +++ b/db/migrate/20140304014954_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/20140304014957_create_pms.rb b/db/migrate/20140304014957_create_pms.rb new file mode 100644 index 0000000..93bb5c6 --- /dev/null +++ b/db/migrate/20140304014957_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/20140304014959_create_server_settings.rb b/db/migrate/20140304014959_create_server_settings.rb new file mode 100644 index 0000000..dfdd91b --- /dev/null +++ b/db/migrate/20140304014959_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/20140304015005_create_tournament_options.rb b/db/migrate/20140304015005_create_tournament_options.rb new file mode 100644 index 0000000..d2df22e --- /dev/null +++ b/db/migrate/20140304015005_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 index 88dfa1a..9d307ae 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 20140304014857) do +ActiveRecord::Schema.define(version: 20140304015005) do create_table "alerts", force: true do |t| t.integer "author_id" @@ -66,6 +66,11 @@ ActiveRecord::Schema.define(version: 20140304014857) do 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.datetime "created_at" t.datetime "updated_at" diff --git a/generate.sh b/generate.sh index 666869c..52d0f90 100755 --- a/generate.sh +++ b/generate.sh @@ -4,7 +4,8 @@ # To Start Rails Server: # bundle exec rails server # -# +# To Clear the Generated Files: +# # set -x @@ -20,6 +21,11 @@ bundle exec rails generate scaffold pm author:references recipient:references me bundle exec rails generate model server_settings bundle exec rails generate controller search bundle exec rails generate controller main + +#for the tournament controller to generate options +bundle exec rails generate model tournament_options + bundle exec rake db:drop RAILS_ENV=development bundle exec rake db:migrate RAILS_ENV=development + #bundle exec rails generate scaffold diff --git a/test/fixtures/tournament_options.yml b/test/fixtures/tournament_options.yml new file mode 100644 index 0000000..937a0c0 --- /dev/null +++ b/test/fixtures/tournament_options.yml @@ -0,0 +1,11 @@ +# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html + +# This model initially had no columns defined. If you add columns to the +# model remove the '{}' from the fixture names and add the columns immediately +# below each fixture, per the syntax in the comments below +# +one: {} +# column: value +# +two: {} +# column: value diff --git a/test/models/tournament_options_test.rb b/test/models/tournament_options_test.rb new file mode 100644 index 0000000..7677fae --- /dev/null +++ b/test/models/tournament_options_test.rb @@ -0,0 +1,7 @@ +require 'test_helper' + +class TournamentOptionsTest < ActiveSupport::TestCase + # test "the truth" do + # assert true + # end +end -- cgit v1.1-4-g5e80 From 3a7b14f4a51c0fdb8b71720f361a0a8ccf080325 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Thu, 27 Feb 2014 16:59:04 -0500 Subject: add game types --- app/assets/javascripts/games.js.coffee | 3 + app/assets/stylesheets/games.css.scss | 3 + app/controllers/games_controller.rb | 74 ++++++++++++++++++++++ app/helpers/games_helper.rb | 2 + app/models/game.rb | 2 + app/models/game_attribute.rb | 3 + app/views/games/_form.html.erb | 21 ++++++ app/views/games/edit.html.erb | 6 ++ app/views/games/index.html.erb | 27 ++++++++ app/views/games/index.json.jbuilder | 4 ++ app/views/games/new.html.erb | 5 ++ app/views/games/show.html.erb | 9 +++ app/views/games/show.json.jbuilder | 1 + config/routes.rb | 2 + db/migrate/20140304014940_create_servers.rb | 8 --- db/migrate/20140304014942_create_tournaments.rb | 8 --- db/migrate/20140304014944_create_matches.rb | 9 --- db/migrate/20140304014946_create_teams.rb | 8 --- db/migrate/20140304014948_create_users.rb | 11 ---- .../20140304014950_create_user_team_pairs.rb | 10 --- .../20140304014952_create_team_match_pairs.rb | 10 --- db/migrate/20140304014954_create_alerts.rb | 10 --- db/migrate/20140304014957_create_pms.rb | 11 ---- .../20140304014959_create_server_settings.rb | 8 --- .../20140304015005_create_tournament_options.rb | 8 --- db/migrate/20140304015013_create_servers.rb | 8 +++ db/migrate/20140304015015_create_tournaments.rb | 8 +++ db/migrate/20140304015017_create_matches.rb | 9 +++ db/migrate/20140304015019_create_teams.rb | 8 +++ db/migrate/20140304015021_create_users.rb | 11 ++++ .../20140304015023_create_user_team_pairs.rb | 10 +++ .../20140304015026_create_team_match_pairs.rb | 10 +++ db/migrate/20140304015028_create_alerts.rb | 10 +++ db/migrate/20140304015030_create_pms.rb | 11 ++++ db/migrate/20140304015032_create_games.rb | 9 +++ .../20140304015034_create_game_attributes.rb | 11 ++++ .../20140304015036_create_server_settings.rb | 8 +++ .../20140304015042_create_tournament_options.rb | 8 +++ db/schema.rb | 18 +++++- generate.sh | 4 +- test/controllers/games_controller_test.rb | 49 ++++++++++++++ test/fixtures/game_attributes.yml | 11 ++++ test/fixtures/games.yml | 7 ++ test/helpers/games_helper_test.rb | 4 ++ test/models/game_attribute_test.rb | 7 ++ test/models/game_test.rb | 7 ++ 46 files changed, 388 insertions(+), 103 deletions(-) create mode 100644 app/assets/javascripts/games.js.coffee create mode 100644 app/assets/stylesheets/games.css.scss create mode 100644 app/controllers/games_controller.rb create mode 100644 app/helpers/games_helper.rb create mode 100644 app/models/game.rb create mode 100644 app/models/game_attribute.rb 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 delete mode 100644 db/migrate/20140304014940_create_servers.rb delete mode 100644 db/migrate/20140304014942_create_tournaments.rb delete mode 100644 db/migrate/20140304014944_create_matches.rb delete mode 100644 db/migrate/20140304014946_create_teams.rb delete mode 100644 db/migrate/20140304014948_create_users.rb delete mode 100644 db/migrate/20140304014950_create_user_team_pairs.rb delete mode 100644 db/migrate/20140304014952_create_team_match_pairs.rb delete mode 100644 db/migrate/20140304014954_create_alerts.rb delete mode 100644 db/migrate/20140304014957_create_pms.rb delete mode 100644 db/migrate/20140304014959_create_server_settings.rb delete mode 100644 db/migrate/20140304015005_create_tournament_options.rb create mode 100644 db/migrate/20140304015013_create_servers.rb create mode 100644 db/migrate/20140304015015_create_tournaments.rb create mode 100644 db/migrate/20140304015017_create_matches.rb create mode 100644 db/migrate/20140304015019_create_teams.rb create mode 100644 db/migrate/20140304015021_create_users.rb create mode 100644 db/migrate/20140304015023_create_user_team_pairs.rb create mode 100644 db/migrate/20140304015026_create_team_match_pairs.rb create mode 100644 db/migrate/20140304015028_create_alerts.rb create mode 100644 db/migrate/20140304015030_create_pms.rb create mode 100644 db/migrate/20140304015032_create_games.rb create mode 100644 db/migrate/20140304015034_create_game_attributes.rb create mode 100644 db/migrate/20140304015036_create_server_settings.rb create mode 100644 db/migrate/20140304015042_create_tournament_options.rb create mode 100644 test/controllers/games_controller_test.rb create mode 100644 test/fixtures/game_attributes.yml create mode 100644 test/fixtures/games.yml create mode 100644 test/helpers/games_helper_test.rb create mode 100644 test/models/game_attribute_test.rb create mode 100644 test/models/game_test.rb 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/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/controllers/games_controller.rb b/app/controllers/games_controller.rb new file mode 100644 index 0000000..0a9d8e8 --- /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) + end +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/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/views/games/_form.html.erb b/app/views/games/_form.html.erb new file mode 100644 index 0000000..0bbdd1f --- /dev/null +++ b/app/views/games/_form.html.erb @@ -0,0 +1,21 @@ +<%= form_for(@game) do |f| %> + <% if @game.errors.any? %> +
+

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

+ +
    + <% @game.errors.full_messages.each do |msg| %> +
  • <%= msg %>
  • + <% end %> +
+
+ <% end %> + +
+ <%= f.label :name %>
+ <%= f.text_area :name %> +
+
+ <%= 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..27d47b6 --- /dev/null +++ b/app/views/games/index.html.erb @@ -0,0 +1,27 @@ +

Listing games

+ +
NamePw hashGroups
<%= user.name %><%= user.pw_hash %><%= user.groups %> <%= link_to 'Show', user %> <%= link_to 'Edit', edit_user_path(user) %> <%= link_to 'Destroy', user, method: :delete, data: { confirm: 'Are you sure?' } %>
+ + + + + + + + + + + <% @games.each do |game| %> + + + + + + + <% end %> + +
Name
<%= game.name %><%= 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..90f4236 --- /dev/null +++ b/app/views/games/index.json.jbuilder @@ -0,0 +1,4 @@ +json.array!(@games) do |game| + json.extract! game, :id, :name + 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..20d374f --- /dev/null +++ b/app/views/games/show.html.erb @@ -0,0 +1,9 @@ +

<%= notice %>

+ +

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

+ +<%= 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..a4d8d1c --- /dev/null +++ b/app/views/games/show.json.jbuilder @@ -0,0 +1 @@ +json.extract! @game, :id, :name, :created_at, :updated_at diff --git a/config/routes.rb b/config/routes.rb index f13c891..3412005 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -1,4 +1,6 @@ Leaguer::Application.routes.draw do + resources :games + resources :pms resources :alerts diff --git a/db/migrate/20140304014940_create_servers.rb b/db/migrate/20140304014940_create_servers.rb deleted file mode 100644 index f33241a..0000000 --- a/db/migrate/20140304014940_create_servers.rb +++ /dev/null @@ -1,8 +0,0 @@ -class CreateServers < ActiveRecord::Migration - def change - create_table :servers do |t| - - t.timestamps - end - end -end diff --git a/db/migrate/20140304014942_create_tournaments.rb b/db/migrate/20140304014942_create_tournaments.rb deleted file mode 100644 index 2095590..0000000 --- a/db/migrate/20140304014942_create_tournaments.rb +++ /dev/null @@ -1,8 +0,0 @@ -class CreateTournaments < ActiveRecord::Migration - def change - create_table :tournaments do |t| - - t.timestamps - end - end -end diff --git a/db/migrate/20140304014944_create_matches.rb b/db/migrate/20140304014944_create_matches.rb deleted file mode 100644 index 6c0c157..0000000 --- a/db/migrate/20140304014944_create_matches.rb +++ /dev/null @@ -1,9 +0,0 @@ -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/20140304014946_create_teams.rb b/db/migrate/20140304014946_create_teams.rb deleted file mode 100644 index dd8397d..0000000 --- a/db/migrate/20140304014946_create_teams.rb +++ /dev/null @@ -1,8 +0,0 @@ -class CreateTeams < ActiveRecord::Migration - def change - create_table :teams do |t| - - t.timestamps - end - end -end diff --git a/db/migrate/20140304014948_create_users.rb b/db/migrate/20140304014948_create_users.rb deleted file mode 100644 index 6a500e5..0000000 --- a/db/migrate/20140304014948_create_users.rb +++ /dev/null @@ -1,11 +0,0 @@ -class CreateUsers < ActiveRecord::Migration - def change - create_table :users do |t| - t.text :name - t.text :pw_hash - t.integer :groups - - t.timestamps - end - end -end diff --git a/db/migrate/20140304014950_create_user_team_pairs.rb b/db/migrate/20140304014950_create_user_team_pairs.rb deleted file mode 100644 index 2c492ac..0000000 --- a/db/migrate/20140304014950_create_user_team_pairs.rb +++ /dev/null @@ -1,10 +0,0 @@ -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/20140304014952_create_team_match_pairs.rb b/db/migrate/20140304014952_create_team_match_pairs.rb deleted file mode 100644 index 8fac07e..0000000 --- a/db/migrate/20140304014952_create_team_match_pairs.rb +++ /dev/null @@ -1,10 +0,0 @@ -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/20140304014954_create_alerts.rb b/db/migrate/20140304014954_create_alerts.rb deleted file mode 100644 index 68a8e10..0000000 --- a/db/migrate/20140304014954_create_alerts.rb +++ /dev/null @@ -1,10 +0,0 @@ -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/20140304014957_create_pms.rb b/db/migrate/20140304014957_create_pms.rb deleted file mode 100644 index 93bb5c6..0000000 --- a/db/migrate/20140304014957_create_pms.rb +++ /dev/null @@ -1,11 +0,0 @@ -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/20140304014959_create_server_settings.rb b/db/migrate/20140304014959_create_server_settings.rb deleted file mode 100644 index dfdd91b..0000000 --- a/db/migrate/20140304014959_create_server_settings.rb +++ /dev/null @@ -1,8 +0,0 @@ -class CreateServerSettings < ActiveRecord::Migration - def change - create_table :server_settings do |t| - - t.timestamps - end - end -end diff --git a/db/migrate/20140304015005_create_tournament_options.rb b/db/migrate/20140304015005_create_tournament_options.rb deleted file mode 100644 index d2df22e..0000000 --- a/db/migrate/20140304015005_create_tournament_options.rb +++ /dev/null @@ -1,8 +0,0 @@ -class CreateTournamentOptions < ActiveRecord::Migration - def change - create_table :tournament_options do |t| - - t.timestamps - end - end -end diff --git a/db/migrate/20140304015013_create_servers.rb b/db/migrate/20140304015013_create_servers.rb new file mode 100644 index 0000000..f33241a --- /dev/null +++ b/db/migrate/20140304015013_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/20140304015015_create_tournaments.rb b/db/migrate/20140304015015_create_tournaments.rb new file mode 100644 index 0000000..2095590 --- /dev/null +++ b/db/migrate/20140304015015_create_tournaments.rb @@ -0,0 +1,8 @@ +class CreateTournaments < ActiveRecord::Migration + def change + create_table :tournaments do |t| + + t.timestamps + end + end +end diff --git a/db/migrate/20140304015017_create_matches.rb b/db/migrate/20140304015017_create_matches.rb new file mode 100644 index 0000000..6c0c157 --- /dev/null +++ b/db/migrate/20140304015017_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/20140304015019_create_teams.rb b/db/migrate/20140304015019_create_teams.rb new file mode 100644 index 0000000..dd8397d --- /dev/null +++ b/db/migrate/20140304015019_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/20140304015021_create_users.rb b/db/migrate/20140304015021_create_users.rb new file mode 100644 index 0000000..6a500e5 --- /dev/null +++ b/db/migrate/20140304015021_create_users.rb @@ -0,0 +1,11 @@ +class CreateUsers < ActiveRecord::Migration + def change + create_table :users do |t| + t.text :name + t.text :pw_hash + t.integer :groups + + t.timestamps + end + end +end diff --git a/db/migrate/20140304015023_create_user_team_pairs.rb b/db/migrate/20140304015023_create_user_team_pairs.rb new file mode 100644 index 0000000..2c492ac --- /dev/null +++ b/db/migrate/20140304015023_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/20140304015026_create_team_match_pairs.rb b/db/migrate/20140304015026_create_team_match_pairs.rb new file mode 100644 index 0000000..8fac07e --- /dev/null +++ b/db/migrate/20140304015026_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/20140304015028_create_alerts.rb b/db/migrate/20140304015028_create_alerts.rb new file mode 100644 index 0000000..68a8e10 --- /dev/null +++ b/db/migrate/20140304015028_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/20140304015030_create_pms.rb b/db/migrate/20140304015030_create_pms.rb new file mode 100644 index 0000000..93bb5c6 --- /dev/null +++ b/db/migrate/20140304015030_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/20140304015032_create_games.rb b/db/migrate/20140304015032_create_games.rb new file mode 100644 index 0000000..fc54709 --- /dev/null +++ b/db/migrate/20140304015032_create_games.rb @@ -0,0 +1,9 @@ +class CreateGames < ActiveRecord::Migration + def change + create_table :games do |t| + t.text :name + + t.timestamps + end + end +end diff --git a/db/migrate/20140304015034_create_game_attributes.rb b/db/migrate/20140304015034_create_game_attributes.rb new file mode 100644 index 0000000..b63f134 --- /dev/null +++ b/db/migrate/20140304015034_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/20140304015036_create_server_settings.rb b/db/migrate/20140304015036_create_server_settings.rb new file mode 100644 index 0000000..dfdd91b --- /dev/null +++ b/db/migrate/20140304015036_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/20140304015042_create_tournament_options.rb b/db/migrate/20140304015042_create_tournament_options.rb new file mode 100644 index 0000000..d2df22e --- /dev/null +++ b/db/migrate/20140304015042_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 index 9d307ae..86afd1b 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 20140304015005) do +ActiveRecord::Schema.define(version: 20140304015042) do create_table "alerts", force: true do |t| t.integer "author_id" @@ -22,6 +22,22 @@ ActiveRecord::Schema.define(version: 20140304015005) do 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.datetime "created_at" + t.datetime "updated_at" + end + create_table "matches", force: true do |t| t.integer "tournament_id" t.datetime "created_at" diff --git a/generate.sh b/generate.sh index 52d0f90..7dbb444 100755 --- a/generate.sh +++ b/generate.sh @@ -5,7 +5,7 @@ # bundle exec rails server # # To Clear the Generated Files: -# +# git clean -df # set -x @@ -18,6 +18,8 @@ bundle exec rails generate model user_team_pair user:references team:references bundle exec rails generate model team_match_pair team:references match:references bundle exec rails generate scaffold alert author:references message:text bundle exec rails generate scaffold pm author:references recipient:references message:text +bundle exec rails generate scaffold game name:text +bundle exec rails generate model game_attribute game:references key:text type:integer bundle exec rails generate model server_settings bundle exec rails generate controller search bundle exec rails generate controller main diff --git a/test/controllers/games_controller_test.rb b/test/controllers/games_controller_test.rb new file mode 100644 index 0000000..420758e --- /dev/null +++ b/test/controllers/games_controller_test.rb @@ -0,0 +1,49 @@ +require 'test_helper' + +class GamesControllerTest < ActionController::TestCase + setup do + @game = games(:one) + end + + test "should get index" do + get :index + assert_response :success + assert_not_nil assigns(:games) + end + + test "should get new" do + get :new + assert_response :success + end + + test "should create game" do + assert_difference('Game.count') do + post :create, game: { name: @game.name } + end + + assert_redirected_to game_path(assigns(:game)) + end + + test "should show game" do + get :show, id: @game + assert_response :success + end + + test "should get edit" do + get :edit, id: @game + assert_response :success + end + + test "should update game" do + patch :update, id: @game, game: { name: @game.name } + assert_redirected_to game_path(assigns(:game)) + end + + test "should destroy game" do + assert_difference('Game.count', -1) do + delete :destroy, id: @game + end + + assert_redirected_to games_path + end +end diff --git a/test/fixtures/game_attributes.yml b/test/fixtures/game_attributes.yml new file mode 100644 index 0000000..eff7212 --- /dev/null +++ b/test/fixtures/game_attributes.yml @@ -0,0 +1,11 @@ +# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html + +one: + game_id: + key: MyText + type: 1 + +two: + game_id: + key: MyText + type: 1 diff --git a/test/fixtures/games.yml b/test/fixtures/games.yml new file mode 100644 index 0000000..ce6f466 --- /dev/null +++ b/test/fixtures/games.yml @@ -0,0 +1,7 @@ +# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html + +one: + name: MyText + +two: + name: MyText diff --git a/test/helpers/games_helper_test.rb b/test/helpers/games_helper_test.rb new file mode 100644 index 0000000..449a85c --- /dev/null +++ b/test/helpers/games_helper_test.rb @@ -0,0 +1,4 @@ +require 'test_helper' + +class GamesHelperTest < ActionView::TestCase +end diff --git a/test/models/game_attribute_test.rb b/test/models/game_attribute_test.rb new file mode 100644 index 0000000..13c6e65 --- /dev/null +++ b/test/models/game_attribute_test.rb @@ -0,0 +1,7 @@ +require 'test_helper' + +class GameAttributeTest < ActiveSupport::TestCase + # test "the truth" do + # assert true + # end +end diff --git a/test/models/game_test.rb b/test/models/game_test.rb new file mode 100644 index 0000000..2cab36e --- /dev/null +++ b/test/models/game_test.rb @@ -0,0 +1,7 @@ +require 'test_helper' + +class GameTest < ActiveSupport::TestCase + # test "the truth" do + # assert true + # end +end -- cgit v1.1-4-g5e80 From de40ec53e8b80d8d880214183f19ea93172a0026 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Thu, 27 Feb 2014 17:02:10 -0500 Subject: give tournaments a game type --- app/controllers/tournaments_controller.rb | 2 +- app/models/tournament.rb | 1 + app/views/tournaments/_form.html.erb | 4 ++++ app/views/tournaments/index.html.erb | 2 ++ app/views/tournaments/index.json.jbuilder | 2 +- app/views/tournaments/show.html.erb | 5 +++++ app/views/tournaments/show.json.jbuilder | 2 +- db/migrate/20140304015013_create_servers.rb | 8 -------- db/migrate/20140304015015_create_tournaments.rb | 8 -------- db/migrate/20140304015017_create_matches.rb | 9 --------- db/migrate/20140304015019_create_teams.rb | 8 -------- db/migrate/20140304015021_create_users.rb | 11 ----------- db/migrate/20140304015023_create_user_team_pairs.rb | 10 ---------- db/migrate/20140304015026_create_team_match_pairs.rb | 10 ---------- db/migrate/20140304015028_create_alerts.rb | 10 ---------- db/migrate/20140304015030_create_pms.rb | 11 ----------- db/migrate/20140304015032_create_games.rb | 9 --------- db/migrate/20140304015034_create_game_attributes.rb | 11 ----------- db/migrate/20140304015036_create_server_settings.rb | 8 -------- db/migrate/20140304015042_create_tournament_options.rb | 8 -------- db/migrate/20140304015051_create_servers.rb | 8 ++++++++ db/migrate/20140304015053_create_tournaments.rb | 9 +++++++++ db/migrate/20140304015055_create_matches.rb | 9 +++++++++ db/migrate/20140304015057_create_teams.rb | 8 ++++++++ db/migrate/20140304015059_create_users.rb | 11 +++++++++++ db/migrate/20140304015102_create_user_team_pairs.rb | 10 ++++++++++ db/migrate/20140304015104_create_team_match_pairs.rb | 10 ++++++++++ db/migrate/20140304015106_create_alerts.rb | 10 ++++++++++ db/migrate/20140304015108_create_pms.rb | 11 +++++++++++ db/migrate/20140304015110_create_games.rb | 9 +++++++++ db/migrate/20140304015112_create_game_attributes.rb | 11 +++++++++++ db/migrate/20140304015114_create_server_settings.rb | 8 ++++++++ db/migrate/20140304015120_create_tournament_options.rb | 8 ++++++++ db/schema.rb | 5 ++++- generate.sh | 2 +- test/controllers/tournaments_controller_test.rb | 4 ++-- test/fixtures/tournaments.yml | 14 +++++--------- 37 files changed, 149 insertions(+), 137 deletions(-) delete mode 100644 db/migrate/20140304015013_create_servers.rb delete mode 100644 db/migrate/20140304015015_create_tournaments.rb delete mode 100644 db/migrate/20140304015017_create_matches.rb delete mode 100644 db/migrate/20140304015019_create_teams.rb delete mode 100644 db/migrate/20140304015021_create_users.rb delete mode 100644 db/migrate/20140304015023_create_user_team_pairs.rb delete mode 100644 db/migrate/20140304015026_create_team_match_pairs.rb delete mode 100644 db/migrate/20140304015028_create_alerts.rb delete mode 100644 db/migrate/20140304015030_create_pms.rb delete mode 100644 db/migrate/20140304015032_create_games.rb delete mode 100644 db/migrate/20140304015034_create_game_attributes.rb delete mode 100644 db/migrate/20140304015036_create_server_settings.rb delete mode 100644 db/migrate/20140304015042_create_tournament_options.rb create mode 100644 db/migrate/20140304015051_create_servers.rb create mode 100644 db/migrate/20140304015053_create_tournaments.rb create mode 100644 db/migrate/20140304015055_create_matches.rb create mode 100644 db/migrate/20140304015057_create_teams.rb create mode 100644 db/migrate/20140304015059_create_users.rb create mode 100644 db/migrate/20140304015102_create_user_team_pairs.rb create mode 100644 db/migrate/20140304015104_create_team_match_pairs.rb create mode 100644 db/migrate/20140304015106_create_alerts.rb create mode 100644 db/migrate/20140304015108_create_pms.rb create mode 100644 db/migrate/20140304015110_create_games.rb create mode 100644 db/migrate/20140304015112_create_game_attributes.rb create mode 100644 db/migrate/20140304015114_create_server_settings.rb create mode 100644 db/migrate/20140304015120_create_tournament_options.rb diff --git a/app/controllers/tournaments_controller.rb b/app/controllers/tournaments_controller.rb index ea3857c..720305f 100644 --- a/app/controllers/tournaments_controller.rb +++ b/app/controllers/tournaments_controller.rb @@ -69,6 +69,6 @@ class TournamentsController < ApplicationController # Never trust parameters from the scary internet, only allow the white list through. def tournament_params - params[:tournament] + params.require(:tournament).permit(:game_id) end end diff --git a/app/models/tournament.rb b/app/models/tournament.rb index da3da0e..cc915a0 100644 --- a/app/models/tournament.rb +++ b/app/models/tournament.rb @@ -1,2 +1,3 @@ class Tournament < ActiveRecord::Base + belongs_to :game end diff --git a/app/views/tournaments/_form.html.erb b/app/views/tournaments/_form.html.erb index 8996266..1fd63e9 100644 --- a/app/views/tournaments/_form.html.erb +++ b/app/views/tournaments/_form.html.erb @@ -11,6 +11,10 @@ <% end %> +
+ <%= f.label :game_id %>
+ <%= f.text_field :game_id %> +
<%= f.submit %>
diff --git a/app/views/tournaments/index.html.erb b/app/views/tournaments/index.html.erb index 7124111..ad2b7cf 100644 --- a/app/views/tournaments/index.html.erb +++ b/app/views/tournaments/index.html.erb @@ -3,6 +3,7 @@ + @@ -12,6 +13,7 @@ <% @tournaments.each do |tournament| %> + diff --git a/app/views/tournaments/index.json.jbuilder b/app/views/tournaments/index.json.jbuilder index 28d6960..e6f3b49 100644 --- a/app/views/tournaments/index.json.jbuilder +++ b/app/views/tournaments/index.json.jbuilder @@ -1,4 +1,4 @@ json.array!(@tournaments) do |tournament| - json.extract! tournament, :id + json.extract! tournament, :id, :game_id json.url tournament_url(tournament, format: :json) end diff --git a/app/views/tournaments/show.html.erb b/app/views/tournaments/show.html.erb index 2c280ba..30df788 100644 --- a/app/views/tournaments/show.html.erb +++ b/app/views/tournaments/show.html.erb @@ -1,4 +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 index 211799a..0fe65a6 100644 --- a/app/views/tournaments/show.json.jbuilder +++ b/app/views/tournaments/show.json.jbuilder @@ -1 +1 @@ -json.extract! @tournament, :id, :created_at, :updated_at +json.extract! @tournament, :id, :game_id, :created_at, :updated_at diff --git a/db/migrate/20140304015013_create_servers.rb b/db/migrate/20140304015013_create_servers.rb deleted file mode 100644 index f33241a..0000000 --- a/db/migrate/20140304015013_create_servers.rb +++ /dev/null @@ -1,8 +0,0 @@ -class CreateServers < ActiveRecord::Migration - def change - create_table :servers do |t| - - t.timestamps - end - end -end diff --git a/db/migrate/20140304015015_create_tournaments.rb b/db/migrate/20140304015015_create_tournaments.rb deleted file mode 100644 index 2095590..0000000 --- a/db/migrate/20140304015015_create_tournaments.rb +++ /dev/null @@ -1,8 +0,0 @@ -class CreateTournaments < ActiveRecord::Migration - def change - create_table :tournaments do |t| - - t.timestamps - end - end -end diff --git a/db/migrate/20140304015017_create_matches.rb b/db/migrate/20140304015017_create_matches.rb deleted file mode 100644 index 6c0c157..0000000 --- a/db/migrate/20140304015017_create_matches.rb +++ /dev/null @@ -1,9 +0,0 @@ -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/20140304015019_create_teams.rb b/db/migrate/20140304015019_create_teams.rb deleted file mode 100644 index dd8397d..0000000 --- a/db/migrate/20140304015019_create_teams.rb +++ /dev/null @@ -1,8 +0,0 @@ -class CreateTeams < ActiveRecord::Migration - def change - create_table :teams do |t| - - t.timestamps - end - end -end diff --git a/db/migrate/20140304015021_create_users.rb b/db/migrate/20140304015021_create_users.rb deleted file mode 100644 index 6a500e5..0000000 --- a/db/migrate/20140304015021_create_users.rb +++ /dev/null @@ -1,11 +0,0 @@ -class CreateUsers < ActiveRecord::Migration - def change - create_table :users do |t| - t.text :name - t.text :pw_hash - t.integer :groups - - t.timestamps - end - end -end diff --git a/db/migrate/20140304015023_create_user_team_pairs.rb b/db/migrate/20140304015023_create_user_team_pairs.rb deleted file mode 100644 index 2c492ac..0000000 --- a/db/migrate/20140304015023_create_user_team_pairs.rb +++ /dev/null @@ -1,10 +0,0 @@ -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/20140304015026_create_team_match_pairs.rb b/db/migrate/20140304015026_create_team_match_pairs.rb deleted file mode 100644 index 8fac07e..0000000 --- a/db/migrate/20140304015026_create_team_match_pairs.rb +++ /dev/null @@ -1,10 +0,0 @@ -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/20140304015028_create_alerts.rb b/db/migrate/20140304015028_create_alerts.rb deleted file mode 100644 index 68a8e10..0000000 --- a/db/migrate/20140304015028_create_alerts.rb +++ /dev/null @@ -1,10 +0,0 @@ -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/20140304015030_create_pms.rb b/db/migrate/20140304015030_create_pms.rb deleted file mode 100644 index 93bb5c6..0000000 --- a/db/migrate/20140304015030_create_pms.rb +++ /dev/null @@ -1,11 +0,0 @@ -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/20140304015032_create_games.rb b/db/migrate/20140304015032_create_games.rb deleted file mode 100644 index fc54709..0000000 --- a/db/migrate/20140304015032_create_games.rb +++ /dev/null @@ -1,9 +0,0 @@ -class CreateGames < ActiveRecord::Migration - def change - create_table :games do |t| - t.text :name - - t.timestamps - end - end -end diff --git a/db/migrate/20140304015034_create_game_attributes.rb b/db/migrate/20140304015034_create_game_attributes.rb deleted file mode 100644 index b63f134..0000000 --- a/db/migrate/20140304015034_create_game_attributes.rb +++ /dev/null @@ -1,11 +0,0 @@ -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/20140304015036_create_server_settings.rb b/db/migrate/20140304015036_create_server_settings.rb deleted file mode 100644 index dfdd91b..0000000 --- a/db/migrate/20140304015036_create_server_settings.rb +++ /dev/null @@ -1,8 +0,0 @@ -class CreateServerSettings < ActiveRecord::Migration - def change - create_table :server_settings do |t| - - t.timestamps - end - end -end diff --git a/db/migrate/20140304015042_create_tournament_options.rb b/db/migrate/20140304015042_create_tournament_options.rb deleted file mode 100644 index d2df22e..0000000 --- a/db/migrate/20140304015042_create_tournament_options.rb +++ /dev/null @@ -1,8 +0,0 @@ -class CreateTournamentOptions < ActiveRecord::Migration - def change - create_table :tournament_options do |t| - - t.timestamps - end - end -end diff --git a/db/migrate/20140304015051_create_servers.rb b/db/migrate/20140304015051_create_servers.rb new file mode 100644 index 0000000..f33241a --- /dev/null +++ b/db/migrate/20140304015051_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/20140304015053_create_tournaments.rb b/db/migrate/20140304015053_create_tournaments.rb new file mode 100644 index 0000000..36fcf7e --- /dev/null +++ b/db/migrate/20140304015053_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/20140304015055_create_matches.rb b/db/migrate/20140304015055_create_matches.rb new file mode 100644 index 0000000..6c0c157 --- /dev/null +++ b/db/migrate/20140304015055_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/20140304015057_create_teams.rb b/db/migrate/20140304015057_create_teams.rb new file mode 100644 index 0000000..dd8397d --- /dev/null +++ b/db/migrate/20140304015057_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/20140304015059_create_users.rb b/db/migrate/20140304015059_create_users.rb new file mode 100644 index 0000000..6a500e5 --- /dev/null +++ b/db/migrate/20140304015059_create_users.rb @@ -0,0 +1,11 @@ +class CreateUsers < ActiveRecord::Migration + def change + create_table :users do |t| + t.text :name + t.text :pw_hash + t.integer :groups + + t.timestamps + end + end +end diff --git a/db/migrate/20140304015102_create_user_team_pairs.rb b/db/migrate/20140304015102_create_user_team_pairs.rb new file mode 100644 index 0000000..2c492ac --- /dev/null +++ b/db/migrate/20140304015102_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/20140304015104_create_team_match_pairs.rb b/db/migrate/20140304015104_create_team_match_pairs.rb new file mode 100644 index 0000000..8fac07e --- /dev/null +++ b/db/migrate/20140304015104_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/20140304015106_create_alerts.rb b/db/migrate/20140304015106_create_alerts.rb new file mode 100644 index 0000000..68a8e10 --- /dev/null +++ b/db/migrate/20140304015106_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/20140304015108_create_pms.rb b/db/migrate/20140304015108_create_pms.rb new file mode 100644 index 0000000..93bb5c6 --- /dev/null +++ b/db/migrate/20140304015108_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/20140304015110_create_games.rb b/db/migrate/20140304015110_create_games.rb new file mode 100644 index 0000000..fc54709 --- /dev/null +++ b/db/migrate/20140304015110_create_games.rb @@ -0,0 +1,9 @@ +class CreateGames < ActiveRecord::Migration + def change + create_table :games do |t| + t.text :name + + t.timestamps + end + end +end diff --git a/db/migrate/20140304015112_create_game_attributes.rb b/db/migrate/20140304015112_create_game_attributes.rb new file mode 100644 index 0000000..b63f134 --- /dev/null +++ b/db/migrate/20140304015112_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/20140304015114_create_server_settings.rb b/db/migrate/20140304015114_create_server_settings.rb new file mode 100644 index 0000000..dfdd91b --- /dev/null +++ b/db/migrate/20140304015114_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/20140304015120_create_tournament_options.rb b/db/migrate/20140304015120_create_tournament_options.rb new file mode 100644 index 0000000..d2df22e --- /dev/null +++ b/db/migrate/20140304015120_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 index 86afd1b..7681cfc 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 20140304015042) do +ActiveRecord::Schema.define(version: 20140304015120) do create_table "alerts", force: true do |t| t.integer "author_id" @@ -88,10 +88,13 @@ ActiveRecord::Schema.define(version: 20140304015042) do 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" diff --git a/generate.sh b/generate.sh index 7dbb444..b384813 100755 --- a/generate.sh +++ b/generate.sh @@ -10,7 +10,7 @@ set -x bundle exec rails generate scaffold server -bundle exec rails generate scaffold tournament +bundle exec rails generate scaffold tournament game:references bundle exec rails generate scaffold match tournament:references bundle exec rails generate scaffold team bundle exec rails generate scaffold user name:text pw_hash:text groups:integer diff --git a/test/controllers/tournaments_controller_test.rb b/test/controllers/tournaments_controller_test.rb index 9363bdf..bdbbfac 100644 --- a/test/controllers/tournaments_controller_test.rb +++ b/test/controllers/tournaments_controller_test.rb @@ -18,7 +18,7 @@ class TournamentsControllerTest < ActionController::TestCase test "should create tournament" do assert_difference('Tournament.count') do - post :create, tournament: { } + post :create, tournament: { game_id: @tournament.game_id } end assert_redirected_to tournament_path(assigns(:tournament)) @@ -35,7 +35,7 @@ class TournamentsControllerTest < ActionController::TestCase end test "should update tournament" do - patch :update, id: @tournament, tournament: { } + patch :update, id: @tournament, tournament: { game_id: @tournament.game_id } assert_redirected_to tournament_path(assigns(:tournament)) end diff --git a/test/fixtures/tournaments.yml b/test/fixtures/tournaments.yml index 937a0c0..4cba7ca 100644 --- a/test/fixtures/tournaments.yml +++ b/test/fixtures/tournaments.yml @@ -1,11 +1,7 @@ # Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html -# This model initially had no columns defined. If you add columns to the -# model remove the '{}' from the fixture names and add the columns immediately -# below each fixture, per the syntax in the comments below -# -one: {} -# column: value -# -two: {} -# column: value +one: + game_id: + +two: + game_id: -- cgit v1.1-4-g5e80 From f3f17dcd9755020276062caae7c0677eff88cb2f Mon Sep 17 00:00:00 2001 From: AndrewMurrell Date: Thu, 27 Feb 2014 17:41:59 -0500 Subject: Added the Games Attributes stuff. --- app/controllers/games_controller.rb | 2 +- app/views/games/_form.html.erb | 16 ++++++++++++++++ app/views/games/index.html.erb | 8 ++++++++ app/views/games/index.json.jbuilder | 2 +- app/views/games/show.html.erb | 20 ++++++++++++++++++++ app/views/games/show.json.jbuilder | 2 +- db/migrate/20140304015051_create_servers.rb | 8 -------- db/migrate/20140304015053_create_tournaments.rb | 9 --------- db/migrate/20140304015055_create_matches.rb | 9 --------- db/migrate/20140304015057_create_teams.rb | 8 -------- db/migrate/20140304015059_create_users.rb | 11 ----------- db/migrate/20140304015102_create_user_team_pairs.rb | 10 ---------- db/migrate/20140304015104_create_team_match_pairs.rb | 10 ---------- db/migrate/20140304015106_create_alerts.rb | 10 ---------- db/migrate/20140304015108_create_pms.rb | 11 ----------- db/migrate/20140304015110_create_games.rb | 9 --------- db/migrate/20140304015112_create_game_attributes.rb | 11 ----------- db/migrate/20140304015114_create_server_settings.rb | 8 -------- .../20140304015120_create_tournament_options.rb | 8 -------- db/migrate/20140304015129_create_servers.rb | 8 ++++++++ db/migrate/20140304015131_create_tournaments.rb | 9 +++++++++ db/migrate/20140304015133_create_matches.rb | 9 +++++++++ db/migrate/20140304015135_create_teams.rb | 8 ++++++++ db/migrate/20140304015137_create_users.rb | 11 +++++++++++ db/migrate/20140304015139_create_user_team_pairs.rb | 10 ++++++++++ db/migrate/20140304015141_create_team_match_pairs.rb | 10 ++++++++++ db/migrate/20140304015144_create_alerts.rb | 10 ++++++++++ db/migrate/20140304015146_create_pms.rb | 11 +++++++++++ db/migrate/20140304015148_create_games.rb | 13 +++++++++++++ db/migrate/20140304015150_create_game_attributes.rb | 11 +++++++++++ db/migrate/20140304015152_create_server_settings.rb | 8 ++++++++ .../20140304015158_create_tournament_options.rb | 8 ++++++++ db/schema.rb | 6 +++++- generate.sh | 2 +- test/controllers/games_controller_test.rb | 4 ++-- test/fixtures/games.yml | 8 ++++++++ 36 files changed, 189 insertions(+), 129 deletions(-) delete mode 100644 db/migrate/20140304015051_create_servers.rb delete mode 100644 db/migrate/20140304015053_create_tournaments.rb delete mode 100644 db/migrate/20140304015055_create_matches.rb delete mode 100644 db/migrate/20140304015057_create_teams.rb delete mode 100644 db/migrate/20140304015059_create_users.rb delete mode 100644 db/migrate/20140304015102_create_user_team_pairs.rb delete mode 100644 db/migrate/20140304015104_create_team_match_pairs.rb delete mode 100644 db/migrate/20140304015106_create_alerts.rb delete mode 100644 db/migrate/20140304015108_create_pms.rb delete mode 100644 db/migrate/20140304015110_create_games.rb delete mode 100644 db/migrate/20140304015112_create_game_attributes.rb delete mode 100644 db/migrate/20140304015114_create_server_settings.rb delete mode 100644 db/migrate/20140304015120_create_tournament_options.rb create mode 100644 db/migrate/20140304015129_create_servers.rb create mode 100644 db/migrate/20140304015131_create_tournaments.rb create mode 100644 db/migrate/20140304015133_create_matches.rb create mode 100644 db/migrate/20140304015135_create_teams.rb create mode 100644 db/migrate/20140304015137_create_users.rb create mode 100644 db/migrate/20140304015139_create_user_team_pairs.rb create mode 100644 db/migrate/20140304015141_create_team_match_pairs.rb create mode 100644 db/migrate/20140304015144_create_alerts.rb create mode 100644 db/migrate/20140304015146_create_pms.rb create mode 100644 db/migrate/20140304015148_create_games.rb create mode 100644 db/migrate/20140304015150_create_game_attributes.rb create mode 100644 db/migrate/20140304015152_create_server_settings.rb create mode 100644 db/migrate/20140304015158_create_tournament_options.rb diff --git a/app/controllers/games_controller.rb b/app/controllers/games_controller.rb index 0a9d8e8..4ecff17 100644 --- a/app/controllers/games_controller.rb +++ b/app/controllers/games_controller.rb @@ -69,6 +69,6 @@ class GamesController < ApplicationController # Never trust parameters from the scary internet, only allow the white list through. def game_params - params.require(:game).permit(:name) + params.require(:game).permit(:name, :players_per_team, :teams_per_match, :set_rounds, :randomized_teams) end end diff --git a/app/views/games/_form.html.erb b/app/views/games/_form.html.erb index 0bbdd1f..8941c59 100644 --- a/app/views/games/_form.html.erb +++ b/app/views/games/_form.html.erb @@ -15,6 +15,22 @@ <%= 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 %>
diff --git a/app/views/games/index.html.erb b/app/views/games/index.html.erb index 27d47b6..ccd0f63 100644 --- a/app/views/games/index.html.erb +++ b/app/views/games/index.html.erb @@ -4,6 +4,10 @@
+ + + + @@ -14,6 +18,10 @@ <% @games.each do |game| %> + + + + diff --git a/app/views/games/index.json.jbuilder b/app/views/games/index.json.jbuilder index 90f4236..7e5c1a1 100644 --- a/app/views/games/index.json.jbuilder +++ b/app/views/games/index.json.jbuilder @@ -1,4 +1,4 @@ json.array!(@games) do |game| - json.extract! game, :id, :name + 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/show.html.erb b/app/views/games/show.html.erb index 20d374f..7986016 100644 --- a/app/views/games/show.html.erb +++ b/app/views/games/show.html.erb @@ -5,5 +5,25 @@ <%= @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 index a4d8d1c..1a2d0c7 100644 --- a/app/views/games/show.json.jbuilder +++ b/app/views/games/show.json.jbuilder @@ -1 +1 @@ -json.extract! @game, :id, :name, :created_at, :updated_at +json.extract! @game, :id, :name, :players_per_team, :teams_per_match, :set_rounds, :randomized_teams, :created_at, :updated_at diff --git a/db/migrate/20140304015051_create_servers.rb b/db/migrate/20140304015051_create_servers.rb deleted file mode 100644 index f33241a..0000000 --- a/db/migrate/20140304015051_create_servers.rb +++ /dev/null @@ -1,8 +0,0 @@ -class CreateServers < ActiveRecord::Migration - def change - create_table :servers do |t| - - t.timestamps - end - end -end diff --git a/db/migrate/20140304015053_create_tournaments.rb b/db/migrate/20140304015053_create_tournaments.rb deleted file mode 100644 index 36fcf7e..0000000 --- a/db/migrate/20140304015053_create_tournaments.rb +++ /dev/null @@ -1,9 +0,0 @@ -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/20140304015055_create_matches.rb b/db/migrate/20140304015055_create_matches.rb deleted file mode 100644 index 6c0c157..0000000 --- a/db/migrate/20140304015055_create_matches.rb +++ /dev/null @@ -1,9 +0,0 @@ -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/20140304015057_create_teams.rb b/db/migrate/20140304015057_create_teams.rb deleted file mode 100644 index dd8397d..0000000 --- a/db/migrate/20140304015057_create_teams.rb +++ /dev/null @@ -1,8 +0,0 @@ -class CreateTeams < ActiveRecord::Migration - def change - create_table :teams do |t| - - t.timestamps - end - end -end diff --git a/db/migrate/20140304015059_create_users.rb b/db/migrate/20140304015059_create_users.rb deleted file mode 100644 index 6a500e5..0000000 --- a/db/migrate/20140304015059_create_users.rb +++ /dev/null @@ -1,11 +0,0 @@ -class CreateUsers < ActiveRecord::Migration - def change - create_table :users do |t| - t.text :name - t.text :pw_hash - t.integer :groups - - t.timestamps - end - end -end diff --git a/db/migrate/20140304015102_create_user_team_pairs.rb b/db/migrate/20140304015102_create_user_team_pairs.rb deleted file mode 100644 index 2c492ac..0000000 --- a/db/migrate/20140304015102_create_user_team_pairs.rb +++ /dev/null @@ -1,10 +0,0 @@ -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/20140304015104_create_team_match_pairs.rb b/db/migrate/20140304015104_create_team_match_pairs.rb deleted file mode 100644 index 8fac07e..0000000 --- a/db/migrate/20140304015104_create_team_match_pairs.rb +++ /dev/null @@ -1,10 +0,0 @@ -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/20140304015106_create_alerts.rb b/db/migrate/20140304015106_create_alerts.rb deleted file mode 100644 index 68a8e10..0000000 --- a/db/migrate/20140304015106_create_alerts.rb +++ /dev/null @@ -1,10 +0,0 @@ -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/20140304015108_create_pms.rb b/db/migrate/20140304015108_create_pms.rb deleted file mode 100644 index 93bb5c6..0000000 --- a/db/migrate/20140304015108_create_pms.rb +++ /dev/null @@ -1,11 +0,0 @@ -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/20140304015110_create_games.rb b/db/migrate/20140304015110_create_games.rb deleted file mode 100644 index fc54709..0000000 --- a/db/migrate/20140304015110_create_games.rb +++ /dev/null @@ -1,9 +0,0 @@ -class CreateGames < ActiveRecord::Migration - def change - create_table :games do |t| - t.text :name - - t.timestamps - end - end -end diff --git a/db/migrate/20140304015112_create_game_attributes.rb b/db/migrate/20140304015112_create_game_attributes.rb deleted file mode 100644 index b63f134..0000000 --- a/db/migrate/20140304015112_create_game_attributes.rb +++ /dev/null @@ -1,11 +0,0 @@ -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/20140304015114_create_server_settings.rb b/db/migrate/20140304015114_create_server_settings.rb deleted file mode 100644 index dfdd91b..0000000 --- a/db/migrate/20140304015114_create_server_settings.rb +++ /dev/null @@ -1,8 +0,0 @@ -class CreateServerSettings < ActiveRecord::Migration - def change - create_table :server_settings do |t| - - t.timestamps - end - end -end diff --git a/db/migrate/20140304015120_create_tournament_options.rb b/db/migrate/20140304015120_create_tournament_options.rb deleted file mode 100644 index d2df22e..0000000 --- a/db/migrate/20140304015120_create_tournament_options.rb +++ /dev/null @@ -1,8 +0,0 @@ -class CreateTournamentOptions < ActiveRecord::Migration - def change - create_table :tournament_options do |t| - - t.timestamps - end - end -end diff --git a/db/migrate/20140304015129_create_servers.rb b/db/migrate/20140304015129_create_servers.rb new file mode 100644 index 0000000..f33241a --- /dev/null +++ b/db/migrate/20140304015129_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/20140304015131_create_tournaments.rb b/db/migrate/20140304015131_create_tournaments.rb new file mode 100644 index 0000000..36fcf7e --- /dev/null +++ b/db/migrate/20140304015131_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/20140304015133_create_matches.rb b/db/migrate/20140304015133_create_matches.rb new file mode 100644 index 0000000..6c0c157 --- /dev/null +++ b/db/migrate/20140304015133_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/20140304015135_create_teams.rb b/db/migrate/20140304015135_create_teams.rb new file mode 100644 index 0000000..dd8397d --- /dev/null +++ b/db/migrate/20140304015135_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/20140304015137_create_users.rb b/db/migrate/20140304015137_create_users.rb new file mode 100644 index 0000000..6a500e5 --- /dev/null +++ b/db/migrate/20140304015137_create_users.rb @@ -0,0 +1,11 @@ +class CreateUsers < ActiveRecord::Migration + def change + create_table :users do |t| + t.text :name + t.text :pw_hash + t.integer :groups + + t.timestamps + end + end +end diff --git a/db/migrate/20140304015139_create_user_team_pairs.rb b/db/migrate/20140304015139_create_user_team_pairs.rb new file mode 100644 index 0000000..2c492ac --- /dev/null +++ b/db/migrate/20140304015139_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/20140304015141_create_team_match_pairs.rb b/db/migrate/20140304015141_create_team_match_pairs.rb new file mode 100644 index 0000000..8fac07e --- /dev/null +++ b/db/migrate/20140304015141_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/20140304015144_create_alerts.rb b/db/migrate/20140304015144_create_alerts.rb new file mode 100644 index 0000000..68a8e10 --- /dev/null +++ b/db/migrate/20140304015144_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/20140304015146_create_pms.rb b/db/migrate/20140304015146_create_pms.rb new file mode 100644 index 0000000..93bb5c6 --- /dev/null +++ b/db/migrate/20140304015146_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/20140304015148_create_games.rb b/db/migrate/20140304015148_create_games.rb new file mode 100644 index 0000000..59d4ef0 --- /dev/null +++ b/db/migrate/20140304015148_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/20140304015150_create_game_attributes.rb b/db/migrate/20140304015150_create_game_attributes.rb new file mode 100644 index 0000000..b63f134 --- /dev/null +++ b/db/migrate/20140304015150_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/20140304015152_create_server_settings.rb b/db/migrate/20140304015152_create_server_settings.rb new file mode 100644 index 0000000..dfdd91b --- /dev/null +++ b/db/migrate/20140304015152_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/20140304015158_create_tournament_options.rb b/db/migrate/20140304015158_create_tournament_options.rb new file mode 100644 index 0000000..d2df22e --- /dev/null +++ b/db/migrate/20140304015158_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 index 7681cfc..42417f4 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 20140304015120) do +ActiveRecord::Schema.define(version: 20140304015158) do create_table "alerts", force: true do |t| t.integer "author_id" @@ -34,6 +34,10 @@ ActiveRecord::Schema.define(version: 20140304015120) do 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 diff --git a/generate.sh b/generate.sh index b384813..77d6cb9 100755 --- a/generate.sh +++ b/generate.sh @@ -18,7 +18,7 @@ bundle exec rails generate model user_team_pair user:references team:references bundle exec rails generate model team_match_pair team:references match:references bundle exec rails generate scaffold alert author:references message:text bundle exec rails generate scaffold pm author:references recipient:references message:text -bundle exec rails generate scaffold game name:text +bundle exec rails generate scaffold game name:text players_per_team:integer teams_per_match:integer set_rounds:integer randomized_teams:integer bundle exec rails generate model game_attribute game:references key:text type:integer bundle exec rails generate model server_settings bundle exec rails generate controller search diff --git a/test/controllers/games_controller_test.rb b/test/controllers/games_controller_test.rb index 420758e..95c3145 100644 --- a/test/controllers/games_controller_test.rb +++ b/test/controllers/games_controller_test.rb @@ -18,7 +18,7 @@ class GamesControllerTest < ActionController::TestCase test "should create game" do assert_difference('Game.count') do - post :create, game: { name: @game.name } + post :create, game: { name: @game.name, players_per_team: @game.players_per_team, randomized_teams: @game.randomized_teams, set_rounds: @game.set_rounds, teams_per_match: @game.teams_per_match } end assert_redirected_to game_path(assigns(:game)) @@ -35,7 +35,7 @@ class GamesControllerTest < ActionController::TestCase end test "should update game" do - patch :update, id: @game, game: { name: @game.name } + patch :update, id: @game, game: { name: @game.name, players_per_team: @game.players_per_team, randomized_teams: @game.randomized_teams, set_rounds: @game.set_rounds, teams_per_match: @game.teams_per_match } assert_redirected_to game_path(assigns(:game)) end diff --git a/test/fixtures/games.yml b/test/fixtures/games.yml index ce6f466..3068527 100644 --- a/test/fixtures/games.yml +++ b/test/fixtures/games.yml @@ -2,6 +2,14 @@ one: name: MyText + players_per_team: 1 + teams_per_match: 1 + set_rounds: 1 + randomized_teams: 1 two: name: MyText + players_per_team: 1 + teams_per_match: 1 + set_rounds: 1 + randomized_teams: 1 -- cgit v1.1-4-g5e80 From 068e95231c3d2cee113cf77af67ce785d853429e Mon Sep 17 00:00:00 2001 From: AndrewMurrell Date: Thu, 27 Feb 2014 17:44:37 -0500 Subject: Added the seeding to generation. --- db/migrate/20140304015129_create_servers.rb | 8 -------- db/migrate/20140304015131_create_tournaments.rb | 9 --------- db/migrate/20140304015133_create_matches.rb | 9 --------- db/migrate/20140304015135_create_teams.rb | 8 -------- db/migrate/20140304015137_create_users.rb | 11 ----------- db/migrate/20140304015139_create_user_team_pairs.rb | 10 ---------- db/migrate/20140304015141_create_team_match_pairs.rb | 10 ---------- db/migrate/20140304015144_create_alerts.rb | 10 ---------- db/migrate/20140304015146_create_pms.rb | 11 ----------- db/migrate/20140304015148_create_games.rb | 13 ------------- db/migrate/20140304015150_create_game_attributes.rb | 11 ----------- db/migrate/20140304015152_create_server_settings.rb | 8 -------- db/migrate/20140304015158_create_tournament_options.rb | 8 -------- db/migrate/20140304015206_create_servers.rb | 8 ++++++++ db/migrate/20140304015209_create_tournaments.rb | 9 +++++++++ db/migrate/20140304015211_create_matches.rb | 9 +++++++++ db/migrate/20140304015213_create_teams.rb | 8 ++++++++ db/migrate/20140304015215_create_users.rb | 11 +++++++++++ db/migrate/20140304015217_create_user_team_pairs.rb | 10 ++++++++++ db/migrate/20140304015219_create_team_match_pairs.rb | 10 ++++++++++ db/migrate/20140304015221_create_alerts.rb | 10 ++++++++++ db/migrate/20140304015223_create_pms.rb | 11 +++++++++++ db/migrate/20140304015226_create_games.rb | 13 +++++++++++++ db/migrate/20140304015228_create_game_attributes.rb | 11 +++++++++++ db/migrate/20140304015230_create_server_settings.rb | 8 ++++++++ db/migrate/20140304015236_create_tournament_options.rb | 8 ++++++++ db/schema.rb | 2 +- generate.sh | 2 +- 28 files changed, 128 insertions(+), 128 deletions(-) delete mode 100644 db/migrate/20140304015129_create_servers.rb delete mode 100644 db/migrate/20140304015131_create_tournaments.rb delete mode 100644 db/migrate/20140304015133_create_matches.rb delete mode 100644 db/migrate/20140304015135_create_teams.rb delete mode 100644 db/migrate/20140304015137_create_users.rb delete mode 100644 db/migrate/20140304015139_create_user_team_pairs.rb delete mode 100644 db/migrate/20140304015141_create_team_match_pairs.rb delete mode 100644 db/migrate/20140304015144_create_alerts.rb delete mode 100644 db/migrate/20140304015146_create_pms.rb delete mode 100644 db/migrate/20140304015148_create_games.rb delete mode 100644 db/migrate/20140304015150_create_game_attributes.rb delete mode 100644 db/migrate/20140304015152_create_server_settings.rb delete mode 100644 db/migrate/20140304015158_create_tournament_options.rb create mode 100644 db/migrate/20140304015206_create_servers.rb create mode 100644 db/migrate/20140304015209_create_tournaments.rb create mode 100644 db/migrate/20140304015211_create_matches.rb create mode 100644 db/migrate/20140304015213_create_teams.rb create mode 100644 db/migrate/20140304015215_create_users.rb create mode 100644 db/migrate/20140304015217_create_user_team_pairs.rb create mode 100644 db/migrate/20140304015219_create_team_match_pairs.rb create mode 100644 db/migrate/20140304015221_create_alerts.rb create mode 100644 db/migrate/20140304015223_create_pms.rb create mode 100644 db/migrate/20140304015226_create_games.rb create mode 100644 db/migrate/20140304015228_create_game_attributes.rb create mode 100644 db/migrate/20140304015230_create_server_settings.rb create mode 100644 db/migrate/20140304015236_create_tournament_options.rb diff --git a/db/migrate/20140304015129_create_servers.rb b/db/migrate/20140304015129_create_servers.rb deleted file mode 100644 index f33241a..0000000 --- a/db/migrate/20140304015129_create_servers.rb +++ /dev/null @@ -1,8 +0,0 @@ -class CreateServers < ActiveRecord::Migration - def change - create_table :servers do |t| - - t.timestamps - end - end -end diff --git a/db/migrate/20140304015131_create_tournaments.rb b/db/migrate/20140304015131_create_tournaments.rb deleted file mode 100644 index 36fcf7e..0000000 --- a/db/migrate/20140304015131_create_tournaments.rb +++ /dev/null @@ -1,9 +0,0 @@ -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/20140304015133_create_matches.rb b/db/migrate/20140304015133_create_matches.rb deleted file mode 100644 index 6c0c157..0000000 --- a/db/migrate/20140304015133_create_matches.rb +++ /dev/null @@ -1,9 +0,0 @@ -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/20140304015135_create_teams.rb b/db/migrate/20140304015135_create_teams.rb deleted file mode 100644 index dd8397d..0000000 --- a/db/migrate/20140304015135_create_teams.rb +++ /dev/null @@ -1,8 +0,0 @@ -class CreateTeams < ActiveRecord::Migration - def change - create_table :teams do |t| - - t.timestamps - end - end -end diff --git a/db/migrate/20140304015137_create_users.rb b/db/migrate/20140304015137_create_users.rb deleted file mode 100644 index 6a500e5..0000000 --- a/db/migrate/20140304015137_create_users.rb +++ /dev/null @@ -1,11 +0,0 @@ -class CreateUsers < ActiveRecord::Migration - def change - create_table :users do |t| - t.text :name - t.text :pw_hash - t.integer :groups - - t.timestamps - end - end -end diff --git a/db/migrate/20140304015139_create_user_team_pairs.rb b/db/migrate/20140304015139_create_user_team_pairs.rb deleted file mode 100644 index 2c492ac..0000000 --- a/db/migrate/20140304015139_create_user_team_pairs.rb +++ /dev/null @@ -1,10 +0,0 @@ -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/20140304015141_create_team_match_pairs.rb b/db/migrate/20140304015141_create_team_match_pairs.rb deleted file mode 100644 index 8fac07e..0000000 --- a/db/migrate/20140304015141_create_team_match_pairs.rb +++ /dev/null @@ -1,10 +0,0 @@ -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/20140304015144_create_alerts.rb b/db/migrate/20140304015144_create_alerts.rb deleted file mode 100644 index 68a8e10..0000000 --- a/db/migrate/20140304015144_create_alerts.rb +++ /dev/null @@ -1,10 +0,0 @@ -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/20140304015146_create_pms.rb b/db/migrate/20140304015146_create_pms.rb deleted file mode 100644 index 93bb5c6..0000000 --- a/db/migrate/20140304015146_create_pms.rb +++ /dev/null @@ -1,11 +0,0 @@ -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/20140304015148_create_games.rb b/db/migrate/20140304015148_create_games.rb deleted file mode 100644 index 59d4ef0..0000000 --- a/db/migrate/20140304015148_create_games.rb +++ /dev/null @@ -1,13 +0,0 @@ -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/20140304015150_create_game_attributes.rb b/db/migrate/20140304015150_create_game_attributes.rb deleted file mode 100644 index b63f134..0000000 --- a/db/migrate/20140304015150_create_game_attributes.rb +++ /dev/null @@ -1,11 +0,0 @@ -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/20140304015152_create_server_settings.rb b/db/migrate/20140304015152_create_server_settings.rb deleted file mode 100644 index dfdd91b..0000000 --- a/db/migrate/20140304015152_create_server_settings.rb +++ /dev/null @@ -1,8 +0,0 @@ -class CreateServerSettings < ActiveRecord::Migration - def change - create_table :server_settings do |t| - - t.timestamps - end - end -end diff --git a/db/migrate/20140304015158_create_tournament_options.rb b/db/migrate/20140304015158_create_tournament_options.rb deleted file mode 100644 index d2df22e..0000000 --- a/db/migrate/20140304015158_create_tournament_options.rb +++ /dev/null @@ -1,8 +0,0 @@ -class CreateTournamentOptions < ActiveRecord::Migration - def change - create_table :tournament_options do |t| - - t.timestamps - end - end -end diff --git a/db/migrate/20140304015206_create_servers.rb b/db/migrate/20140304015206_create_servers.rb new file mode 100644 index 0000000..f33241a --- /dev/null +++ b/db/migrate/20140304015206_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/20140304015209_create_tournaments.rb b/db/migrate/20140304015209_create_tournaments.rb new file mode 100644 index 0000000..36fcf7e --- /dev/null +++ b/db/migrate/20140304015209_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/20140304015211_create_matches.rb b/db/migrate/20140304015211_create_matches.rb new file mode 100644 index 0000000..6c0c157 --- /dev/null +++ b/db/migrate/20140304015211_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/20140304015213_create_teams.rb b/db/migrate/20140304015213_create_teams.rb new file mode 100644 index 0000000..dd8397d --- /dev/null +++ b/db/migrate/20140304015213_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/20140304015215_create_users.rb b/db/migrate/20140304015215_create_users.rb new file mode 100644 index 0000000..6a500e5 --- /dev/null +++ b/db/migrate/20140304015215_create_users.rb @@ -0,0 +1,11 @@ +class CreateUsers < ActiveRecord::Migration + def change + create_table :users do |t| + t.text :name + t.text :pw_hash + t.integer :groups + + t.timestamps + end + end +end diff --git a/db/migrate/20140304015217_create_user_team_pairs.rb b/db/migrate/20140304015217_create_user_team_pairs.rb new file mode 100644 index 0000000..2c492ac --- /dev/null +++ b/db/migrate/20140304015217_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/20140304015219_create_team_match_pairs.rb b/db/migrate/20140304015219_create_team_match_pairs.rb new file mode 100644 index 0000000..8fac07e --- /dev/null +++ b/db/migrate/20140304015219_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/20140304015221_create_alerts.rb b/db/migrate/20140304015221_create_alerts.rb new file mode 100644 index 0000000..68a8e10 --- /dev/null +++ b/db/migrate/20140304015221_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/20140304015223_create_pms.rb b/db/migrate/20140304015223_create_pms.rb new file mode 100644 index 0000000..93bb5c6 --- /dev/null +++ b/db/migrate/20140304015223_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/20140304015226_create_games.rb b/db/migrate/20140304015226_create_games.rb new file mode 100644 index 0000000..59d4ef0 --- /dev/null +++ b/db/migrate/20140304015226_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/20140304015228_create_game_attributes.rb b/db/migrate/20140304015228_create_game_attributes.rb new file mode 100644 index 0000000..b63f134 --- /dev/null +++ b/db/migrate/20140304015228_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/20140304015230_create_server_settings.rb b/db/migrate/20140304015230_create_server_settings.rb new file mode 100644 index 0000000..dfdd91b --- /dev/null +++ b/db/migrate/20140304015230_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/20140304015236_create_tournament_options.rb b/db/migrate/20140304015236_create_tournament_options.rb new file mode 100644 index 0000000..d2df22e --- /dev/null +++ b/db/migrate/20140304015236_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 index 42417f4..ede0e8c 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 20140304015158) do +ActiveRecord::Schema.define(version: 20140304015236) do create_table "alerts", force: true do |t| t.integer "author_id" diff --git a/generate.sh b/generate.sh index 77d6cb9..9c6a1ab 100755 --- a/generate.sh +++ b/generate.sh @@ -29,5 +29,5 @@ bundle exec rails generate model tournament_options bundle exec rake db:drop RAILS_ENV=development bundle exec rake db:migrate RAILS_ENV=development - +bundle exec rake db:seed #bundle exec rails generate scaffold -- cgit v1.1-4-g5e80 From 6e20d92989739bde287c6a07c03ae3f70755660b Mon Sep 17 00:00:00 2001 From: DavisLWebb Date: Thu, 27 Feb 2014 17:56:31 -0500 Subject: Booted the strap --- Gemfile | 2 ++ Gemfile.lock | 3 +++ db/migrate/20140304014838_create_servers.rb | 8 -------- db/migrate/20140304014840_create_tournaments.rb | 8 -------- db/migrate/20140304014842_create_matches.rb | 9 --------- db/migrate/20140304014844_create_teams.rb | 8 -------- db/migrate/20140304014846_create_users.rb | 11 ----------- db/migrate/20140304014848_create_user_team_pairs.rb | 10 ---------- db/migrate/20140304014850_create_team_match_pairs.rb | 10 ---------- db/migrate/20140304014852_create_alerts.rb | 10 ---------- db/migrate/20140304014855_create_pms.rb | 11 ----------- db/migrate/20140304014857_create_server_settings.rb | 8 -------- db/migrate/20140304014908_create_servers.rb | 8 ++++++++ db/migrate/20140304014910_create_tournaments.rb | 8 ++++++++ db/migrate/20140304014913_create_matches.rb | 9 +++++++++ db/migrate/20140304014915_create_teams.rb | 8 ++++++++ db/migrate/20140304014917_create_users.rb | 11 +++++++++++ db/migrate/20140304014919_create_user_team_pairs.rb | 10 ++++++++++ db/migrate/20140304014921_create_team_match_pairs.rb | 10 ++++++++++ db/migrate/20140304014923_create_alerts.rb | 10 ++++++++++ db/migrate/20140304014926_create_pms.rb | 11 +++++++++++ db/migrate/20140304014928_create_server_settings.rb | 8 ++++++++ db/schema.rb | 2 +- generate.sh | 5 ++++- 24 files changed, 103 insertions(+), 95 deletions(-) delete mode 100644 db/migrate/20140304014838_create_servers.rb delete mode 100644 db/migrate/20140304014840_create_tournaments.rb delete mode 100644 db/migrate/20140304014842_create_matches.rb delete mode 100644 db/migrate/20140304014844_create_teams.rb delete mode 100644 db/migrate/20140304014846_create_users.rb delete mode 100644 db/migrate/20140304014848_create_user_team_pairs.rb delete mode 100644 db/migrate/20140304014850_create_team_match_pairs.rb delete mode 100644 db/migrate/20140304014852_create_alerts.rb delete mode 100644 db/migrate/20140304014855_create_pms.rb delete mode 100644 db/migrate/20140304014857_create_server_settings.rb create mode 100644 db/migrate/20140304014908_create_servers.rb create mode 100644 db/migrate/20140304014910_create_tournaments.rb create mode 100644 db/migrate/20140304014913_create_matches.rb create mode 100644 db/migrate/20140304014915_create_teams.rb create mode 100644 db/migrate/20140304014917_create_users.rb create mode 100644 db/migrate/20140304014919_create_user_team_pairs.rb create mode 100644 db/migrate/20140304014921_create_team_match_pairs.rb create mode 100644 db/migrate/20140304014923_create_alerts.rb create mode 100644 db/migrate/20140304014926_create_pms.rb create mode 100644 db/migrate/20140304014928_create_server_settings.rb diff --git a/Gemfile b/Gemfile index 630e133..f4e5b09 100644 --- a/Gemfile +++ b/Gemfile @@ -3,6 +3,8 @@ source 'https://rubygems.org' # Bundle edge Rails instead: gem 'rails', github: 'rails/rails' gem 'rails', '4.0.2' +gem 'bootstrap-sass' + # Use sqlite3 as the database for Active Record gem 'sqlite3' diff --git a/Gemfile.lock b/Gemfile.lock index 564ce87..75d27b8 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -27,6 +27,8 @@ GEM tzinfo (~> 0.3.37) arel (4.0.2) atomic (1.1.14) + bootstrap-sass (3.1.1.0) + sass (~> 3.2) builder (3.1.4) coffee-rails (4.0.1) coffee-script (>= 2.2.0) @@ -113,6 +115,7 @@ PLATFORMS ruby DEPENDENCIES + bootstrap-sass coffee-rails (~> 4.0.0) jbuilder (~> 1.2) jquery-rails diff --git a/db/migrate/20140304014838_create_servers.rb b/db/migrate/20140304014838_create_servers.rb deleted file mode 100644 index f33241a..0000000 --- a/db/migrate/20140304014838_create_servers.rb +++ /dev/null @@ -1,8 +0,0 @@ -class CreateServers < ActiveRecord::Migration - def change - create_table :servers do |t| - - t.timestamps - end - end -end diff --git a/db/migrate/20140304014840_create_tournaments.rb b/db/migrate/20140304014840_create_tournaments.rb deleted file mode 100644 index 2095590..0000000 --- a/db/migrate/20140304014840_create_tournaments.rb +++ /dev/null @@ -1,8 +0,0 @@ -class CreateTournaments < ActiveRecord::Migration - def change - create_table :tournaments do |t| - - t.timestamps - end - end -end diff --git a/db/migrate/20140304014842_create_matches.rb b/db/migrate/20140304014842_create_matches.rb deleted file mode 100644 index 6c0c157..0000000 --- a/db/migrate/20140304014842_create_matches.rb +++ /dev/null @@ -1,9 +0,0 @@ -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/20140304014844_create_teams.rb b/db/migrate/20140304014844_create_teams.rb deleted file mode 100644 index dd8397d..0000000 --- a/db/migrate/20140304014844_create_teams.rb +++ /dev/null @@ -1,8 +0,0 @@ -class CreateTeams < ActiveRecord::Migration - def change - create_table :teams do |t| - - t.timestamps - end - end -end diff --git a/db/migrate/20140304014846_create_users.rb b/db/migrate/20140304014846_create_users.rb deleted file mode 100644 index 6a500e5..0000000 --- a/db/migrate/20140304014846_create_users.rb +++ /dev/null @@ -1,11 +0,0 @@ -class CreateUsers < ActiveRecord::Migration - def change - create_table :users do |t| - t.text :name - t.text :pw_hash - t.integer :groups - - t.timestamps - end - end -end diff --git a/db/migrate/20140304014848_create_user_team_pairs.rb b/db/migrate/20140304014848_create_user_team_pairs.rb deleted file mode 100644 index 2c492ac..0000000 --- a/db/migrate/20140304014848_create_user_team_pairs.rb +++ /dev/null @@ -1,10 +0,0 @@ -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/20140304014850_create_team_match_pairs.rb b/db/migrate/20140304014850_create_team_match_pairs.rb deleted file mode 100644 index 8fac07e..0000000 --- a/db/migrate/20140304014850_create_team_match_pairs.rb +++ /dev/null @@ -1,10 +0,0 @@ -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/20140304014852_create_alerts.rb b/db/migrate/20140304014852_create_alerts.rb deleted file mode 100644 index 68a8e10..0000000 --- a/db/migrate/20140304014852_create_alerts.rb +++ /dev/null @@ -1,10 +0,0 @@ -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/20140304014855_create_pms.rb b/db/migrate/20140304014855_create_pms.rb deleted file mode 100644 index 93bb5c6..0000000 --- a/db/migrate/20140304014855_create_pms.rb +++ /dev/null @@ -1,11 +0,0 @@ -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/20140304014857_create_server_settings.rb b/db/migrate/20140304014857_create_server_settings.rb deleted file mode 100644 index dfdd91b..0000000 --- a/db/migrate/20140304014857_create_server_settings.rb +++ /dev/null @@ -1,8 +0,0 @@ -class CreateServerSettings < ActiveRecord::Migration - def change - create_table :server_settings do |t| - - t.timestamps - end - end -end diff --git a/db/migrate/20140304014908_create_servers.rb b/db/migrate/20140304014908_create_servers.rb new file mode 100644 index 0000000..f33241a --- /dev/null +++ b/db/migrate/20140304014908_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/20140304014910_create_tournaments.rb b/db/migrate/20140304014910_create_tournaments.rb new file mode 100644 index 0000000..2095590 --- /dev/null +++ b/db/migrate/20140304014910_create_tournaments.rb @@ -0,0 +1,8 @@ +class CreateTournaments < ActiveRecord::Migration + def change + create_table :tournaments do |t| + + t.timestamps + end + end +end diff --git a/db/migrate/20140304014913_create_matches.rb b/db/migrate/20140304014913_create_matches.rb new file mode 100644 index 0000000..6c0c157 --- /dev/null +++ b/db/migrate/20140304014913_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/20140304014915_create_teams.rb b/db/migrate/20140304014915_create_teams.rb new file mode 100644 index 0000000..dd8397d --- /dev/null +++ b/db/migrate/20140304014915_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/20140304014917_create_users.rb b/db/migrate/20140304014917_create_users.rb new file mode 100644 index 0000000..6a500e5 --- /dev/null +++ b/db/migrate/20140304014917_create_users.rb @@ -0,0 +1,11 @@ +class CreateUsers < ActiveRecord::Migration + def change + create_table :users do |t| + t.text :name + t.text :pw_hash + t.integer :groups + + t.timestamps + end + end +end diff --git a/db/migrate/20140304014919_create_user_team_pairs.rb b/db/migrate/20140304014919_create_user_team_pairs.rb new file mode 100644 index 0000000..2c492ac --- /dev/null +++ b/db/migrate/20140304014919_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/20140304014921_create_team_match_pairs.rb b/db/migrate/20140304014921_create_team_match_pairs.rb new file mode 100644 index 0000000..8fac07e --- /dev/null +++ b/db/migrate/20140304014921_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/20140304014923_create_alerts.rb b/db/migrate/20140304014923_create_alerts.rb new file mode 100644 index 0000000..68a8e10 --- /dev/null +++ b/db/migrate/20140304014923_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/20140304014926_create_pms.rb b/db/migrate/20140304014926_create_pms.rb new file mode 100644 index 0000000..93bb5c6 --- /dev/null +++ b/db/migrate/20140304014926_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/20140304014928_create_server_settings.rb b/db/migrate/20140304014928_create_server_settings.rb new file mode 100644 index 0000000..dfdd91b --- /dev/null +++ b/db/migrate/20140304014928_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/schema.rb b/db/schema.rb index 88dfa1a..5d839f4 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 20140304014857) do +ActiveRecord::Schema.define(version: 20140304014928) do create_table "alerts", force: true do |t| t.integer "author_id" diff --git a/generate.sh b/generate.sh index 666869c..36a74ef 100755 --- a/generate.sh +++ b/generate.sh @@ -1,6 +1,9 @@ #!/bin/bash -# +# The generate.sh bash file is used to generate all of the necessary .rb files to run the website +# + + # To Start Rails Server: # bundle exec rails server # -- cgit v1.1-4-g5e80 From e73f2a30699cc7ce9c7959ede513aec8c3942586 Mon Sep 17 00:00:00 2001 From: AndrewMurrell Date: Sat, 1 Mar 2014 19:56:04 -0500 Subject: I added a start.sh file so that you can just type ./start.sh to both generate and start the server. --- db/migrate/20140304015246_create_servers.rb | 8 -------- db/migrate/20140304015248_create_tournaments.rb | 9 --------- db/migrate/20140304015250_create_matches.rb | 9 --------- db/migrate/20140304015252_create_teams.rb | 8 -------- db/migrate/20140304015254_create_users.rb | 11 ----------- db/migrate/20140304015257_create_user_team_pairs.rb | 10 ---------- db/migrate/20140304015259_create_team_match_pairs.rb | 10 ---------- db/migrate/20140304015301_create_alerts.rb | 10 ---------- db/migrate/20140304015303_create_pms.rb | 11 ----------- db/migrate/20140304015306_create_games.rb | 13 ------------- db/migrate/20140304015308_create_game_attributes.rb | 11 ----------- db/migrate/20140304015310_create_server_settings.rb | 8 -------- db/migrate/20140304015316_create_tournament_options.rb | 8 -------- db/migrate/20140304015327_create_servers.rb | 8 ++++++++ db/migrate/20140304015329_create_tournaments.rb | 9 +++++++++ db/migrate/20140304015331_create_matches.rb | 9 +++++++++ db/migrate/20140304015334_create_teams.rb | 8 ++++++++ db/migrate/20140304015336_create_users.rb | 11 +++++++++++ db/migrate/20140304015338_create_user_team_pairs.rb | 10 ++++++++++ db/migrate/20140304015340_create_team_match_pairs.rb | 10 ++++++++++ db/migrate/20140304015342_create_alerts.rb | 10 ++++++++++ db/migrate/20140304015344_create_pms.rb | 11 +++++++++++ db/migrate/20140304015347_create_games.rb | 13 +++++++++++++ db/migrate/20140304015349_create_game_attributes.rb | 11 +++++++++++ db/migrate/20140304015351_create_server_settings.rb | 8 ++++++++ db/migrate/20140304015357_create_tournament_options.rb | 8 ++++++++ db/schema.rb | 2 +- start.sh | 5 +++++ 28 files changed, 132 insertions(+), 127 deletions(-) delete mode 100644 db/migrate/20140304015246_create_servers.rb delete mode 100644 db/migrate/20140304015248_create_tournaments.rb delete mode 100644 db/migrate/20140304015250_create_matches.rb delete mode 100644 db/migrate/20140304015252_create_teams.rb delete mode 100644 db/migrate/20140304015254_create_users.rb delete mode 100644 db/migrate/20140304015257_create_user_team_pairs.rb delete mode 100644 db/migrate/20140304015259_create_team_match_pairs.rb delete mode 100644 db/migrate/20140304015301_create_alerts.rb delete mode 100644 db/migrate/20140304015303_create_pms.rb delete mode 100644 db/migrate/20140304015306_create_games.rb delete mode 100644 db/migrate/20140304015308_create_game_attributes.rb delete mode 100644 db/migrate/20140304015310_create_server_settings.rb delete mode 100644 db/migrate/20140304015316_create_tournament_options.rb create mode 100644 db/migrate/20140304015327_create_servers.rb create mode 100644 db/migrate/20140304015329_create_tournaments.rb create mode 100644 db/migrate/20140304015331_create_matches.rb create mode 100644 db/migrate/20140304015334_create_teams.rb create mode 100644 db/migrate/20140304015336_create_users.rb create mode 100644 db/migrate/20140304015338_create_user_team_pairs.rb create mode 100644 db/migrate/20140304015340_create_team_match_pairs.rb create mode 100644 db/migrate/20140304015342_create_alerts.rb create mode 100644 db/migrate/20140304015344_create_pms.rb create mode 100644 db/migrate/20140304015347_create_games.rb create mode 100644 db/migrate/20140304015349_create_game_attributes.rb create mode 100644 db/migrate/20140304015351_create_server_settings.rb create mode 100644 db/migrate/20140304015357_create_tournament_options.rb create mode 100755 start.sh diff --git a/db/migrate/20140304015246_create_servers.rb b/db/migrate/20140304015246_create_servers.rb deleted file mode 100644 index f33241a..0000000 --- a/db/migrate/20140304015246_create_servers.rb +++ /dev/null @@ -1,8 +0,0 @@ -class CreateServers < ActiveRecord::Migration - def change - create_table :servers do |t| - - t.timestamps - end - end -end diff --git a/db/migrate/20140304015248_create_tournaments.rb b/db/migrate/20140304015248_create_tournaments.rb deleted file mode 100644 index 36fcf7e..0000000 --- a/db/migrate/20140304015248_create_tournaments.rb +++ /dev/null @@ -1,9 +0,0 @@ -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/20140304015250_create_matches.rb b/db/migrate/20140304015250_create_matches.rb deleted file mode 100644 index 6c0c157..0000000 --- a/db/migrate/20140304015250_create_matches.rb +++ /dev/null @@ -1,9 +0,0 @@ -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/20140304015252_create_teams.rb b/db/migrate/20140304015252_create_teams.rb deleted file mode 100644 index dd8397d..0000000 --- a/db/migrate/20140304015252_create_teams.rb +++ /dev/null @@ -1,8 +0,0 @@ -class CreateTeams < ActiveRecord::Migration - def change - create_table :teams do |t| - - t.timestamps - end - end -end diff --git a/db/migrate/20140304015254_create_users.rb b/db/migrate/20140304015254_create_users.rb deleted file mode 100644 index 6a500e5..0000000 --- a/db/migrate/20140304015254_create_users.rb +++ /dev/null @@ -1,11 +0,0 @@ -class CreateUsers < ActiveRecord::Migration - def change - create_table :users do |t| - t.text :name - t.text :pw_hash - t.integer :groups - - t.timestamps - end - end -end diff --git a/db/migrate/20140304015257_create_user_team_pairs.rb b/db/migrate/20140304015257_create_user_team_pairs.rb deleted file mode 100644 index 2c492ac..0000000 --- a/db/migrate/20140304015257_create_user_team_pairs.rb +++ /dev/null @@ -1,10 +0,0 @@ -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/20140304015259_create_team_match_pairs.rb b/db/migrate/20140304015259_create_team_match_pairs.rb deleted file mode 100644 index 8fac07e..0000000 --- a/db/migrate/20140304015259_create_team_match_pairs.rb +++ /dev/null @@ -1,10 +0,0 @@ -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/20140304015301_create_alerts.rb b/db/migrate/20140304015301_create_alerts.rb deleted file mode 100644 index 68a8e10..0000000 --- a/db/migrate/20140304015301_create_alerts.rb +++ /dev/null @@ -1,10 +0,0 @@ -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/20140304015303_create_pms.rb b/db/migrate/20140304015303_create_pms.rb deleted file mode 100644 index 93bb5c6..0000000 --- a/db/migrate/20140304015303_create_pms.rb +++ /dev/null @@ -1,11 +0,0 @@ -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/20140304015306_create_games.rb b/db/migrate/20140304015306_create_games.rb deleted file mode 100644 index 59d4ef0..0000000 --- a/db/migrate/20140304015306_create_games.rb +++ /dev/null @@ -1,13 +0,0 @@ -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/20140304015308_create_game_attributes.rb b/db/migrate/20140304015308_create_game_attributes.rb deleted file mode 100644 index b63f134..0000000 --- a/db/migrate/20140304015308_create_game_attributes.rb +++ /dev/null @@ -1,11 +0,0 @@ -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/20140304015310_create_server_settings.rb b/db/migrate/20140304015310_create_server_settings.rb deleted file mode 100644 index dfdd91b..0000000 --- a/db/migrate/20140304015310_create_server_settings.rb +++ /dev/null @@ -1,8 +0,0 @@ -class CreateServerSettings < ActiveRecord::Migration - def change - create_table :server_settings do |t| - - t.timestamps - end - end -end diff --git a/db/migrate/20140304015316_create_tournament_options.rb b/db/migrate/20140304015316_create_tournament_options.rb deleted file mode 100644 index d2df22e..0000000 --- a/db/migrate/20140304015316_create_tournament_options.rb +++ /dev/null @@ -1,8 +0,0 @@ -class CreateTournamentOptions < ActiveRecord::Migration - def change - create_table :tournament_options do |t| - - t.timestamps - end - end -end diff --git a/db/migrate/20140304015327_create_servers.rb b/db/migrate/20140304015327_create_servers.rb new file mode 100644 index 0000000..f33241a --- /dev/null +++ b/db/migrate/20140304015327_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/20140304015329_create_tournaments.rb b/db/migrate/20140304015329_create_tournaments.rb new file mode 100644 index 0000000..36fcf7e --- /dev/null +++ b/db/migrate/20140304015329_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/20140304015331_create_matches.rb b/db/migrate/20140304015331_create_matches.rb new file mode 100644 index 0000000..6c0c157 --- /dev/null +++ b/db/migrate/20140304015331_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/20140304015334_create_teams.rb b/db/migrate/20140304015334_create_teams.rb new file mode 100644 index 0000000..dd8397d --- /dev/null +++ b/db/migrate/20140304015334_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/20140304015336_create_users.rb b/db/migrate/20140304015336_create_users.rb new file mode 100644 index 0000000..6a500e5 --- /dev/null +++ b/db/migrate/20140304015336_create_users.rb @@ -0,0 +1,11 @@ +class CreateUsers < ActiveRecord::Migration + def change + create_table :users do |t| + t.text :name + t.text :pw_hash + t.integer :groups + + t.timestamps + end + end +end diff --git a/db/migrate/20140304015338_create_user_team_pairs.rb b/db/migrate/20140304015338_create_user_team_pairs.rb new file mode 100644 index 0000000..2c492ac --- /dev/null +++ b/db/migrate/20140304015338_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/20140304015340_create_team_match_pairs.rb b/db/migrate/20140304015340_create_team_match_pairs.rb new file mode 100644 index 0000000..8fac07e --- /dev/null +++ b/db/migrate/20140304015340_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/20140304015342_create_alerts.rb b/db/migrate/20140304015342_create_alerts.rb new file mode 100644 index 0000000..68a8e10 --- /dev/null +++ b/db/migrate/20140304015342_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/20140304015344_create_pms.rb b/db/migrate/20140304015344_create_pms.rb new file mode 100644 index 0000000..93bb5c6 --- /dev/null +++ b/db/migrate/20140304015344_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/20140304015347_create_games.rb b/db/migrate/20140304015347_create_games.rb new file mode 100644 index 0000000..59d4ef0 --- /dev/null +++ b/db/migrate/20140304015347_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/20140304015349_create_game_attributes.rb b/db/migrate/20140304015349_create_game_attributes.rb new file mode 100644 index 0000000..b63f134 --- /dev/null +++ b/db/migrate/20140304015349_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/20140304015351_create_server_settings.rb b/db/migrate/20140304015351_create_server_settings.rb new file mode 100644 index 0000000..dfdd91b --- /dev/null +++ b/db/migrate/20140304015351_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/20140304015357_create_tournament_options.rb b/db/migrate/20140304015357_create_tournament_options.rb new file mode 100644 index 0000000..d2df22e --- /dev/null +++ b/db/migrate/20140304015357_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 index 264a347..445f943 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 20140304015316) do +ActiveRecord::Schema.define(version: 20140304015357) do create_table "alerts", force: true do |t| t.integer "author_id" diff --git a/start.sh b/start.sh new file mode 100755 index 0000000..c03361e --- /dev/null +++ b/start.sh @@ -0,0 +1,5 @@ +#!/bin/bash + +generate.sh +bundle exec rails server & + -- cgit v1.1-4-g5e80 From ae3b9a846a1a08865bc8fe2f38a24bbb01e8622c Mon Sep 17 00:00:00 2001 From: AndrewMurrell Date: Sat, 1 Mar 2014 19:59:36 -0500 Subject: Made the start script sent 2> to a file called server.talk for later reference. --- db/migrate/20140304015327_create_servers.rb | 8 -------- db/migrate/20140304015329_create_tournaments.rb | 9 --------- db/migrate/20140304015331_create_matches.rb | 9 --------- db/migrate/20140304015334_create_teams.rb | 8 -------- db/migrate/20140304015336_create_users.rb | 11 ----------- db/migrate/20140304015338_create_user_team_pairs.rb | 10 ---------- db/migrate/20140304015340_create_team_match_pairs.rb | 10 ---------- db/migrate/20140304015342_create_alerts.rb | 10 ---------- db/migrate/20140304015344_create_pms.rb | 11 ----------- db/migrate/20140304015347_create_games.rb | 13 ------------- db/migrate/20140304015349_create_game_attributes.rb | 11 ----------- db/migrate/20140304015351_create_server_settings.rb | 8 -------- db/migrate/20140304015357_create_tournament_options.rb | 8 -------- db/migrate/20140304015407_create_servers.rb | 8 ++++++++ db/migrate/20140304015409_create_tournaments.rb | 9 +++++++++ db/migrate/20140304015412_create_matches.rb | 9 +++++++++ db/migrate/20140304015414_create_teams.rb | 8 ++++++++ db/migrate/20140304015416_create_users.rb | 11 +++++++++++ db/migrate/20140304015418_create_user_team_pairs.rb | 10 ++++++++++ db/migrate/20140304015420_create_team_match_pairs.rb | 10 ++++++++++ db/migrate/20140304015422_create_alerts.rb | 10 ++++++++++ db/migrate/20140304015425_create_pms.rb | 11 +++++++++++ db/migrate/20140304015427_create_games.rb | 13 +++++++++++++ db/migrate/20140304015429_create_game_attributes.rb | 11 +++++++++++ db/migrate/20140304015431_create_server_settings.rb | 8 ++++++++ db/migrate/20140304015437_create_tournament_options.rb | 8 ++++++++ db/schema.rb | 2 +- start.sh | 2 +- 28 files changed, 128 insertions(+), 128 deletions(-) delete mode 100644 db/migrate/20140304015327_create_servers.rb delete mode 100644 db/migrate/20140304015329_create_tournaments.rb delete mode 100644 db/migrate/20140304015331_create_matches.rb delete mode 100644 db/migrate/20140304015334_create_teams.rb delete mode 100644 db/migrate/20140304015336_create_users.rb delete mode 100644 db/migrate/20140304015338_create_user_team_pairs.rb delete mode 100644 db/migrate/20140304015340_create_team_match_pairs.rb delete mode 100644 db/migrate/20140304015342_create_alerts.rb delete mode 100644 db/migrate/20140304015344_create_pms.rb delete mode 100644 db/migrate/20140304015347_create_games.rb delete mode 100644 db/migrate/20140304015349_create_game_attributes.rb delete mode 100644 db/migrate/20140304015351_create_server_settings.rb delete mode 100644 db/migrate/20140304015357_create_tournament_options.rb create mode 100644 db/migrate/20140304015407_create_servers.rb create mode 100644 db/migrate/20140304015409_create_tournaments.rb create mode 100644 db/migrate/20140304015412_create_matches.rb create mode 100644 db/migrate/20140304015414_create_teams.rb create mode 100644 db/migrate/20140304015416_create_users.rb create mode 100644 db/migrate/20140304015418_create_user_team_pairs.rb create mode 100644 db/migrate/20140304015420_create_team_match_pairs.rb create mode 100644 db/migrate/20140304015422_create_alerts.rb create mode 100644 db/migrate/20140304015425_create_pms.rb create mode 100644 db/migrate/20140304015427_create_games.rb create mode 100644 db/migrate/20140304015429_create_game_attributes.rb create mode 100644 db/migrate/20140304015431_create_server_settings.rb create mode 100644 db/migrate/20140304015437_create_tournament_options.rb diff --git a/db/migrate/20140304015327_create_servers.rb b/db/migrate/20140304015327_create_servers.rb deleted file mode 100644 index f33241a..0000000 --- a/db/migrate/20140304015327_create_servers.rb +++ /dev/null @@ -1,8 +0,0 @@ -class CreateServers < ActiveRecord::Migration - def change - create_table :servers do |t| - - t.timestamps - end - end -end diff --git a/db/migrate/20140304015329_create_tournaments.rb b/db/migrate/20140304015329_create_tournaments.rb deleted file mode 100644 index 36fcf7e..0000000 --- a/db/migrate/20140304015329_create_tournaments.rb +++ /dev/null @@ -1,9 +0,0 @@ -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/20140304015331_create_matches.rb b/db/migrate/20140304015331_create_matches.rb deleted file mode 100644 index 6c0c157..0000000 --- a/db/migrate/20140304015331_create_matches.rb +++ /dev/null @@ -1,9 +0,0 @@ -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/20140304015334_create_teams.rb b/db/migrate/20140304015334_create_teams.rb deleted file mode 100644 index dd8397d..0000000 --- a/db/migrate/20140304015334_create_teams.rb +++ /dev/null @@ -1,8 +0,0 @@ -class CreateTeams < ActiveRecord::Migration - def change - create_table :teams do |t| - - t.timestamps - end - end -end diff --git a/db/migrate/20140304015336_create_users.rb b/db/migrate/20140304015336_create_users.rb deleted file mode 100644 index 6a500e5..0000000 --- a/db/migrate/20140304015336_create_users.rb +++ /dev/null @@ -1,11 +0,0 @@ -class CreateUsers < ActiveRecord::Migration - def change - create_table :users do |t| - t.text :name - t.text :pw_hash - t.integer :groups - - t.timestamps - end - end -end diff --git a/db/migrate/20140304015338_create_user_team_pairs.rb b/db/migrate/20140304015338_create_user_team_pairs.rb deleted file mode 100644 index 2c492ac..0000000 --- a/db/migrate/20140304015338_create_user_team_pairs.rb +++ /dev/null @@ -1,10 +0,0 @@ -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/20140304015340_create_team_match_pairs.rb b/db/migrate/20140304015340_create_team_match_pairs.rb deleted file mode 100644 index 8fac07e..0000000 --- a/db/migrate/20140304015340_create_team_match_pairs.rb +++ /dev/null @@ -1,10 +0,0 @@ -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/20140304015342_create_alerts.rb b/db/migrate/20140304015342_create_alerts.rb deleted file mode 100644 index 68a8e10..0000000 --- a/db/migrate/20140304015342_create_alerts.rb +++ /dev/null @@ -1,10 +0,0 @@ -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/20140304015344_create_pms.rb b/db/migrate/20140304015344_create_pms.rb deleted file mode 100644 index 93bb5c6..0000000 --- a/db/migrate/20140304015344_create_pms.rb +++ /dev/null @@ -1,11 +0,0 @@ -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/20140304015347_create_games.rb b/db/migrate/20140304015347_create_games.rb deleted file mode 100644 index 59d4ef0..0000000 --- a/db/migrate/20140304015347_create_games.rb +++ /dev/null @@ -1,13 +0,0 @@ -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/20140304015349_create_game_attributes.rb b/db/migrate/20140304015349_create_game_attributes.rb deleted file mode 100644 index b63f134..0000000 --- a/db/migrate/20140304015349_create_game_attributes.rb +++ /dev/null @@ -1,11 +0,0 @@ -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/20140304015351_create_server_settings.rb b/db/migrate/20140304015351_create_server_settings.rb deleted file mode 100644 index dfdd91b..0000000 --- a/db/migrate/20140304015351_create_server_settings.rb +++ /dev/null @@ -1,8 +0,0 @@ -class CreateServerSettings < ActiveRecord::Migration - def change - create_table :server_settings do |t| - - t.timestamps - end - end -end diff --git a/db/migrate/20140304015357_create_tournament_options.rb b/db/migrate/20140304015357_create_tournament_options.rb deleted file mode 100644 index d2df22e..0000000 --- a/db/migrate/20140304015357_create_tournament_options.rb +++ /dev/null @@ -1,8 +0,0 @@ -class CreateTournamentOptions < ActiveRecord::Migration - def change - create_table :tournament_options do |t| - - t.timestamps - end - end -end diff --git a/db/migrate/20140304015407_create_servers.rb b/db/migrate/20140304015407_create_servers.rb new file mode 100644 index 0000000..f33241a --- /dev/null +++ b/db/migrate/20140304015407_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/20140304015409_create_tournaments.rb b/db/migrate/20140304015409_create_tournaments.rb new file mode 100644 index 0000000..36fcf7e --- /dev/null +++ b/db/migrate/20140304015409_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/20140304015412_create_matches.rb b/db/migrate/20140304015412_create_matches.rb new file mode 100644 index 0000000..6c0c157 --- /dev/null +++ b/db/migrate/20140304015412_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/20140304015414_create_teams.rb b/db/migrate/20140304015414_create_teams.rb new file mode 100644 index 0000000..dd8397d --- /dev/null +++ b/db/migrate/20140304015414_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/20140304015416_create_users.rb b/db/migrate/20140304015416_create_users.rb new file mode 100644 index 0000000..6a500e5 --- /dev/null +++ b/db/migrate/20140304015416_create_users.rb @@ -0,0 +1,11 @@ +class CreateUsers < ActiveRecord::Migration + def change + create_table :users do |t| + t.text :name + t.text :pw_hash + t.integer :groups + + t.timestamps + end + end +end diff --git a/db/migrate/20140304015418_create_user_team_pairs.rb b/db/migrate/20140304015418_create_user_team_pairs.rb new file mode 100644 index 0000000..2c492ac --- /dev/null +++ b/db/migrate/20140304015418_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/20140304015420_create_team_match_pairs.rb b/db/migrate/20140304015420_create_team_match_pairs.rb new file mode 100644 index 0000000..8fac07e --- /dev/null +++ b/db/migrate/20140304015420_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/20140304015422_create_alerts.rb b/db/migrate/20140304015422_create_alerts.rb new file mode 100644 index 0000000..68a8e10 --- /dev/null +++ b/db/migrate/20140304015422_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/20140304015425_create_pms.rb b/db/migrate/20140304015425_create_pms.rb new file mode 100644 index 0000000..93bb5c6 --- /dev/null +++ b/db/migrate/20140304015425_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/20140304015427_create_games.rb b/db/migrate/20140304015427_create_games.rb new file mode 100644 index 0000000..59d4ef0 --- /dev/null +++ b/db/migrate/20140304015427_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/20140304015429_create_game_attributes.rb b/db/migrate/20140304015429_create_game_attributes.rb new file mode 100644 index 0000000..b63f134 --- /dev/null +++ b/db/migrate/20140304015429_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/20140304015431_create_server_settings.rb b/db/migrate/20140304015431_create_server_settings.rb new file mode 100644 index 0000000..dfdd91b --- /dev/null +++ b/db/migrate/20140304015431_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/20140304015437_create_tournament_options.rb b/db/migrate/20140304015437_create_tournament_options.rb new file mode 100644 index 0000000..d2df22e --- /dev/null +++ b/db/migrate/20140304015437_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 index 445f943..f970bd1 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 20140304015357) do +ActiveRecord::Schema.define(version: 20140304015437) do create_table "alerts", force: true do |t| t.integer "author_id" diff --git a/start.sh b/start.sh index c03361e..01b7f72 100755 --- a/start.sh +++ b/start.sh @@ -1,5 +1,5 @@ #!/bin/bash generate.sh -bundle exec rails server & +bundle exec rails server 2> server.talk & -- cgit v1.1-4-g5e80 From 2eb242f3e5b1f1ab66d84556cabcad965fe387aa Mon Sep 17 00:00:00 2001 From: DavisLWebb Date: Sat, 1 Mar 2014 20:23:29 -0500 Subject: changed the user section of the generate --- app/controllers/users_controller.rb | 72 ---------------------- app/models/tournament_option.rb | 2 + app/models/tournament_options.rb | 2 - app/views/users/_form.html.erb | 29 --------- app/views/users/edit.html.erb | 6 -- app/views/users/index.html.erb | 31 ---------- app/views/users/index.json.jbuilder | 4 -- app/views/users/new.html.erb | 5 -- app/views/users/show.html.erb | 19 ------ app/views/users/show.json.jbuilder | 1 - config/routes.rb | 2 - db/migrate/20140304015447_create_servers.rb | 8 --- db/migrate/20140304015449_create_tournaments.rb | 9 --- db/migrate/20140304015452_create_matches.rb | 9 --- db/migrate/20140304015454_create_teams.rb | 8 --- db/migrate/20140304015456_create_users.rb | 11 ---- .../20140304015458_create_user_team_pairs.rb | 10 --- .../20140304015500_create_team_match_pairs.rb | 10 --- db/migrate/20140304015502_create_alerts.rb | 10 --- db/migrate/20140304015505_create_pms.rb | 11 ---- db/migrate/20140304015507_create_games.rb | 13 ---- .../20140304015509_create_game_attributes.rb | 11 ---- .../20140304015511_create_server_settings.rb | 8 --- .../20140304015517_create_tournament_options.rb | 8 --- db/migrate/20140304015527_create_servers.rb | 8 +++ db/migrate/20140304015530_create_tournaments.rb | 9 +++ db/migrate/20140304015532_create_matches.rb | 9 +++ db/migrate/20140304015534_create_teams.rb | 8 +++ db/migrate/20140304015538_create_users.rb | 11 ++++ .../20140304015540_create_user_team_pairs.rb | 10 +++ .../20140304015542_create_team_match_pairs.rb | 10 +++ db/migrate/20140304015544_create_alerts.rb | 10 +++ db/migrate/20140304015547_create_pms.rb | 11 ++++ db/migrate/20140304015549_create_games.rb | 13 ++++ .../20140304015551_create_game_attributes.rb | 11 ++++ .../20140304015553_create_server_settings.rb | 8 +++ .../20140304015559_create_tournament_options.rb | 8 +++ db/schema.rb | 8 +-- generate.sh | 32 +++++----- test/controllers/users_controller_test.rb | 48 +-------------- test/fixtures/users.yml | 12 ++-- test/models/tournament_option_test.rb | 7 +++ test/models/tournament_options_test.rb | 7 --- 43 files changed, 165 insertions(+), 374 deletions(-) create mode 100644 app/models/tournament_option.rb delete mode 100644 app/models/tournament_options.rb delete mode 100644 app/views/users/_form.html.erb delete mode 100644 app/views/users/edit.html.erb delete mode 100644 app/views/users/index.html.erb delete mode 100644 app/views/users/index.json.jbuilder delete mode 100644 app/views/users/new.html.erb delete mode 100644 app/views/users/show.html.erb delete mode 100644 app/views/users/show.json.jbuilder delete mode 100644 db/migrate/20140304015447_create_servers.rb delete mode 100644 db/migrate/20140304015449_create_tournaments.rb delete mode 100644 db/migrate/20140304015452_create_matches.rb delete mode 100644 db/migrate/20140304015454_create_teams.rb delete mode 100644 db/migrate/20140304015456_create_users.rb delete mode 100644 db/migrate/20140304015458_create_user_team_pairs.rb delete mode 100644 db/migrate/20140304015500_create_team_match_pairs.rb delete mode 100644 db/migrate/20140304015502_create_alerts.rb delete mode 100644 db/migrate/20140304015505_create_pms.rb delete mode 100644 db/migrate/20140304015507_create_games.rb delete mode 100644 db/migrate/20140304015509_create_game_attributes.rb delete mode 100644 db/migrate/20140304015511_create_server_settings.rb delete mode 100644 db/migrate/20140304015517_create_tournament_options.rb create mode 100644 db/migrate/20140304015527_create_servers.rb create mode 100644 db/migrate/20140304015530_create_tournaments.rb create mode 100644 db/migrate/20140304015532_create_matches.rb create mode 100644 db/migrate/20140304015534_create_teams.rb create mode 100644 db/migrate/20140304015538_create_users.rb create mode 100644 db/migrate/20140304015540_create_user_team_pairs.rb create mode 100644 db/migrate/20140304015542_create_team_match_pairs.rb create mode 100644 db/migrate/20140304015544_create_alerts.rb create mode 100644 db/migrate/20140304015547_create_pms.rb create mode 100644 db/migrate/20140304015549_create_games.rb create mode 100644 db/migrate/20140304015551_create_game_attributes.rb create mode 100644 db/migrate/20140304015553_create_server_settings.rb create mode 100644 db/migrate/20140304015559_create_tournament_options.rb create mode 100644 test/models/tournament_option_test.rb delete mode 100644 test/models/tournament_options_test.rb diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 4db617e..3e74dea 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -1,74 +1,2 @@ class UsersController < ApplicationController - before_action :set_user, only: [:show, :edit, :update, :destroy] - - # GET /users - # GET /users.json - def index - @users = User.all - end - - # GET /users/1 - # GET /users/1.json - def show - end - - # GET /users/new - def new - @user = User.new - end - - # GET /users/1/edit - def edit - end - - # POST /users - # POST /users.json - def create - @user = User.new(user_params) - - respond_to do |format| - if @user.save - format.html { redirect_to @user, notice: 'User was successfully created.' } - format.json { render action: 'show', status: :created, location: @user } - else - format.html { render action: 'new' } - format.json { render json: @user.errors, status: :unprocessable_entity } - end - end - end - - # PATCH/PUT /users/1 - # PATCH/PUT /users/1.json - def update - respond_to do |format| - if @user.update(user_params) - format.html { redirect_to @user, notice: 'User was successfully updated.' } - format.json { head :no_content } - else - format.html { render action: 'edit' } - format.json { render json: @user.errors, status: :unprocessable_entity } - end - end - end - - # DELETE /users/1 - # DELETE /users/1.json - def destroy - @user.destroy - respond_to do |format| - format.html { redirect_to users_url } - format.json { head :no_content } - end - end - - private - # Use callbacks to share common setup or constraints between actions. - def set_user - @user = User.find(params[:id]) - end - - # Never trust parameters from the scary internet, only allow the white list through. - def user_params - params.require(:user).permit(:name, :pw_hash, :groups) - end 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/tournament_options.rb b/app/models/tournament_options.rb deleted file mode 100644 index 8ed6433..0000000 --- a/app/models/tournament_options.rb +++ /dev/null @@ -1,2 +0,0 @@ -class TournamentOptions < ActiveRecord::Base -end diff --git a/app/views/users/_form.html.erb b/app/views/users/_form.html.erb deleted file mode 100644 index 2d1ad24..0000000 --- a/app/views/users/_form.html.erb +++ /dev/null @@ -1,29 +0,0 @@ -<%= form_for(@user) do |f| %> - <% if @user.errors.any? %> -
-

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

- -
    - <% @user.errors.full_messages.each do |msg| %> -
  • <%= msg %>
  • - <% end %> -
-
- <% end %> - -
- <%= f.label :name %>
- <%= f.text_area :name %> -
-
- <%= f.label :pw_hash %>
- <%= f.text_area :pw_hash %> -
-
- <%= f.label :groups %>
- <%= f.number_field :groups %> -
-
- <%= f.submit %> -
-<% end %> diff --git a/app/views/users/edit.html.erb b/app/views/users/edit.html.erb deleted file mode 100644 index 99bd4cc..0000000 --- a/app/views/users/edit.html.erb +++ /dev/null @@ -1,6 +0,0 @@ -

Editing user

- -<%= render 'form' %> - -<%= link_to 'Show', @user %> | -<%= link_to 'Back', users_path %> diff --git a/app/views/users/index.html.erb b/app/views/users/index.html.erb deleted file mode 100644 index 14739ae..0000000 --- a/app/views/users/index.html.erb +++ /dev/null @@ -1,31 +0,0 @@ -

Listing users

- -
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?' } %>
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?' } %>
- - - - - - - - - - - - - <% @users.each do |user| %> - - - - - - - - - <% end %> - -
NamePw hashGroups
<%= user.name %><%= user.pw_hash %><%= user.groups %><%= link_to 'Show', user %><%= link_to 'Edit', edit_user_path(user) %><%= link_to 'Destroy', user, method: :delete, data: { confirm: 'Are you sure?' } %>
- -
- -<%= link_to 'New User', new_user_path %> diff --git a/app/views/users/index.json.jbuilder b/app/views/users/index.json.jbuilder deleted file mode 100644 index 58c42c1..0000000 --- a/app/views/users/index.json.jbuilder +++ /dev/null @@ -1,4 +0,0 @@ -json.array!(@users) do |user| - json.extract! user, :id, :name, :pw_hash, :groups - json.url user_url(user, format: :json) -end diff --git a/app/views/users/new.html.erb b/app/views/users/new.html.erb deleted file mode 100644 index efc0404..0000000 --- a/app/views/users/new.html.erb +++ /dev/null @@ -1,5 +0,0 @@ -

New user

- -<%= render 'form' %> - -<%= link_to 'Back', users_path %> diff --git a/app/views/users/show.html.erb b/app/views/users/show.html.erb deleted file mode 100644 index 05150f5..0000000 --- a/app/views/users/show.html.erb +++ /dev/null @@ -1,19 +0,0 @@ -

<%= notice %>

- -

- Name: - <%= @user.name %> -

- -

- Pw hash: - <%= @user.pw_hash %> -

- -

- Groups: - <%= @user.groups %> -

- -<%= link_to 'Edit', edit_user_path(@user) %> | -<%= link_to 'Back', users_path %> diff --git a/app/views/users/show.json.jbuilder b/app/views/users/show.json.jbuilder deleted file mode 100644 index 968b383..0000000 --- a/app/views/users/show.json.jbuilder +++ /dev/null @@ -1 +0,0 @@ -json.extract! @user, :id, :name, :pw_hash, :groups, :created_at, :updated_at diff --git a/config/routes.rb b/config/routes.rb index 3412005..149c321 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -5,8 +5,6 @@ Leaguer::Application.routes.draw do resources :alerts - resources :users - resources :teams resources :matches diff --git a/db/migrate/20140304015447_create_servers.rb b/db/migrate/20140304015447_create_servers.rb deleted file mode 100644 index f33241a..0000000 --- a/db/migrate/20140304015447_create_servers.rb +++ /dev/null @@ -1,8 +0,0 @@ -class CreateServers < ActiveRecord::Migration - def change - create_table :servers do |t| - - t.timestamps - end - end -end diff --git a/db/migrate/20140304015449_create_tournaments.rb b/db/migrate/20140304015449_create_tournaments.rb deleted file mode 100644 index 36fcf7e..0000000 --- a/db/migrate/20140304015449_create_tournaments.rb +++ /dev/null @@ -1,9 +0,0 @@ -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/20140304015452_create_matches.rb b/db/migrate/20140304015452_create_matches.rb deleted file mode 100644 index 6c0c157..0000000 --- a/db/migrate/20140304015452_create_matches.rb +++ /dev/null @@ -1,9 +0,0 @@ -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/20140304015454_create_teams.rb b/db/migrate/20140304015454_create_teams.rb deleted file mode 100644 index dd8397d..0000000 --- a/db/migrate/20140304015454_create_teams.rb +++ /dev/null @@ -1,8 +0,0 @@ -class CreateTeams < ActiveRecord::Migration - def change - create_table :teams do |t| - - t.timestamps - end - end -end diff --git a/db/migrate/20140304015456_create_users.rb b/db/migrate/20140304015456_create_users.rb deleted file mode 100644 index 6a500e5..0000000 --- a/db/migrate/20140304015456_create_users.rb +++ /dev/null @@ -1,11 +0,0 @@ -class CreateUsers < ActiveRecord::Migration - def change - create_table :users do |t| - t.text :name - t.text :pw_hash - t.integer :groups - - t.timestamps - end - end -end diff --git a/db/migrate/20140304015458_create_user_team_pairs.rb b/db/migrate/20140304015458_create_user_team_pairs.rb deleted file mode 100644 index 2c492ac..0000000 --- a/db/migrate/20140304015458_create_user_team_pairs.rb +++ /dev/null @@ -1,10 +0,0 @@ -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/20140304015500_create_team_match_pairs.rb b/db/migrate/20140304015500_create_team_match_pairs.rb deleted file mode 100644 index 8fac07e..0000000 --- a/db/migrate/20140304015500_create_team_match_pairs.rb +++ /dev/null @@ -1,10 +0,0 @@ -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/20140304015502_create_alerts.rb b/db/migrate/20140304015502_create_alerts.rb deleted file mode 100644 index 68a8e10..0000000 --- a/db/migrate/20140304015502_create_alerts.rb +++ /dev/null @@ -1,10 +0,0 @@ -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/20140304015505_create_pms.rb b/db/migrate/20140304015505_create_pms.rb deleted file mode 100644 index 93bb5c6..0000000 --- a/db/migrate/20140304015505_create_pms.rb +++ /dev/null @@ -1,11 +0,0 @@ -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/20140304015507_create_games.rb b/db/migrate/20140304015507_create_games.rb deleted file mode 100644 index 59d4ef0..0000000 --- a/db/migrate/20140304015507_create_games.rb +++ /dev/null @@ -1,13 +0,0 @@ -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/20140304015509_create_game_attributes.rb b/db/migrate/20140304015509_create_game_attributes.rb deleted file mode 100644 index b63f134..0000000 --- a/db/migrate/20140304015509_create_game_attributes.rb +++ /dev/null @@ -1,11 +0,0 @@ -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/20140304015511_create_server_settings.rb b/db/migrate/20140304015511_create_server_settings.rb deleted file mode 100644 index dfdd91b..0000000 --- a/db/migrate/20140304015511_create_server_settings.rb +++ /dev/null @@ -1,8 +0,0 @@ -class CreateServerSettings < ActiveRecord::Migration - def change - create_table :server_settings do |t| - - t.timestamps - end - end -end diff --git a/db/migrate/20140304015517_create_tournament_options.rb b/db/migrate/20140304015517_create_tournament_options.rb deleted file mode 100644 index d2df22e..0000000 --- a/db/migrate/20140304015517_create_tournament_options.rb +++ /dev/null @@ -1,8 +0,0 @@ -class CreateTournamentOptions < ActiveRecord::Migration - def change - create_table :tournament_options do |t| - - t.timestamps - end - end -end diff --git a/db/migrate/20140304015527_create_servers.rb b/db/migrate/20140304015527_create_servers.rb new file mode 100644 index 0000000..f33241a --- /dev/null +++ b/db/migrate/20140304015527_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/20140304015530_create_tournaments.rb b/db/migrate/20140304015530_create_tournaments.rb new file mode 100644 index 0000000..36fcf7e --- /dev/null +++ b/db/migrate/20140304015530_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/20140304015532_create_matches.rb b/db/migrate/20140304015532_create_matches.rb new file mode 100644 index 0000000..6c0c157 --- /dev/null +++ b/db/migrate/20140304015532_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/20140304015534_create_teams.rb b/db/migrate/20140304015534_create_teams.rb new file mode 100644 index 0000000..dd8397d --- /dev/null +++ b/db/migrate/20140304015534_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/20140304015538_create_users.rb b/db/migrate/20140304015538_create_users.rb new file mode 100644 index 0000000..f0986d4 --- /dev/null +++ b/db/migrate/20140304015538_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/20140304015540_create_user_team_pairs.rb b/db/migrate/20140304015540_create_user_team_pairs.rb new file mode 100644 index 0000000..2c492ac --- /dev/null +++ b/db/migrate/20140304015540_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/20140304015542_create_team_match_pairs.rb b/db/migrate/20140304015542_create_team_match_pairs.rb new file mode 100644 index 0000000..8fac07e --- /dev/null +++ b/db/migrate/20140304015542_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/20140304015544_create_alerts.rb b/db/migrate/20140304015544_create_alerts.rb new file mode 100644 index 0000000..68a8e10 --- /dev/null +++ b/db/migrate/20140304015544_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/20140304015547_create_pms.rb b/db/migrate/20140304015547_create_pms.rb new file mode 100644 index 0000000..93bb5c6 --- /dev/null +++ b/db/migrate/20140304015547_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/20140304015549_create_games.rb b/db/migrate/20140304015549_create_games.rb new file mode 100644 index 0000000..59d4ef0 --- /dev/null +++ b/db/migrate/20140304015549_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/20140304015551_create_game_attributes.rb b/db/migrate/20140304015551_create_game_attributes.rb new file mode 100644 index 0000000..b63f134 --- /dev/null +++ b/db/migrate/20140304015551_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/20140304015553_create_server_settings.rb b/db/migrate/20140304015553_create_server_settings.rb new file mode 100644 index 0000000..dfdd91b --- /dev/null +++ b/db/migrate/20140304015553_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/20140304015559_create_tournament_options.rb b/db/migrate/20140304015559_create_tournament_options.rb new file mode 100644 index 0000000..d2df22e --- /dev/null +++ b/db/migrate/20140304015559_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 index 41dac9e..7d4d50e 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 20140304015517) do +ActiveRecord::Schema.define(version: 20140304015559) do create_table "alerts", force: true do |t| t.integer "author_id" @@ -110,9 +110,9 @@ ActiveRecord::Schema.define(version: 20140304015517) do add_index "user_team_pairs", ["user_id"], name: "index_user_team_pairs_on_user_id" create_table "users", force: true do |t| - t.text "name" - t.text "pw_hash" - t.integer "groups" + t.string "name" + t.string "email" + t.string "user_name" t.datetime "created_at" t.datetime "updated_at" end diff --git a/generate.sh b/generate.sh index 07a7688..2bf027a 100755 --- a/generate.sh +++ b/generate.sh @@ -10,25 +10,27 @@ # To Clear the Generated Files: # git clean -df # +NOTEST='--skip-test-unit' set -x -bundle exec rails generate scaffold server -bundle exec rails generate scaffold tournament game:references -bundle exec rails generate scaffold match tournament:references -bundle exec rails generate scaffold team -bundle exec rails generate scaffold user name:text pw_hash:text groups:integer -bundle exec rails generate model user_team_pair user:references team:references -bundle exec rails generate model team_match_pair team:references match:references -bundle exec rails generate scaffold alert author:references message:text -bundle exec rails generate scaffold pm author:references recipient:references message:text -bundle exec rails generate scaffold game name:text players_per_team:integer teams_per_match:integer set_rounds:integer randomized_teams:integer -bundle exec rails generate model game_attribute game:references key:text type:integer -bundle exec rails generate model server_settings -bundle exec rails generate controller search -bundle exec rails generate controller main +bundle exec rails generate scaffold server $NOTEST +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 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 +bundle exec rails generate scaffold alert author:references message:text $NOTEST +bundle exec rails generate scaffold pm author:references recipient:references message:text $NOTEST +bundle exec rails generate scaffold game name:text players_per_team:integer teams_per_match:integer set_rounds:integer randomized_teams:integer $NOTEST +bundle exec rails generate model game_attribute game:references key:text type:integer $NOTEST +bundle exec rails generate model server_settings $NOTEST +bundle exec rails generate controller search $NOTEST +bundle exec rails generate controller main $NOTEST #for the tournament controller to generate options -bundle exec rails generate model tournament_options +bundle exec rails generate model tournament_option $NOTEST bundle exec rake db:drop RAILS_ENV=development bundle exec rake db:migrate RAILS_ENV=development diff --git a/test/controllers/users_controller_test.rb b/test/controllers/users_controller_test.rb index 8bcd10b..d23f182 100644 --- a/test/controllers/users_controller_test.rb +++ b/test/controllers/users_controller_test.rb @@ -1,49 +1,7 @@ require 'test_helper' class UsersControllerTest < ActionController::TestCase - setup do - @user = users(:one) - end - - test "should get index" do - get :index - assert_response :success - assert_not_nil assigns(:users) - end - - test "should get new" do - get :new - assert_response :success - end - - test "should create user" do - assert_difference('User.count') do - post :create, user: { groups: @user.groups, name: @user.name, pw_hash: @user.pw_hash } - end - - assert_redirected_to user_path(assigns(:user)) - end - - test "should show user" do - get :show, id: @user - assert_response :success - end - - test "should get edit" do - get :edit, id: @user - assert_response :success - end - - test "should update user" do - patch :update, id: @user, user: { groups: @user.groups, name: @user.name, pw_hash: @user.pw_hash } - assert_redirected_to user_path(assigns(:user)) - end - - test "should destroy user" do - assert_difference('User.count', -1) do - delete :destroy, id: @user - end - - assert_redirected_to users_path - end + # test "the truth" do + # assert true + # end end diff --git a/test/fixtures/users.yml b/test/fixtures/users.yml index 9f593bc..ea3e874 100644 --- a/test/fixtures/users.yml +++ b/test/fixtures/users.yml @@ -1,11 +1,11 @@ # Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html one: - name: MyText - pw_hash: MyText - groups: 1 + name: MyString + email: MyString + user_name: MyString two: - name: MyText - pw_hash: MyText - groups: 1 + name: MyString + email: MyString + user_name: MyString diff --git a/test/models/tournament_option_test.rb b/test/models/tournament_option_test.rb new file mode 100644 index 0000000..8fa9628 --- /dev/null +++ b/test/models/tournament_option_test.rb @@ -0,0 +1,7 @@ +require 'test_helper' + +class TournamentOptionTest < ActiveSupport::TestCase + # test "the truth" do + # assert true + # end +end diff --git a/test/models/tournament_options_test.rb b/test/models/tournament_options_test.rb deleted file mode 100644 index 7677fae..0000000 --- a/test/models/tournament_options_test.rb +++ /dev/null @@ -1,7 +0,0 @@ -require 'test_helper' - -class TournamentOptionsTest < ActiveSupport::TestCase - # test "the truth" do - # assert true - # end -end -- cgit v1.1-4-g5e80 From 11be92e4bac671852fd03922049ca592ae4c9f4e Mon Sep 17 00:00:00 2001 From: DavisLWebb Date: Sat, 1 Mar 2014 20:24:43 -0500 Subject: changed the gemfile to include rspecy testing and a security name i cant remember the name of --- Gemfile | 16 ++- Gemfile.lock | 38 +++++ db/migrate/20140304015527_create_servers.rb | 8 -- db/migrate/20140304015530_create_tournaments.rb | 9 -- db/migrate/20140304015532_create_matches.rb | 9 -- db/migrate/20140304015534_create_teams.rb | 8 -- db/migrate/20140304015538_create_users.rb | 11 -- .../20140304015540_create_user_team_pairs.rb | 10 -- .../20140304015542_create_team_match_pairs.rb | 10 -- db/migrate/20140304015544_create_alerts.rb | 10 -- db/migrate/20140304015547_create_pms.rb | 11 -- db/migrate/20140304015549_create_games.rb | 13 -- .../20140304015551_create_game_attributes.rb | 11 -- .../20140304015553_create_server_settings.rb | 8 -- .../20140304015559_create_tournament_options.rb | 8 -- db/migrate/20140304015610_create_servers.rb | 8 ++ db/migrate/20140304015612_create_tournaments.rb | 9 ++ db/migrate/20140304015615_create_matches.rb | 9 ++ db/migrate/20140304015617_create_teams.rb | 8 ++ db/migrate/20140304015622_create_users.rb | 11 ++ .../20140304015624_create_user_team_pairs.rb | 10 ++ .../20140304015626_create_team_match_pairs.rb | 10 ++ db/migrate/20140304015628_create_alerts.rb | 10 ++ db/migrate/20140304015631_create_pms.rb | 11 ++ db/migrate/20140304015633_create_games.rb | 13 ++ .../20140304015635_create_game_attributes.rb | 11 ++ .../20140304015638_create_server_settings.rb | 8 ++ .../20140304015644_create_tournament_options.rb | 8 ++ db/schema.rb | 2 +- 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/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/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 ++ test/controllers/alerts_controller_test.rb | 49 ------- test/controllers/games_controller_test.rb | 49 ------- test/controllers/main_controller_test.rb | 7 - test/controllers/matches_controller_test.rb | 49 ------- test/controllers/pms_controller_test.rb | 49 ------- test/controllers/search_controller_test.rb | 7 - test/controllers/servers_controller_test.rb | 49 ------- test/controllers/teams_controller_test.rb | 49 ------- test/controllers/tournaments_controller_test.rb | 49 ------- test/controllers/users_controller_test.rb | 7 - test/fixtures/alerts.yml | 9 -- test/fixtures/game_attributes.yml | 11 -- test/fixtures/games.yml | 15 -- test/fixtures/matches.yml | 7 - test/fixtures/pms.yml | 11 -- test/fixtures/server_settings.yml | 11 -- test/fixtures/servers.yml | 11 -- test/fixtures/team_match_pairs.yml | 9 -- test/fixtures/teams.yml | 11 -- test/fixtures/tournament_options.yml | 11 -- test/fixtures/tournaments.yml | 7 - test/fixtures/user_team_pairs.yml | 9 -- test/fixtures/users.yml | 11 -- test/helpers/alerts_helper_test.rb | 4 - test/helpers/games_helper_test.rb | 4 - test/helpers/main_helper_test.rb | 4 - test/helpers/matches_helper_test.rb | 4 - test/helpers/pms_helper_test.rb | 4 - test/helpers/search_helper_test.rb | 4 - test/helpers/servers_helper_test.rb | 4 - test/helpers/teams_helper_test.rb | 4 - test/helpers/tournaments_helper_test.rb | 4 - test/helpers/users_helper_test.rb | 4 - test/models/alert_test.rb | 7 - test/models/game_attribute_test.rb | 7 - test/models/game_test.rb | 7 - test/models/match_test.rb | 7 - test/models/pm_test.rb | 7 - test/models/server_settings_test.rb | 7 - test/models/server_test.rb | 7 - test/models/team_match_pair_test.rb | 7 - test/models/team_test.rb | 7 - test/models/tournament_option_test.rb | 7 - test/models/tournament_test.rb | 7 - test/models/user_team_pair_test.rb | 7 - test/models/user_test.rb | 7 - 150 files changed, 2384 insertions(+), 756 deletions(-) delete mode 100644 db/migrate/20140304015527_create_servers.rb delete mode 100644 db/migrate/20140304015530_create_tournaments.rb delete mode 100644 db/migrate/20140304015532_create_matches.rb delete mode 100644 db/migrate/20140304015534_create_teams.rb delete mode 100644 db/migrate/20140304015538_create_users.rb delete mode 100644 db/migrate/20140304015540_create_user_team_pairs.rb delete mode 100644 db/migrate/20140304015542_create_team_match_pairs.rb delete mode 100644 db/migrate/20140304015544_create_alerts.rb delete mode 100644 db/migrate/20140304015547_create_pms.rb delete mode 100644 db/migrate/20140304015549_create_games.rb delete mode 100644 db/migrate/20140304015551_create_game_attributes.rb delete mode 100644 db/migrate/20140304015553_create_server_settings.rb delete mode 100644 db/migrate/20140304015559_create_tournament_options.rb create mode 100644 db/migrate/20140304015610_create_servers.rb create mode 100644 db/migrate/20140304015612_create_tournaments.rb create mode 100644 db/migrate/20140304015615_create_matches.rb create mode 100644 db/migrate/20140304015617_create_teams.rb create mode 100644 db/migrate/20140304015622_create_users.rb create mode 100644 db/migrate/20140304015624_create_user_team_pairs.rb create mode 100644 db/migrate/20140304015626_create_team_match_pairs.rb create mode 100644 db/migrate/20140304015628_create_alerts.rb create mode 100644 db/migrate/20140304015631_create_pms.rb create mode 100644 db/migrate/20140304015633_create_games.rb create mode 100644 db/migrate/20140304015635_create_game_attributes.rb create mode 100644 db/migrate/20140304015638_create_server_settings.rb create mode 100644 db/migrate/20140304015644_create_tournament_options.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/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/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 delete mode 100644 test/controllers/alerts_controller_test.rb delete mode 100644 test/controllers/games_controller_test.rb delete mode 100644 test/controllers/main_controller_test.rb delete mode 100644 test/controllers/matches_controller_test.rb delete mode 100644 test/controllers/pms_controller_test.rb delete mode 100644 test/controllers/search_controller_test.rb delete mode 100644 test/controllers/servers_controller_test.rb delete mode 100644 test/controllers/teams_controller_test.rb delete mode 100644 test/controllers/tournaments_controller_test.rb delete mode 100644 test/controllers/users_controller_test.rb delete mode 100644 test/fixtures/alerts.yml delete mode 100644 test/fixtures/game_attributes.yml delete mode 100644 test/fixtures/games.yml delete mode 100644 test/fixtures/matches.yml delete mode 100644 test/fixtures/pms.yml delete mode 100644 test/fixtures/server_settings.yml delete mode 100644 test/fixtures/servers.yml delete mode 100644 test/fixtures/team_match_pairs.yml delete mode 100644 test/fixtures/teams.yml delete mode 100644 test/fixtures/tournament_options.yml delete mode 100644 test/fixtures/tournaments.yml delete mode 100644 test/fixtures/user_team_pairs.yml delete mode 100644 test/fixtures/users.yml delete mode 100644 test/helpers/alerts_helper_test.rb delete mode 100644 test/helpers/games_helper_test.rb delete mode 100644 test/helpers/main_helper_test.rb delete mode 100644 test/helpers/matches_helper_test.rb delete mode 100644 test/helpers/pms_helper_test.rb delete mode 100644 test/helpers/search_helper_test.rb delete mode 100644 test/helpers/servers_helper_test.rb delete mode 100644 test/helpers/teams_helper_test.rb delete mode 100644 test/helpers/tournaments_helper_test.rb delete mode 100644 test/helpers/users_helper_test.rb delete mode 100644 test/models/alert_test.rb delete mode 100644 test/models/game_attribute_test.rb delete mode 100644 test/models/game_test.rb delete mode 100644 test/models/match_test.rb delete mode 100644 test/models/pm_test.rb delete mode 100644 test/models/server_settings_test.rb delete mode 100644 test/models/server_test.rb delete mode 100644 test/models/team_match_pair_test.rb delete mode 100644 test/models/team_test.rb delete mode 100644 test/models/tournament_option_test.rb delete mode 100644 test/models/tournament_test.rb delete mode 100644 test/models/user_team_pair_test.rb delete mode 100644 test/models/user_test.rb diff --git a/Gemfile b/Gemfile index f4e5b09..cc95938 100644 --- a/Gemfile +++ b/Gemfile @@ -5,8 +5,21 @@ gem 'rails', '4.0.2' gem 'bootstrap-sass' +# bcrypt is used for password digesting +gem 'bcrypt-ruby', '3.1.2' + +group :development, :test do + # Use sqlite3 as the database for Active Record -gem 'sqlite3' + gem 'sqlite3' + gem 'rspec-rails', '2.13.1' +end + +group :test do + gem 'selenium-webdriver', '2.35.1' + gem 'capybara', '2.1.0' +end + # Use SCSS for stylesheets gem 'sass-rails', '~> 4.0.0' @@ -34,6 +47,7 @@ group :doc do gem 'sdoc', require: false end + # Use ActiveModel has_secure_password # gem 'bcrypt-ruby', '~> 3.1.2' diff --git a/Gemfile.lock b/Gemfile.lock index 75d27b8..b47c41e 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -27,9 +27,18 @@ GEM tzinfo (~> 0.3.37) arel (4.0.2) atomic (1.1.14) + bcrypt-ruby (3.1.2) bootstrap-sass (3.1.1.0) sass (~> 3.2) builder (3.1.4) + capybara (2.1.0) + mime-types (>= 1.16) + nokogiri (>= 1.3.3) + rack (>= 1.0.0) + rack-test (>= 0.5.4) + xpath (~> 2.0) + childprocess (0.5.1) + ffi (~> 1.0, >= 1.0.11) coffee-rails (4.0.1) coffee-script (>= 2.2.0) railties (>= 4.0.0, < 5.0) @@ -37,8 +46,10 @@ GEM coffee-script-source execjs coffee-script-source (1.7.0) + diff-lcs (1.2.5) erubis (2.7.0) execjs (2.0.2) + ffi (1.9.3) hike (1.2.3) i18n (0.6.9) jbuilder (1.5.3) @@ -53,8 +64,11 @@ GEM mime-types (~> 1.16) treetop (~> 1.4.8) mime-types (1.25.1) + mini_portile (0.5.2) minitest (4.7.5) multi_json (1.8.4) + nokogiri (1.6.1) + mini_portile (~> 0.5.0) polyglot (0.3.4) rack (1.5.2) rack-test (0.6.2) @@ -76,6 +90,18 @@ GEM rdoc (4.1.1) json (~> 1.4) ref (1.0.5) + rspec-core (2.13.1) + rspec-expectations (2.13.0) + diff-lcs (>= 1.1.3, < 2.0) + rspec-mocks (2.13.1) + rspec-rails (2.13.1) + actionpack (>= 3.0) + activesupport (>= 3.0) + railties (>= 3.0) + rspec-core (~> 2.13.0) + rspec-expectations (~> 2.13.0) + rspec-mocks (~> 2.13.0) + rubyzip (0.9.9) sass (3.2.14) sass-rails (4.0.1) railties (>= 4.0.0, < 5.0) @@ -84,6 +110,11 @@ GEM sdoc (0.4.0) json (~> 1.8) rdoc (~> 4.0, < 5.0) + selenium-webdriver (2.35.1) + childprocess (>= 0.2.5) + multi_json (~> 1.0) + rubyzip (< 1.0.0) + websocket (~> 1.0.4) sprockets (2.10.1) hike (~> 1.2) multi_json (~> 1.0) @@ -110,18 +141,25 @@ GEM uglifier (2.4.0) execjs (>= 0.3.0) json (>= 1.8.0) + websocket (1.0.7) + xpath (2.0.0) + nokogiri (~> 1.3) PLATFORMS ruby DEPENDENCIES + bcrypt-ruby (= 3.1.2) bootstrap-sass + capybara (= 2.1.0) coffee-rails (~> 4.0.0) jbuilder (~> 1.2) jquery-rails rails (= 4.0.2) + rspec-rails (= 2.13.1) sass-rails (~> 4.0.0) sdoc + selenium-webdriver (= 2.35.1) sqlite3 therubyracer turbolinks diff --git a/db/migrate/20140304015527_create_servers.rb b/db/migrate/20140304015527_create_servers.rb deleted file mode 100644 index f33241a..0000000 --- a/db/migrate/20140304015527_create_servers.rb +++ /dev/null @@ -1,8 +0,0 @@ -class CreateServers < ActiveRecord::Migration - def change - create_table :servers do |t| - - t.timestamps - end - end -end diff --git a/db/migrate/20140304015530_create_tournaments.rb b/db/migrate/20140304015530_create_tournaments.rb deleted file mode 100644 index 36fcf7e..0000000 --- a/db/migrate/20140304015530_create_tournaments.rb +++ /dev/null @@ -1,9 +0,0 @@ -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/20140304015532_create_matches.rb b/db/migrate/20140304015532_create_matches.rb deleted file mode 100644 index 6c0c157..0000000 --- a/db/migrate/20140304015532_create_matches.rb +++ /dev/null @@ -1,9 +0,0 @@ -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/20140304015534_create_teams.rb b/db/migrate/20140304015534_create_teams.rb deleted file mode 100644 index dd8397d..0000000 --- a/db/migrate/20140304015534_create_teams.rb +++ /dev/null @@ -1,8 +0,0 @@ -class CreateTeams < ActiveRecord::Migration - def change - create_table :teams do |t| - - t.timestamps - end - end -end diff --git a/db/migrate/20140304015538_create_users.rb b/db/migrate/20140304015538_create_users.rb deleted file mode 100644 index f0986d4..0000000 --- a/db/migrate/20140304015538_create_users.rb +++ /dev/null @@ -1,11 +0,0 @@ -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/20140304015540_create_user_team_pairs.rb b/db/migrate/20140304015540_create_user_team_pairs.rb deleted file mode 100644 index 2c492ac..0000000 --- a/db/migrate/20140304015540_create_user_team_pairs.rb +++ /dev/null @@ -1,10 +0,0 @@ -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/20140304015542_create_team_match_pairs.rb b/db/migrate/20140304015542_create_team_match_pairs.rb deleted file mode 100644 index 8fac07e..0000000 --- a/db/migrate/20140304015542_create_team_match_pairs.rb +++ /dev/null @@ -1,10 +0,0 @@ -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/20140304015544_create_alerts.rb b/db/migrate/20140304015544_create_alerts.rb deleted file mode 100644 index 68a8e10..0000000 --- a/db/migrate/20140304015544_create_alerts.rb +++ /dev/null @@ -1,10 +0,0 @@ -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/20140304015547_create_pms.rb b/db/migrate/20140304015547_create_pms.rb deleted file mode 100644 index 93bb5c6..0000000 --- a/db/migrate/20140304015547_create_pms.rb +++ /dev/null @@ -1,11 +0,0 @@ -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/20140304015549_create_games.rb b/db/migrate/20140304015549_create_games.rb deleted file mode 100644 index 59d4ef0..0000000 --- a/db/migrate/20140304015549_create_games.rb +++ /dev/null @@ -1,13 +0,0 @@ -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/20140304015551_create_game_attributes.rb b/db/migrate/20140304015551_create_game_attributes.rb deleted file mode 100644 index b63f134..0000000 --- a/db/migrate/20140304015551_create_game_attributes.rb +++ /dev/null @@ -1,11 +0,0 @@ -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/20140304015553_create_server_settings.rb b/db/migrate/20140304015553_create_server_settings.rb deleted file mode 100644 index dfdd91b..0000000 --- a/db/migrate/20140304015553_create_server_settings.rb +++ /dev/null @@ -1,8 +0,0 @@ -class CreateServerSettings < ActiveRecord::Migration - def change - create_table :server_settings do |t| - - t.timestamps - end - end -end diff --git a/db/migrate/20140304015559_create_tournament_options.rb b/db/migrate/20140304015559_create_tournament_options.rb deleted file mode 100644 index d2df22e..0000000 --- a/db/migrate/20140304015559_create_tournament_options.rb +++ /dev/null @@ -1,8 +0,0 @@ -class CreateTournamentOptions < ActiveRecord::Migration - def change - create_table :tournament_options do |t| - - t.timestamps - end - end -end diff --git a/db/migrate/20140304015610_create_servers.rb b/db/migrate/20140304015610_create_servers.rb new file mode 100644 index 0000000..f33241a --- /dev/null +++ b/db/migrate/20140304015610_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/20140304015612_create_tournaments.rb b/db/migrate/20140304015612_create_tournaments.rb new file mode 100644 index 0000000..36fcf7e --- /dev/null +++ b/db/migrate/20140304015612_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/20140304015615_create_matches.rb b/db/migrate/20140304015615_create_matches.rb new file mode 100644 index 0000000..6c0c157 --- /dev/null +++ b/db/migrate/20140304015615_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/20140304015617_create_teams.rb b/db/migrate/20140304015617_create_teams.rb new file mode 100644 index 0000000..dd8397d --- /dev/null +++ b/db/migrate/20140304015617_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/20140304015622_create_users.rb b/db/migrate/20140304015622_create_users.rb new file mode 100644 index 0000000..f0986d4 --- /dev/null +++ b/db/migrate/20140304015622_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/20140304015624_create_user_team_pairs.rb b/db/migrate/20140304015624_create_user_team_pairs.rb new file mode 100644 index 0000000..2c492ac --- /dev/null +++ b/db/migrate/20140304015624_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/20140304015626_create_team_match_pairs.rb b/db/migrate/20140304015626_create_team_match_pairs.rb new file mode 100644 index 0000000..8fac07e --- /dev/null +++ b/db/migrate/20140304015626_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/20140304015628_create_alerts.rb b/db/migrate/20140304015628_create_alerts.rb new file mode 100644 index 0000000..68a8e10 --- /dev/null +++ b/db/migrate/20140304015628_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/20140304015631_create_pms.rb b/db/migrate/20140304015631_create_pms.rb new file mode 100644 index 0000000..93bb5c6 --- /dev/null +++ b/db/migrate/20140304015631_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/20140304015633_create_games.rb b/db/migrate/20140304015633_create_games.rb new file mode 100644 index 0000000..59d4ef0 --- /dev/null +++ b/db/migrate/20140304015633_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/20140304015635_create_game_attributes.rb b/db/migrate/20140304015635_create_game_attributes.rb new file mode 100644 index 0000000..b63f134 --- /dev/null +++ b/db/migrate/20140304015635_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/20140304015638_create_server_settings.rb b/db/migrate/20140304015638_create_server_settings.rb new file mode 100644 index 0000000..dfdd91b --- /dev/null +++ b/db/migrate/20140304015638_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/20140304015644_create_tournament_options.rb b/db/migrate/20140304015644_create_tournament_options.rb new file mode 100644 index 0000000..d2df22e --- /dev/null +++ b/db/migrate/20140304015644_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 index 7d4d50e..d44352e 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 20140304015559) do +ActiveRecord::Schema.define(version: 20140304015644) do create_table "alerts", force: true do |t| t.integer "author_id" 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/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/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 diff --git a/test/controllers/alerts_controller_test.rb b/test/controllers/alerts_controller_test.rb deleted file mode 100644 index 4a5d911..0000000 --- a/test/controllers/alerts_controller_test.rb +++ /dev/null @@ -1,49 +0,0 @@ -require 'test_helper' - -class AlertsControllerTest < ActionController::TestCase - setup do - @alert = alerts(:one) - end - - test "should get index" do - get :index - assert_response :success - assert_not_nil assigns(:alerts) - end - - test "should get new" do - get :new - assert_response :success - end - - test "should create alert" do - assert_difference('Alert.count') do - post :create, alert: { author_id: @alert.author_id, message: @alert.message } - end - - assert_redirected_to alert_path(assigns(:alert)) - end - - test "should show alert" do - get :show, id: @alert - assert_response :success - end - - test "should get edit" do - get :edit, id: @alert - assert_response :success - end - - test "should update alert" do - patch :update, id: @alert, alert: { author_id: @alert.author_id, message: @alert.message } - assert_redirected_to alert_path(assigns(:alert)) - end - - test "should destroy alert" do - assert_difference('Alert.count', -1) do - delete :destroy, id: @alert - end - - assert_redirected_to alerts_path - end -end diff --git a/test/controllers/games_controller_test.rb b/test/controllers/games_controller_test.rb deleted file mode 100644 index 95c3145..0000000 --- a/test/controllers/games_controller_test.rb +++ /dev/null @@ -1,49 +0,0 @@ -require 'test_helper' - -class GamesControllerTest < ActionController::TestCase - setup do - @game = games(:one) - end - - test "should get index" do - get :index - assert_response :success - assert_not_nil assigns(:games) - end - - test "should get new" do - get :new - assert_response :success - end - - test "should create game" do - assert_difference('Game.count') do - post :create, game: { name: @game.name, players_per_team: @game.players_per_team, randomized_teams: @game.randomized_teams, set_rounds: @game.set_rounds, teams_per_match: @game.teams_per_match } - end - - assert_redirected_to game_path(assigns(:game)) - end - - test "should show game" do - get :show, id: @game - assert_response :success - end - - test "should get edit" do - get :edit, id: @game - assert_response :success - end - - test "should update game" do - patch :update, id: @game, game: { name: @game.name, players_per_team: @game.players_per_team, randomized_teams: @game.randomized_teams, set_rounds: @game.set_rounds, teams_per_match: @game.teams_per_match } - assert_redirected_to game_path(assigns(:game)) - end - - test "should destroy game" do - assert_difference('Game.count', -1) do - delete :destroy, id: @game - end - - assert_redirected_to games_path - end -end diff --git a/test/controllers/main_controller_test.rb b/test/controllers/main_controller_test.rb deleted file mode 100644 index b7ec6bf..0000000 --- a/test/controllers/main_controller_test.rb +++ /dev/null @@ -1,7 +0,0 @@ -require 'test_helper' - -class MainControllerTest < ActionController::TestCase - # test "the truth" do - # assert true - # end -end diff --git a/test/controllers/matches_controller_test.rb b/test/controllers/matches_controller_test.rb deleted file mode 100644 index 75c9dcf..0000000 --- a/test/controllers/matches_controller_test.rb +++ /dev/null @@ -1,49 +0,0 @@ -require 'test_helper' - -class MatchesControllerTest < ActionController::TestCase - setup do - @match = matches(:one) - end - - test "should get index" do - get :index - assert_response :success - assert_not_nil assigns(:matches) - end - - test "should get new" do - get :new - assert_response :success - end - - test "should create match" do - assert_difference('Match.count') do - post :create, match: { tournament_id: @match.tournament_id } - end - - assert_redirected_to match_path(assigns(:match)) - end - - test "should show match" do - get :show, id: @match - assert_response :success - end - - test "should get edit" do - get :edit, id: @match - assert_response :success - end - - test "should update match" do - patch :update, id: @match, match: { tournament_id: @match.tournament_id } - assert_redirected_to match_path(assigns(:match)) - end - - test "should destroy match" do - assert_difference('Match.count', -1) do - delete :destroy, id: @match - end - - assert_redirected_to matches_path - end -end diff --git a/test/controllers/pms_controller_test.rb b/test/controllers/pms_controller_test.rb deleted file mode 100644 index 18b2449..0000000 --- a/test/controllers/pms_controller_test.rb +++ /dev/null @@ -1,49 +0,0 @@ -require 'test_helper' - -class PmsControllerTest < ActionController::TestCase - setup do - @pm = pms(:one) - end - - test "should get index" do - get :index - assert_response :success - assert_not_nil assigns(:pms) - end - - test "should get new" do - get :new - assert_response :success - end - - test "should create pm" do - assert_difference('Pm.count') do - post :create, pm: { author_id: @pm.author_id, message: @pm.message, recipient_id: @pm.recipient_id } - end - - assert_redirected_to pm_path(assigns(:pm)) - end - - test "should show pm" do - get :show, id: @pm - assert_response :success - end - - test "should get edit" do - get :edit, id: @pm - assert_response :success - end - - test "should update pm" do - patch :update, id: @pm, pm: { author_id: @pm.author_id, message: @pm.message, recipient_id: @pm.recipient_id } - assert_redirected_to pm_path(assigns(:pm)) - end - - test "should destroy pm" do - assert_difference('Pm.count', -1) do - delete :destroy, id: @pm - end - - assert_redirected_to pms_path - end -end diff --git a/test/controllers/search_controller_test.rb b/test/controllers/search_controller_test.rb deleted file mode 100644 index bfbf22d..0000000 --- a/test/controllers/search_controller_test.rb +++ /dev/null @@ -1,7 +0,0 @@ -require 'test_helper' - -class SearchControllerTest < ActionController::TestCase - # test "the truth" do - # assert true - # end -end diff --git a/test/controllers/servers_controller_test.rb b/test/controllers/servers_controller_test.rb deleted file mode 100644 index 5891bb0..0000000 --- a/test/controllers/servers_controller_test.rb +++ /dev/null @@ -1,49 +0,0 @@ -require 'test_helper' - -class ServersControllerTest < ActionController::TestCase - setup do - @server = servers(:one) - end - - test "should get index" do - get :index - assert_response :success - assert_not_nil assigns(:servers) - end - - test "should get new" do - get :new - assert_response :success - end - - test "should create server" do - assert_difference('Server.count') do - post :create, server: { } - end - - assert_redirected_to server_path(assigns(:server)) - end - - test "should show server" do - get :show, id: @server - assert_response :success - end - - test "should get edit" do - get :edit, id: @server - assert_response :success - end - - test "should update server" do - patch :update, id: @server, server: { } - assert_redirected_to server_path(assigns(:server)) - end - - test "should destroy server" do - assert_difference('Server.count', -1) do - delete :destroy, id: @server - end - - assert_redirected_to servers_path - end -end diff --git a/test/controllers/teams_controller_test.rb b/test/controllers/teams_controller_test.rb deleted file mode 100644 index 8bf60be..0000000 --- a/test/controllers/teams_controller_test.rb +++ /dev/null @@ -1,49 +0,0 @@ -require 'test_helper' - -class TeamsControllerTest < ActionController::TestCase - setup do - @team = teams(:one) - end - - test "should get index" do - get :index - assert_response :success - assert_not_nil assigns(:teams) - end - - test "should get new" do - get :new - assert_response :success - end - - test "should create team" do - assert_difference('Team.count') do - post :create, team: { } - end - - assert_redirected_to team_path(assigns(:team)) - end - - test "should show team" do - get :show, id: @team - assert_response :success - end - - test "should get edit" do - get :edit, id: @team - assert_response :success - end - - test "should update team" do - patch :update, id: @team, team: { } - assert_redirected_to team_path(assigns(:team)) - end - - test "should destroy team" do - assert_difference('Team.count', -1) do - delete :destroy, id: @team - end - - assert_redirected_to teams_path - end -end diff --git a/test/controllers/tournaments_controller_test.rb b/test/controllers/tournaments_controller_test.rb deleted file mode 100644 index bdbbfac..0000000 --- a/test/controllers/tournaments_controller_test.rb +++ /dev/null @@ -1,49 +0,0 @@ -require 'test_helper' - -class TournamentsControllerTest < ActionController::TestCase - setup do - @tournament = tournaments(:one) - end - - test "should get index" do - get :index - assert_response :success - assert_not_nil assigns(:tournaments) - end - - test "should get new" do - get :new - assert_response :success - end - - test "should create tournament" do - assert_difference('Tournament.count') do - post :create, tournament: { game_id: @tournament.game_id } - end - - assert_redirected_to tournament_path(assigns(:tournament)) - end - - test "should show tournament" do - get :show, id: @tournament - assert_response :success - end - - test "should get edit" do - get :edit, id: @tournament - assert_response :success - end - - test "should update tournament" do - patch :update, id: @tournament, tournament: { game_id: @tournament.game_id } - assert_redirected_to tournament_path(assigns(:tournament)) - end - - test "should destroy tournament" do - assert_difference('Tournament.count', -1) do - delete :destroy, id: @tournament - end - - assert_redirected_to tournaments_path - end -end diff --git a/test/controllers/users_controller_test.rb b/test/controllers/users_controller_test.rb deleted file mode 100644 index d23f182..0000000 --- a/test/controllers/users_controller_test.rb +++ /dev/null @@ -1,7 +0,0 @@ -require 'test_helper' - -class UsersControllerTest < ActionController::TestCase - # test "the truth" do - # assert true - # end -end diff --git a/test/fixtures/alerts.yml b/test/fixtures/alerts.yml deleted file mode 100644 index 52959af..0000000 --- a/test/fixtures/alerts.yml +++ /dev/null @@ -1,9 +0,0 @@ -# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html - -one: - author_id: - message: MyText - -two: - author_id: - message: MyText diff --git a/test/fixtures/game_attributes.yml b/test/fixtures/game_attributes.yml deleted file mode 100644 index eff7212..0000000 --- a/test/fixtures/game_attributes.yml +++ /dev/null @@ -1,11 +0,0 @@ -# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html - -one: - game_id: - key: MyText - type: 1 - -two: - game_id: - key: MyText - type: 1 diff --git a/test/fixtures/games.yml b/test/fixtures/games.yml deleted file mode 100644 index 3068527..0000000 --- a/test/fixtures/games.yml +++ /dev/null @@ -1,15 +0,0 @@ -# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html - -one: - name: MyText - players_per_team: 1 - teams_per_match: 1 - set_rounds: 1 - randomized_teams: 1 - -two: - name: MyText - players_per_team: 1 - teams_per_match: 1 - set_rounds: 1 - randomized_teams: 1 diff --git a/test/fixtures/matches.yml b/test/fixtures/matches.yml deleted file mode 100644 index 0356cee..0000000 --- a/test/fixtures/matches.yml +++ /dev/null @@ -1,7 +0,0 @@ -# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html - -one: - tournament_id: - -two: - tournament_id: diff --git a/test/fixtures/pms.yml b/test/fixtures/pms.yml deleted file mode 100644 index f77e727..0000000 --- a/test/fixtures/pms.yml +++ /dev/null @@ -1,11 +0,0 @@ -# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html - -one: - author_id: - recipient_id: - message: MyText - -two: - author_id: - recipient_id: - message: MyText diff --git a/test/fixtures/server_settings.yml b/test/fixtures/server_settings.yml deleted file mode 100644 index 937a0c0..0000000 --- a/test/fixtures/server_settings.yml +++ /dev/null @@ -1,11 +0,0 @@ -# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html - -# This model initially had no columns defined. If you add columns to the -# model remove the '{}' from the fixture names and add the columns immediately -# below each fixture, per the syntax in the comments below -# -one: {} -# column: value -# -two: {} -# column: value diff --git a/test/fixtures/servers.yml b/test/fixtures/servers.yml deleted file mode 100644 index 937a0c0..0000000 --- a/test/fixtures/servers.yml +++ /dev/null @@ -1,11 +0,0 @@ -# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html - -# This model initially had no columns defined. If you add columns to the -# model remove the '{}' from the fixture names and add the columns immediately -# below each fixture, per the syntax in the comments below -# -one: {} -# column: value -# -two: {} -# column: value diff --git a/test/fixtures/team_match_pairs.yml b/test/fixtures/team_match_pairs.yml deleted file mode 100644 index 5f9cf2f..0000000 --- a/test/fixtures/team_match_pairs.yml +++ /dev/null @@ -1,9 +0,0 @@ -# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html - -one: - team_id: - match_id: - -two: - team_id: - match_id: diff --git a/test/fixtures/teams.yml b/test/fixtures/teams.yml deleted file mode 100644 index 937a0c0..0000000 --- a/test/fixtures/teams.yml +++ /dev/null @@ -1,11 +0,0 @@ -# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html - -# This model initially had no columns defined. If you add columns to the -# model remove the '{}' from the fixture names and add the columns immediately -# below each fixture, per the syntax in the comments below -# -one: {} -# column: value -# -two: {} -# column: value diff --git a/test/fixtures/tournament_options.yml b/test/fixtures/tournament_options.yml deleted file mode 100644 index 937a0c0..0000000 --- a/test/fixtures/tournament_options.yml +++ /dev/null @@ -1,11 +0,0 @@ -# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html - -# This model initially had no columns defined. If you add columns to the -# model remove the '{}' from the fixture names and add the columns immediately -# below each fixture, per the syntax in the comments below -# -one: {} -# column: value -# -two: {} -# column: value diff --git a/test/fixtures/tournaments.yml b/test/fixtures/tournaments.yml deleted file mode 100644 index 4cba7ca..0000000 --- a/test/fixtures/tournaments.yml +++ /dev/null @@ -1,7 +0,0 @@ -# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html - -one: - game_id: - -two: - game_id: diff --git a/test/fixtures/user_team_pairs.yml b/test/fixtures/user_team_pairs.yml deleted file mode 100644 index a76036f..0000000 --- a/test/fixtures/user_team_pairs.yml +++ /dev/null @@ -1,9 +0,0 @@ -# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html - -one: - user_id: - team_id: - -two: - user_id: - team_id: diff --git a/test/fixtures/users.yml b/test/fixtures/users.yml deleted file mode 100644 index ea3e874..0000000 --- a/test/fixtures/users.yml +++ /dev/null @@ -1,11 +0,0 @@ -# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html - -one: - name: MyString - email: MyString - user_name: MyString - -two: - name: MyString - email: MyString - user_name: MyString diff --git a/test/helpers/alerts_helper_test.rb b/test/helpers/alerts_helper_test.rb deleted file mode 100644 index 1d9079d..0000000 --- a/test/helpers/alerts_helper_test.rb +++ /dev/null @@ -1,4 +0,0 @@ -require 'test_helper' - -class AlertsHelperTest < ActionView::TestCase -end diff --git a/test/helpers/games_helper_test.rb b/test/helpers/games_helper_test.rb deleted file mode 100644 index 449a85c..0000000 --- a/test/helpers/games_helper_test.rb +++ /dev/null @@ -1,4 +0,0 @@ -require 'test_helper' - -class GamesHelperTest < ActionView::TestCase -end diff --git a/test/helpers/main_helper_test.rb b/test/helpers/main_helper_test.rb deleted file mode 100644 index 22da3c4..0000000 --- a/test/helpers/main_helper_test.rb +++ /dev/null @@ -1,4 +0,0 @@ -require 'test_helper' - -class MainHelperTest < ActionView::TestCase -end diff --git a/test/helpers/matches_helper_test.rb b/test/helpers/matches_helper_test.rb deleted file mode 100644 index 4cc472f..0000000 --- a/test/helpers/matches_helper_test.rb +++ /dev/null @@ -1,4 +0,0 @@ -require 'test_helper' - -class MatchesHelperTest < ActionView::TestCase -end diff --git a/test/helpers/pms_helper_test.rb b/test/helpers/pms_helper_test.rb deleted file mode 100644 index af80f10..0000000 --- a/test/helpers/pms_helper_test.rb +++ /dev/null @@ -1,4 +0,0 @@ -require 'test_helper' - -class PmsHelperTest < ActionView::TestCase -end diff --git a/test/helpers/search_helper_test.rb b/test/helpers/search_helper_test.rb deleted file mode 100644 index 3034163..0000000 --- a/test/helpers/search_helper_test.rb +++ /dev/null @@ -1,4 +0,0 @@ -require 'test_helper' - -class SearchHelperTest < ActionView::TestCase -end diff --git a/test/helpers/servers_helper_test.rb b/test/helpers/servers_helper_test.rb deleted file mode 100644 index 8fddf34..0000000 --- a/test/helpers/servers_helper_test.rb +++ /dev/null @@ -1,4 +0,0 @@ -require 'test_helper' - -class ServersHelperTest < ActionView::TestCase -end diff --git a/test/helpers/teams_helper_test.rb b/test/helpers/teams_helper_test.rb deleted file mode 100644 index b736483..0000000 --- a/test/helpers/teams_helper_test.rb +++ /dev/null @@ -1,4 +0,0 @@ -require 'test_helper' - -class TeamsHelperTest < ActionView::TestCase -end diff --git a/test/helpers/tournaments_helper_test.rb b/test/helpers/tournaments_helper_test.rb deleted file mode 100644 index 1cf5269..0000000 --- a/test/helpers/tournaments_helper_test.rb +++ /dev/null @@ -1,4 +0,0 @@ -require 'test_helper' - -class TournamentsHelperTest < ActionView::TestCase -end diff --git a/test/helpers/users_helper_test.rb b/test/helpers/users_helper_test.rb deleted file mode 100644 index 96af37a..0000000 --- a/test/helpers/users_helper_test.rb +++ /dev/null @@ -1,4 +0,0 @@ -require 'test_helper' - -class UsersHelperTest < ActionView::TestCase -end diff --git a/test/models/alert_test.rb b/test/models/alert_test.rb deleted file mode 100644 index b59c65e..0000000 --- a/test/models/alert_test.rb +++ /dev/null @@ -1,7 +0,0 @@ -require 'test_helper' - -class AlertTest < ActiveSupport::TestCase - # test "the truth" do - # assert true - # end -end diff --git a/test/models/game_attribute_test.rb b/test/models/game_attribute_test.rb deleted file mode 100644 index 13c6e65..0000000 --- a/test/models/game_attribute_test.rb +++ /dev/null @@ -1,7 +0,0 @@ -require 'test_helper' - -class GameAttributeTest < ActiveSupport::TestCase - # test "the truth" do - # assert true - # end -end diff --git a/test/models/game_test.rb b/test/models/game_test.rb deleted file mode 100644 index 2cab36e..0000000 --- a/test/models/game_test.rb +++ /dev/null @@ -1,7 +0,0 @@ -require 'test_helper' - -class GameTest < ActiveSupport::TestCase - # test "the truth" do - # assert true - # end -end diff --git a/test/models/match_test.rb b/test/models/match_test.rb deleted file mode 100644 index 14436b1..0000000 --- a/test/models/match_test.rb +++ /dev/null @@ -1,7 +0,0 @@ -require 'test_helper' - -class MatchTest < ActiveSupport::TestCase - # test "the truth" do - # assert true - # end -end diff --git a/test/models/pm_test.rb b/test/models/pm_test.rb deleted file mode 100644 index e7f6b8f..0000000 --- a/test/models/pm_test.rb +++ /dev/null @@ -1,7 +0,0 @@ -require 'test_helper' - -class PmTest < ActiveSupport::TestCase - # test "the truth" do - # assert true - # end -end diff --git a/test/models/server_settings_test.rb b/test/models/server_settings_test.rb deleted file mode 100644 index 470b316..0000000 --- a/test/models/server_settings_test.rb +++ /dev/null @@ -1,7 +0,0 @@ -require 'test_helper' - -class ServerSettingsTest < ActiveSupport::TestCase - # test "the truth" do - # assert true - # end -end diff --git a/test/models/server_test.rb b/test/models/server_test.rb deleted file mode 100644 index 125ffc9..0000000 --- a/test/models/server_test.rb +++ /dev/null @@ -1,7 +0,0 @@ -require 'test_helper' - -class ServerTest < ActiveSupport::TestCase - # test "the truth" do - # assert true - # end -end diff --git a/test/models/team_match_pair_test.rb b/test/models/team_match_pair_test.rb deleted file mode 100644 index c250b3c..0000000 --- a/test/models/team_match_pair_test.rb +++ /dev/null @@ -1,7 +0,0 @@ -require 'test_helper' - -class TeamMatchPairTest < ActiveSupport::TestCase - # test "the truth" do - # assert true - # end -end diff --git a/test/models/team_test.rb b/test/models/team_test.rb deleted file mode 100644 index 8b101cb..0000000 --- a/test/models/team_test.rb +++ /dev/null @@ -1,7 +0,0 @@ -require 'test_helper' - -class TeamTest < ActiveSupport::TestCase - # test "the truth" do - # assert true - # end -end diff --git a/test/models/tournament_option_test.rb b/test/models/tournament_option_test.rb deleted file mode 100644 index 8fa9628..0000000 --- a/test/models/tournament_option_test.rb +++ /dev/null @@ -1,7 +0,0 @@ -require 'test_helper' - -class TournamentOptionTest < ActiveSupport::TestCase - # test "the truth" do - # assert true - # end -end diff --git a/test/models/tournament_test.rb b/test/models/tournament_test.rb deleted file mode 100644 index 24a7e5f..0000000 --- a/test/models/tournament_test.rb +++ /dev/null @@ -1,7 +0,0 @@ -require 'test_helper' - -class TournamentTest < ActiveSupport::TestCase - # test "the truth" do - # assert true - # end -end diff --git a/test/models/user_team_pair_test.rb b/test/models/user_team_pair_test.rb deleted file mode 100644 index 55f5c58..0000000 --- a/test/models/user_team_pair_test.rb +++ /dev/null @@ -1,7 +0,0 @@ -require 'test_helper' - -class UserTeamPairTest < ActiveSupport::TestCase - # test "the truth" do - # assert true - # end -end diff --git a/test/models/user_test.rb b/test/models/user_test.rb deleted file mode 100644 index 82f61e0..0000000 --- a/test/models/user_test.rb +++ /dev/null @@ -1,7 +0,0 @@ -require 'test_helper' - -class UserTest < ActiveSupport::TestCase - # test "the truth" do - # assert true - # end -end -- cgit v1.1-4-g5e80 From 4dcb9de406dd032ecb37109402c4475d96d2a05a Mon Sep 17 00:00:00 2001 From: Tomer Kimia Date: Sat, 1 Mar 2014 22:53:08 -0500 Subject: quick and dirty css --- Gemfile | 2 +- db/migrate/20140304015610_create_servers.rb | 8 -------- db/migrate/20140304015612_create_tournaments.rb | 9 --------- db/migrate/20140304015615_create_matches.rb | 9 --------- db/migrate/20140304015617_create_teams.rb | 8 -------- db/migrate/20140304015622_create_users.rb | 11 ----------- db/migrate/20140304015624_create_user_team_pairs.rb | 10 ---------- db/migrate/20140304015626_create_team_match_pairs.rb | 10 ---------- db/migrate/20140304015628_create_alerts.rb | 10 ---------- db/migrate/20140304015631_create_pms.rb | 11 ----------- db/migrate/20140304015633_create_games.rb | 13 ------------- db/migrate/20140304015635_create_game_attributes.rb | 11 ----------- db/migrate/20140304015638_create_server_settings.rb | 8 -------- db/migrate/20140304015644_create_tournament_options.rb | 8 -------- db/migrate/20140304015739_create_servers.rb | 8 ++++++++ db/migrate/20140304015742_create_tournaments.rb | 9 +++++++++ db/migrate/20140304015744_create_matches.rb | 9 +++++++++ db/migrate/20140304015746_create_teams.rb | 8 ++++++++ db/migrate/20140304015751_create_users.rb | 11 +++++++++++ db/migrate/20140304015753_create_user_team_pairs.rb | 10 ++++++++++ db/migrate/20140304015755_create_team_match_pairs.rb | 10 ++++++++++ db/migrate/20140304015757_create_alerts.rb | 10 ++++++++++ db/migrate/20140304015800_create_pms.rb | 11 +++++++++++ db/migrate/20140304015802_create_games.rb | 13 +++++++++++++ db/migrate/20140304015804_create_game_attributes.rb | 11 +++++++++++ db/migrate/20140304015807_create_server_settings.rb | 8 ++++++++ db/migrate/20140304015813_create_tournament_options.rb | 8 ++++++++ db/schema.rb | 2 +- 28 files changed, 128 insertions(+), 128 deletions(-) delete mode 100644 db/migrate/20140304015610_create_servers.rb delete mode 100644 db/migrate/20140304015612_create_tournaments.rb delete mode 100644 db/migrate/20140304015615_create_matches.rb delete mode 100644 db/migrate/20140304015617_create_teams.rb delete mode 100644 db/migrate/20140304015622_create_users.rb delete mode 100644 db/migrate/20140304015624_create_user_team_pairs.rb delete mode 100644 db/migrate/20140304015626_create_team_match_pairs.rb delete mode 100644 db/migrate/20140304015628_create_alerts.rb delete mode 100644 db/migrate/20140304015631_create_pms.rb delete mode 100644 db/migrate/20140304015633_create_games.rb delete mode 100644 db/migrate/20140304015635_create_game_attributes.rb delete mode 100644 db/migrate/20140304015638_create_server_settings.rb delete mode 100644 db/migrate/20140304015644_create_tournament_options.rb create mode 100644 db/migrate/20140304015739_create_servers.rb create mode 100644 db/migrate/20140304015742_create_tournaments.rb create mode 100644 db/migrate/20140304015744_create_matches.rb create mode 100644 db/migrate/20140304015746_create_teams.rb create mode 100644 db/migrate/20140304015751_create_users.rb create mode 100644 db/migrate/20140304015753_create_user_team_pairs.rb create mode 100644 db/migrate/20140304015755_create_team_match_pairs.rb create mode 100644 db/migrate/20140304015757_create_alerts.rb create mode 100644 db/migrate/20140304015800_create_pms.rb create mode 100644 db/migrate/20140304015802_create_games.rb create mode 100644 db/migrate/20140304015804_create_game_attributes.rb create mode 100644 db/migrate/20140304015807_create_server_settings.rb create mode 100644 db/migrate/20140304015813_create_tournament_options.rb diff --git a/Gemfile b/Gemfile index cc95938..cb3d6f6 100644 --- a/Gemfile +++ b/Gemfile @@ -3,7 +3,6 @@ source 'https://rubygems.org' # Bundle edge Rails instead: gem 'rails', github: 'rails/rails' gem 'rails', '4.0.2' -gem 'bootstrap-sass' # bcrypt is used for password digesting gem 'bcrypt-ruby', '3.1.2' @@ -23,6 +22,7 @@ end # Use SCSS for stylesheets gem 'sass-rails', '~> 4.0.0' +gem 'bootstrap-sass' # Use Uglifier as compressor for JavaScript assets gem 'uglifier', '>= 1.3.0' diff --git a/db/migrate/20140304015610_create_servers.rb b/db/migrate/20140304015610_create_servers.rb deleted file mode 100644 index f33241a..0000000 --- a/db/migrate/20140304015610_create_servers.rb +++ /dev/null @@ -1,8 +0,0 @@ -class CreateServers < ActiveRecord::Migration - def change - create_table :servers do |t| - - t.timestamps - end - end -end diff --git a/db/migrate/20140304015612_create_tournaments.rb b/db/migrate/20140304015612_create_tournaments.rb deleted file mode 100644 index 36fcf7e..0000000 --- a/db/migrate/20140304015612_create_tournaments.rb +++ /dev/null @@ -1,9 +0,0 @@ -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/20140304015615_create_matches.rb b/db/migrate/20140304015615_create_matches.rb deleted file mode 100644 index 6c0c157..0000000 --- a/db/migrate/20140304015615_create_matches.rb +++ /dev/null @@ -1,9 +0,0 @@ -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/20140304015617_create_teams.rb b/db/migrate/20140304015617_create_teams.rb deleted file mode 100644 index dd8397d..0000000 --- a/db/migrate/20140304015617_create_teams.rb +++ /dev/null @@ -1,8 +0,0 @@ -class CreateTeams < ActiveRecord::Migration - def change - create_table :teams do |t| - - t.timestamps - end - end -end diff --git a/db/migrate/20140304015622_create_users.rb b/db/migrate/20140304015622_create_users.rb deleted file mode 100644 index f0986d4..0000000 --- a/db/migrate/20140304015622_create_users.rb +++ /dev/null @@ -1,11 +0,0 @@ -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/20140304015624_create_user_team_pairs.rb b/db/migrate/20140304015624_create_user_team_pairs.rb deleted file mode 100644 index 2c492ac..0000000 --- a/db/migrate/20140304015624_create_user_team_pairs.rb +++ /dev/null @@ -1,10 +0,0 @@ -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/20140304015626_create_team_match_pairs.rb b/db/migrate/20140304015626_create_team_match_pairs.rb deleted file mode 100644 index 8fac07e..0000000 --- a/db/migrate/20140304015626_create_team_match_pairs.rb +++ /dev/null @@ -1,10 +0,0 @@ -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/20140304015628_create_alerts.rb b/db/migrate/20140304015628_create_alerts.rb deleted file mode 100644 index 68a8e10..0000000 --- a/db/migrate/20140304015628_create_alerts.rb +++ /dev/null @@ -1,10 +0,0 @@ -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/20140304015631_create_pms.rb b/db/migrate/20140304015631_create_pms.rb deleted file mode 100644 index 93bb5c6..0000000 --- a/db/migrate/20140304015631_create_pms.rb +++ /dev/null @@ -1,11 +0,0 @@ -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/20140304015633_create_games.rb b/db/migrate/20140304015633_create_games.rb deleted file mode 100644 index 59d4ef0..0000000 --- a/db/migrate/20140304015633_create_games.rb +++ /dev/null @@ -1,13 +0,0 @@ -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/20140304015635_create_game_attributes.rb b/db/migrate/20140304015635_create_game_attributes.rb deleted file mode 100644 index b63f134..0000000 --- a/db/migrate/20140304015635_create_game_attributes.rb +++ /dev/null @@ -1,11 +0,0 @@ -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/20140304015638_create_server_settings.rb b/db/migrate/20140304015638_create_server_settings.rb deleted file mode 100644 index dfdd91b..0000000 --- a/db/migrate/20140304015638_create_server_settings.rb +++ /dev/null @@ -1,8 +0,0 @@ -class CreateServerSettings < ActiveRecord::Migration - def change - create_table :server_settings do |t| - - t.timestamps - end - end -end diff --git a/db/migrate/20140304015644_create_tournament_options.rb b/db/migrate/20140304015644_create_tournament_options.rb deleted file mode 100644 index d2df22e..0000000 --- a/db/migrate/20140304015644_create_tournament_options.rb +++ /dev/null @@ -1,8 +0,0 @@ -class CreateTournamentOptions < ActiveRecord::Migration - def change - create_table :tournament_options do |t| - - t.timestamps - end - end -end diff --git a/db/migrate/20140304015739_create_servers.rb b/db/migrate/20140304015739_create_servers.rb new file mode 100644 index 0000000..f33241a --- /dev/null +++ b/db/migrate/20140304015739_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/20140304015742_create_tournaments.rb b/db/migrate/20140304015742_create_tournaments.rb new file mode 100644 index 0000000..36fcf7e --- /dev/null +++ b/db/migrate/20140304015742_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/20140304015744_create_matches.rb b/db/migrate/20140304015744_create_matches.rb new file mode 100644 index 0000000..6c0c157 --- /dev/null +++ b/db/migrate/20140304015744_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/20140304015746_create_teams.rb b/db/migrate/20140304015746_create_teams.rb new file mode 100644 index 0000000..dd8397d --- /dev/null +++ b/db/migrate/20140304015746_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/20140304015751_create_users.rb b/db/migrate/20140304015751_create_users.rb new file mode 100644 index 0000000..f0986d4 --- /dev/null +++ b/db/migrate/20140304015751_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/20140304015753_create_user_team_pairs.rb b/db/migrate/20140304015753_create_user_team_pairs.rb new file mode 100644 index 0000000..2c492ac --- /dev/null +++ b/db/migrate/20140304015753_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/20140304015755_create_team_match_pairs.rb b/db/migrate/20140304015755_create_team_match_pairs.rb new file mode 100644 index 0000000..8fac07e --- /dev/null +++ b/db/migrate/20140304015755_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/20140304015757_create_alerts.rb b/db/migrate/20140304015757_create_alerts.rb new file mode 100644 index 0000000..68a8e10 --- /dev/null +++ b/db/migrate/20140304015757_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/20140304015800_create_pms.rb b/db/migrate/20140304015800_create_pms.rb new file mode 100644 index 0000000..93bb5c6 --- /dev/null +++ b/db/migrate/20140304015800_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/20140304015802_create_games.rb b/db/migrate/20140304015802_create_games.rb new file mode 100644 index 0000000..59d4ef0 --- /dev/null +++ b/db/migrate/20140304015802_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/20140304015804_create_game_attributes.rb b/db/migrate/20140304015804_create_game_attributes.rb new file mode 100644 index 0000000..b63f134 --- /dev/null +++ b/db/migrate/20140304015804_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/20140304015807_create_server_settings.rb b/db/migrate/20140304015807_create_server_settings.rb new file mode 100644 index 0000000..dfdd91b --- /dev/null +++ b/db/migrate/20140304015807_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/20140304015813_create_tournament_options.rb b/db/migrate/20140304015813_create_tournament_options.rb new file mode 100644 index 0000000..d2df22e --- /dev/null +++ b/db/migrate/20140304015813_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 index d44352e..ae688b1 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 20140304015644) do +ActiveRecord::Schema.define(version: 20140304015813) do create_table "alerts", force: true do |t| t.integer "author_id" -- cgit v1.1-4-g5e80 From faa08e4f2dbc6fb37619df7375638c1a7749ef80 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sat, 1 Mar 2014 23:18:45 -0500 Subject: mv docs doc --- db/migrate/20140304015610_create_servers.rb | 8 - db/migrate/20140304015612_create_tournaments.rb | 9 - db/migrate/20140304015615_create_matches.rb | 9 - db/migrate/20140304015617_create_teams.rb | 8 - db/migrate/20140304015622_create_users.rb | 11 - .../20140304015624_create_user_team_pairs.rb | 10 - .../20140304015626_create_team_match_pairs.rb | 10 - db/migrate/20140304015628_create_alerts.rb | 10 - db/migrate/20140304015631_create_pms.rb | 11 - db/migrate/20140304015633_create_games.rb | 13 - .../20140304015635_create_game_attributes.rb | 11 - .../20140304015638_create_server_settings.rb | 8 - .../20140304015644_create_tournament_options.rb | 8 - db/migrate/20140304015910_create_servers.rb | 8 + db/migrate/20140304015913_create_tournaments.rb | 9 + db/migrate/20140304015915_create_matches.rb | 9 + db/migrate/20140304015917_create_teams.rb | 8 + db/migrate/20140304015922_create_users.rb | 11 + .../20140304015924_create_user_team_pairs.rb | 10 + .../20140304015926_create_team_match_pairs.rb | 10 + db/migrate/20140304015928_create_alerts.rb | 10 + db/migrate/20140304015931_create_pms.rb | 11 + db/migrate/20140304015933_create_games.rb | 13 + .../20140304015935_create_game_attributes.rb | 11 + .../20140304015938_create_server_settings.rb | 8 + .../20140304015944_create_tournament_options.rb | 8 + db/schema.rb | 2 +- doc/.gitignore | 4 + doc/DesignDocument-architecture-model2.pptx | Bin 0 -> 63714 bytes doc/DesignDocument-classes.dot | 265 ++++++++++++ doc/DesignDocument-models.pptx | Bin 0 -> 34389 bytes doc/DesignDocument.md | 475 +++++++++++++++++++++ doc/Diagram01.jpg | Bin 0 -> 2008078 bytes doc/Makefile | 26 ++ doc/ProductBacklog.md | 89 ++++ doc/ProjectCharter.md | 26 ++ doc/ProjectLeaguerWorkloadBreakup.md | 14 + doc/Sprint1.md | 92 ++++ doc/SystemModel.dot | 60 +++ doc/stickman.png | Bin 0 -> 1308 bytes docs/.gitignore | 4 - docs/DesignDocument-architecture-model2.pptx | Bin 63714 -> 0 bytes docs/DesignDocument-classes.dot | 265 ------------ docs/DesignDocument-models.pptx | Bin 34389 -> 0 bytes docs/DesignDocument.md | 475 --------------------- docs/Diagram01.jpg | Bin 2008078 -> 0 bytes docs/Makefile | 26 -- docs/ProductBacklog.md | 89 ---- docs/ProjectCharter.md | 26 -- docs/ProjectLeaguerWorkloadBreakup.md | 14 - docs/Sprint1.md | 92 ---- docs/SystemModel.dot | 60 --- docs/stickman.png | Bin 1308 -> 0 bytes 53 files changed, 1178 insertions(+), 1178 deletions(-) delete mode 100644 db/migrate/20140304015610_create_servers.rb delete mode 100644 db/migrate/20140304015612_create_tournaments.rb delete mode 100644 db/migrate/20140304015615_create_matches.rb delete mode 100644 db/migrate/20140304015617_create_teams.rb delete mode 100644 db/migrate/20140304015622_create_users.rb delete mode 100644 db/migrate/20140304015624_create_user_team_pairs.rb delete mode 100644 db/migrate/20140304015626_create_team_match_pairs.rb delete mode 100644 db/migrate/20140304015628_create_alerts.rb delete mode 100644 db/migrate/20140304015631_create_pms.rb delete mode 100644 db/migrate/20140304015633_create_games.rb delete mode 100644 db/migrate/20140304015635_create_game_attributes.rb delete mode 100644 db/migrate/20140304015638_create_server_settings.rb delete mode 100644 db/migrate/20140304015644_create_tournament_options.rb create mode 100644 db/migrate/20140304015910_create_servers.rb create mode 100644 db/migrate/20140304015913_create_tournaments.rb create mode 100644 db/migrate/20140304015915_create_matches.rb create mode 100644 db/migrate/20140304015917_create_teams.rb create mode 100644 db/migrate/20140304015922_create_users.rb create mode 100644 db/migrate/20140304015924_create_user_team_pairs.rb create mode 100644 db/migrate/20140304015926_create_team_match_pairs.rb create mode 100644 db/migrate/20140304015928_create_alerts.rb create mode 100644 db/migrate/20140304015931_create_pms.rb create mode 100644 db/migrate/20140304015933_create_games.rb create mode 100644 db/migrate/20140304015935_create_game_attributes.rb create mode 100644 db/migrate/20140304015938_create_server_settings.rb create mode 100644 db/migrate/20140304015944_create_tournament_options.rb create mode 100644 doc/.gitignore create mode 100644 doc/DesignDocument-architecture-model2.pptx create mode 100644 doc/DesignDocument-classes.dot create mode 100644 doc/DesignDocument-models.pptx create mode 100644 doc/DesignDocument.md create mode 100644 doc/Diagram01.jpg create mode 100644 doc/Makefile create mode 100644 doc/ProductBacklog.md create mode 100644 doc/ProjectCharter.md create mode 100644 doc/ProjectLeaguerWorkloadBreakup.md create mode 100644 doc/Sprint1.md create mode 100644 doc/SystemModel.dot create mode 100644 doc/stickman.png delete mode 100644 docs/.gitignore delete mode 100644 docs/DesignDocument-architecture-model2.pptx delete mode 100644 docs/DesignDocument-classes.dot delete mode 100644 docs/DesignDocument-models.pptx delete mode 100644 docs/DesignDocument.md delete mode 100644 docs/Diagram01.jpg delete mode 100644 docs/Makefile delete mode 100644 docs/ProductBacklog.md delete mode 100644 docs/ProjectCharter.md delete mode 100644 docs/ProjectLeaguerWorkloadBreakup.md delete mode 100644 docs/Sprint1.md delete mode 100644 docs/SystemModel.dot delete mode 100644 docs/stickman.png diff --git a/db/migrate/20140304015610_create_servers.rb b/db/migrate/20140304015610_create_servers.rb deleted file mode 100644 index f33241a..0000000 --- a/db/migrate/20140304015610_create_servers.rb +++ /dev/null @@ -1,8 +0,0 @@ -class CreateServers < ActiveRecord::Migration - def change - create_table :servers do |t| - - t.timestamps - end - end -end diff --git a/db/migrate/20140304015612_create_tournaments.rb b/db/migrate/20140304015612_create_tournaments.rb deleted file mode 100644 index 36fcf7e..0000000 --- a/db/migrate/20140304015612_create_tournaments.rb +++ /dev/null @@ -1,9 +0,0 @@ -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/20140304015615_create_matches.rb b/db/migrate/20140304015615_create_matches.rb deleted file mode 100644 index 6c0c157..0000000 --- a/db/migrate/20140304015615_create_matches.rb +++ /dev/null @@ -1,9 +0,0 @@ -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/20140304015617_create_teams.rb b/db/migrate/20140304015617_create_teams.rb deleted file mode 100644 index dd8397d..0000000 --- a/db/migrate/20140304015617_create_teams.rb +++ /dev/null @@ -1,8 +0,0 @@ -class CreateTeams < ActiveRecord::Migration - def change - create_table :teams do |t| - - t.timestamps - end - end -end diff --git a/db/migrate/20140304015622_create_users.rb b/db/migrate/20140304015622_create_users.rb deleted file mode 100644 index f0986d4..0000000 --- a/db/migrate/20140304015622_create_users.rb +++ /dev/null @@ -1,11 +0,0 @@ -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/20140304015624_create_user_team_pairs.rb b/db/migrate/20140304015624_create_user_team_pairs.rb deleted file mode 100644 index 2c492ac..0000000 --- a/db/migrate/20140304015624_create_user_team_pairs.rb +++ /dev/null @@ -1,10 +0,0 @@ -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/20140304015626_create_team_match_pairs.rb b/db/migrate/20140304015626_create_team_match_pairs.rb deleted file mode 100644 index 8fac07e..0000000 --- a/db/migrate/20140304015626_create_team_match_pairs.rb +++ /dev/null @@ -1,10 +0,0 @@ -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/20140304015628_create_alerts.rb b/db/migrate/20140304015628_create_alerts.rb deleted file mode 100644 index 68a8e10..0000000 --- a/db/migrate/20140304015628_create_alerts.rb +++ /dev/null @@ -1,10 +0,0 @@ -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/20140304015631_create_pms.rb b/db/migrate/20140304015631_create_pms.rb deleted file mode 100644 index 93bb5c6..0000000 --- a/db/migrate/20140304015631_create_pms.rb +++ /dev/null @@ -1,11 +0,0 @@ -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/20140304015633_create_games.rb b/db/migrate/20140304015633_create_games.rb deleted file mode 100644 index 59d4ef0..0000000 --- a/db/migrate/20140304015633_create_games.rb +++ /dev/null @@ -1,13 +0,0 @@ -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/20140304015635_create_game_attributes.rb b/db/migrate/20140304015635_create_game_attributes.rb deleted file mode 100644 index b63f134..0000000 --- a/db/migrate/20140304015635_create_game_attributes.rb +++ /dev/null @@ -1,11 +0,0 @@ -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/20140304015638_create_server_settings.rb b/db/migrate/20140304015638_create_server_settings.rb deleted file mode 100644 index dfdd91b..0000000 --- a/db/migrate/20140304015638_create_server_settings.rb +++ /dev/null @@ -1,8 +0,0 @@ -class CreateServerSettings < ActiveRecord::Migration - def change - create_table :server_settings do |t| - - t.timestamps - end - end -end diff --git a/db/migrate/20140304015644_create_tournament_options.rb b/db/migrate/20140304015644_create_tournament_options.rb deleted file mode 100644 index d2df22e..0000000 --- a/db/migrate/20140304015644_create_tournament_options.rb +++ /dev/null @@ -1,8 +0,0 @@ -class CreateTournamentOptions < ActiveRecord::Migration - def change - create_table :tournament_options do |t| - - t.timestamps - end - end -end diff --git a/db/migrate/20140304015910_create_servers.rb b/db/migrate/20140304015910_create_servers.rb new file mode 100644 index 0000000..f33241a --- /dev/null +++ b/db/migrate/20140304015910_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/20140304015913_create_tournaments.rb b/db/migrate/20140304015913_create_tournaments.rb new file mode 100644 index 0000000..36fcf7e --- /dev/null +++ b/db/migrate/20140304015913_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/20140304015915_create_matches.rb b/db/migrate/20140304015915_create_matches.rb new file mode 100644 index 0000000..6c0c157 --- /dev/null +++ b/db/migrate/20140304015915_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/20140304015917_create_teams.rb b/db/migrate/20140304015917_create_teams.rb new file mode 100644 index 0000000..dd8397d --- /dev/null +++ b/db/migrate/20140304015917_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/20140304015922_create_users.rb b/db/migrate/20140304015922_create_users.rb new file mode 100644 index 0000000..f0986d4 --- /dev/null +++ b/db/migrate/20140304015922_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/20140304015924_create_user_team_pairs.rb b/db/migrate/20140304015924_create_user_team_pairs.rb new file mode 100644 index 0000000..2c492ac --- /dev/null +++ b/db/migrate/20140304015924_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/20140304015926_create_team_match_pairs.rb b/db/migrate/20140304015926_create_team_match_pairs.rb new file mode 100644 index 0000000..8fac07e --- /dev/null +++ b/db/migrate/20140304015926_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/20140304015928_create_alerts.rb b/db/migrate/20140304015928_create_alerts.rb new file mode 100644 index 0000000..68a8e10 --- /dev/null +++ b/db/migrate/20140304015928_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/20140304015931_create_pms.rb b/db/migrate/20140304015931_create_pms.rb new file mode 100644 index 0000000..93bb5c6 --- /dev/null +++ b/db/migrate/20140304015931_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/20140304015933_create_games.rb b/db/migrate/20140304015933_create_games.rb new file mode 100644 index 0000000..59d4ef0 --- /dev/null +++ b/db/migrate/20140304015933_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/20140304015935_create_game_attributes.rb b/db/migrate/20140304015935_create_game_attributes.rb new file mode 100644 index 0000000..b63f134 --- /dev/null +++ b/db/migrate/20140304015935_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/20140304015938_create_server_settings.rb b/db/migrate/20140304015938_create_server_settings.rb new file mode 100644 index 0000000..dfdd91b --- /dev/null +++ b/db/migrate/20140304015938_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/20140304015944_create_tournament_options.rb b/db/migrate/20140304015944_create_tournament_options.rb new file mode 100644 index 0000000..d2df22e --- /dev/null +++ b/db/migrate/20140304015944_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 index d44352e..2ffb746 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 20140304015644) do +ActiveRecord::Schema.define(version: 20140304015944) do create_table "alerts", force: true do |t| t.integer "author_id" diff --git a/doc/.gitignore b/doc/.gitignore new file mode 100644 index 0000000..ed193ea --- /dev/null +++ b/doc/.gitignore @@ -0,0 +1,4 @@ +*.pdf +*.html +*.png +!stickman.png diff --git a/doc/DesignDocument-architecture-model2.pptx b/doc/DesignDocument-architecture-model2.pptx new file mode 100644 index 0000000..1a1a08a Binary files /dev/null and b/doc/DesignDocument-architecture-model2.pptx differ diff --git a/doc/DesignDocument-classes.dot b/doc/DesignDocument-classes.dot new file mode 100644 index 0000000..cccc477 --- /dev/null +++ b/doc/DesignDocument-classes.dot @@ -0,0 +1,265 @@ +digraph systemModel { + rankdir="LR"; + splines="line"; + + subgraph _clusterModels { + label="Models" + node[shape="record"]; + + //BaseModel[label="

ActiveRecord::Base (abstract)"] + + Server[label="
Server"]; + Tournament[label="
Tournament"]; + Match[label="
Match"]; + Team[label="
Team"]; + User[label="
User | role | password hash"]; + } + + subgraph _clusterViews { + label="views/"; + node[shape="rectangle"] + + /* + layouts_application[label="layouts/application (abstract)"] + subgraph clusterViewsCommon { + label="views/common/"; + common_permission_denied[label="common/permission_denied"]; + common_invalid[label="common/invalid"]; + } + */ + subgraph clusterViewsMain { + label="views/main/"; + main_homepage[label="main/homepage"]; + main_edit[label="main/edit"]; + } + search_results[label="search/results"]; + subgraph clusterViewsMessages { + label="views/messages/"; + messages_new_alert[label="messages/new_alert"]; + messages_private[label="messages/private"]; + } + subgraph clusterViewsTournament { + label="views/tournament/"; + tournaments_index[label="tournaments/index"]; + tournaments_show[label="tournaments/show"]; + tournaments_new[label="tournaments/new"]; + tournaments_edit[label="tournaments/edit"]; + } + subgraph clusterViewsMatches { + label="views/matches/"; + matches_show[label="matches/show"]; + matches_edit[label="matches/edit"]; + } + subgraph clusterViewsTeams { + label="views/teams/"; + teams_index[label="teams/index"]; + teams_show[label="teams/show"]; + teams_new[label="teams/new"]; + teams_edit[label="teams/edit"]; + } + subgraph clusterViewsUsers { + label="views/users/"; + users_index[label="users/index"]; + users_new[label="users/new"]; + users_show[label="users/show"]; + users_edit[label="users/edit"]; + } + } + + subgraph _clusterControllers { + label="Controllers"; + node[shape="record"]; + + //ApplicationController[label="
ApplicationController (abstract)"]; + + MainController[label="
MainController | show_homepage() | edit_settings() | update_settings()"]; + LoginController[label="
LoginController | login() | logout()"]; + SearchController[label="
SearchController | show_results()"]; + MessagesController[label="
MessagesController | new_alert() | post_alert() | show_private() | post_private()"]; + TournamentsController[label="
TournamentsController | index() | show() | new() | create() | edit() | update() | end()"]; + MatchesController[label="
MatchesController | index() | show() | edit() | update()"]; + TeamsController[label="
TeamsController | index() | show() | edit() | update()"] + UsersController[label="
UsersController | index() | show() | new() | create() | edit() | update() | delete()"] + } + + /* + subgraph inheritance { + # Kludge: Have a arrow going both ways, but one invisible, so + # that it doesn't try to force a position + + # models + + Server:main -> BaseModel[arrowhead=onormal]; + BaseModel -> Server:main[style=invis]; + + Tournament:main -> BaseModel[arrowhead=onormal]; + BaseModel -> Tournament:main[style=invis]; + + Match:main -> BaseModel[arrowhead=onormal]; + BaseModel -> Match:main[style=invis]; + + Team:main -> BaseModel[arrowhead=onormal]; + BaseModel -> Team:main[style=invis]; + + User:main -> BaseModel[arrowhead=onormal]; + BaseModel -> User:main[style=invis]; + + # views + + common_permission_denied -> layouts_application[arrowhead=onormal]; + layouts_application -> common_permission_denied[style=invis]; + + common_invalid -> layouts_application[arrowhead=onormal]; + layouts_application -> common_invalid[style=invis]; + + main_homepage -> layouts_application[arrowhead=onormal]; + layouts_application -> main_homepage[style=invis]; + + main_edit -> layouts_application[arrowhead=onormal]; + layouts_application -> main_edit[style=invis]; + + messages_new_alert -> layouts_application[arrowhead=onormal]; + layouts_application -> messages_new_alert[style=invis]; + + messages_private -> layouts_application[arrowhead=onormal]; + layouts_application -> messages_private[style=invis]; + + tournaments_index -> layouts_application[arrowhead=onormal]; + layouts_application -> tournaments_index[style=invis]; + + tournaments_show -> layouts_application[arrowhead=onormal]; + layouts_application -> tournaments_show[style=invis]; + + tournaments_new -> layouts_application[arrowhead=onormal]; + layouts_application -> tournaments_new[style=invis]; + + tournaments_edit -> layouts_application[arrowhead=onormal]; + layouts_application -> tournaments_edit[style=invis]; + + matches_show -> layouts_application[arrowhead=onormal]; + layouts_application -> matches_show[style=invis]; + + matches_edit -> layouts_application[arrowhead=onormal]; + layouts_application -> matches_edit[style=invis]; + + teams_index -> layouts_application[arrowhead=onormal]; + layouts_application -> teams_index[style=invis]; + + teams_show -> layouts_application[arrowhead=onormal]; + layouts_application -> teams_show[style=invis]; + + teams_new -> layouts_application[arrowhead=onormal]; + layouts_application -> teams_new[style=invis]; + + teams_edit -> layouts_application[arrowhead=onormal]; + layouts_application -> teams_edit[style=invis]; + + users_index -> layouts_application[arrowhead=onormal]; + layouts_application -> users_index[style=invis]; + + users_new -> layouts_application[arrowhead=onormal]; + layouts_application -> users_new[style=invis]; + + users_show -> layouts_application[arrowhead=onormal]; + layouts_application -> users_show[style=invis]; + + users_edit -> layouts_application[arrowhead=onormal]; + layouts_application -> users_edit[style=invis]; + + # controllers + + MainController:main -> ApplicationController[arrowhead="onormal"]; + ApplicationController -> MainController:main[style=invis]; + + TournamentsController:main -> ApplicationController[arrowhead="onormal"]; + ApplicationController -> TournamentsController:main[style=invis]; + + MessagesController:main -> ApplicationController[arrowhead="onormal"]; + ApplicationController -> MessagesController:main[style=invis]; + + LoginController:main -> ApplicationController[arrowhead="onormal"]; + ApplicationController -> LoginController:main[style=invis]; + + SearchController:main -> ApplicationController[arrowhead="onormal"]; + ApplicationController -> SearchController:main[style=invis]; + + UsersController:main -> ApplicationController[arrowhead="onormal"]; + ApplicationController -> UsersController:main[style=invis]; + + MatchesController:main -> ApplicationController[arrowhead="onormal"]; + ApplicationController -> MatchesController:main[style=invis]; + } + */ + + ################################################################### + # controller/view relations + ################################################################### + MainController:index -> main_homepage; + MainController:edit -> main_edit -> MainController:update -> main_edit; + + #LoginController:login -> common_permission_denied; + #LoginController:logout -> common_invalid; + + SearchController:show_results -> search_results; + + MessagesController:new_alert -> messages_new_alert -> MessagesController:post_alert; + MessagesController:show_private -> messages_private -> MessagesController:post_private -> messages_private; + + TournamentsController:index -> tournaments_index; + TournamentsController:show -> tournaments_show; + TournamentsController:new -> tournaments_new -> TournamentsController:create -> tournaments_edit -> TournamentsController:end; + TournamentsController:edit -> tournaments_edit -> TournamentsController:update -> tournaments_edit; + + MatchesController:show -> matches_show; + MatchesController:edit -> matches_edit -> MatchesController:update -> matches_edit; + + TeamsController:index -> teams_index; + TeamsController:show -> teams_show; + TeamsController:edit -> teams_edit -> TeamsController:update -> teams_edit; + + UsersController:index -> users_index; + UsersController:show -> users_show; + UsersController:new -> users_new -> UsersController:create -> users_edit -> UsersController:delete; + UsersController:edit -> users_edit -> UsersController:update -> users_edit; + + ################################################################### + # controller/model relations + ################################################################### + Server:main -> MainController:edit; + MainController:update -> Server:main; + + User:main -> LoginController:login; + + Tournament:main -> SearchController:show_results; + Match:main -> SearchController:show_results; + Team:main -> SearchController:show_results; + User:main -> SearchController:show_results; + + Tournament:main -> TournamentsController:index; + Tournament:main -> TournamentsController:show; + Match:main -> TournamentsController:show; + Tournament:main -> TournamentsController:edit; + TournamentsController:create -> Tournament:main; + TournamentsController:update -> Tournament:main; + TournamentsController:end -> Tournament:main; + + Match:main -> MatchesController:index; + Match:main -> MatchesController:show; + Team:main -> MatchesController:show; + User:main -> MatchesController:show; + Match:main -> MatchesController:edit; + MatchesController:update -> Match:main; + + Team:main -> TeamsController:index; + Team:main -> TeamsController:show; + User:main -> TeamsController:show; + Team:main -> TeamsController:edit; + TeamsController:update -> Team:main; + + User:main -> UsersController:index; + User:main -> UsersController:show; + User:main -> UsersController:edit; + UsersController:create -> User:main; + UsersController:update -> User:main; + UsersController:delete -> User:main; +} diff --git a/doc/DesignDocument-models.pptx b/doc/DesignDocument-models.pptx new file mode 100644 index 0000000..e689a7c Binary files /dev/null and b/doc/DesignDocument-models.pptx differ diff --git a/doc/DesignDocument.md b/doc/DesignDocument.md new file mode 100644 index 0000000..45f6d5f --- /dev/null +++ b/doc/DesignDocument.md @@ -0,0 +1,475 @@ +--- +title: "Project Leaguer: Design Document" +author: [ Nathaniel Foy, Guntas Grewal, Tomer Kimia, Andrew Murrell, Luke Shumaker, Davis Webb ] +--- + +Version 1.0 – 2014.02.10 + +# Purpose + +The purpose of this document is to outlay the design, intent, and structure of +the Project Leaguer tournament organizing software. + +Released under an open license, Project Leaguer leverages powerful web +technologies to provide everything needed to organize an online +tournament. While it is designed with “League of Legends” in mind, it +should provide an online tournament interface that is easy to use for +tournament organizers, participants, and spectators for all kinds of +games, such as Chess, Poker, and more. Even better, Project Leaguer +offers scoring features and options, such as peer review and +team-independent individual scoring, which would be very difficult to +implement with traditional tournament organizing practices. + +The software itself operates as a stand-alone background server application +accessible and configurable though its web interface which reveals to users a +sleek web application which manages tournaments. + +# Non-Functional Requirements + +Security + : Because Project Leaguer servers may store sensitive user + information like name, email, statistics, user-name, profile, + etc. it is an important non-functional requirement that such data + is well secured from both accidental exposure and intentional + tampering. Even so, the System may not be responsible for the + theft of user information or even alterations made to the database + from a source different from that of Leaguer. + +Platform Compatibility + : A non-functional requirement for the system is to be able to run + on multiple platforms. Primarily a web based application, Leaguer + may not be able to install into embedded gaming devices and + special operation systems that do not run the interface that + Leaguer was initially built on. + +Response Time + : Even though the "Model 2" architecture tends to scale well for + medium/large applications and data sets, it is still important to + keep the response time of the system in mind. Using efficient data + structures, short time complexity algorithms, and minimizing + network overhead whenever possible will help to keep the response + time of the system reasonable even for large data sets or complex + statistics or scoring schemes. + + +# Design Outlines + +## Design Decisions and Components + +Project Leaguer is written on the Ruby on Rails platform and will use +the “Model 2” (often mis-identified as “MVC”) design +pattern/architecture. This architecture is comprised of three +interacting components: Controllers, Views, and Models. + +![](DesignDocument-architecture-model2.pdf)\ + +Controllers + : Requests received by the server are processed by a routing + subroutine and directed to a controller responsible for handling + them. Controllers accept these requests and manage any logic + necessary to obtain the correct content for display, retrieving + and updating information from the Model as needed. It then + creates a new request, places the content from the model in the + request (if applicable), decides which view it will be passed to, + and passes on the request. + +Models + : In Ruby on Rails, models are usually implemented as an interface + to a table in the database and a Ruby file which queries this + table and interacts with the other components. For example, a + "user" model would be connected to the "user" table and a file + "user.rb" in the app/models directory would provide an interface + to interact with the "user" controller. + +Views + : Views will primarily be dynamically generated HTML pages and will + display the users desired content inside of the web browser. These + may be implemented with inline Ruby scripts and tags within + traditional HTML. + +## Component Interaction + +Controllers will be used to run all of the background work of Leaguer. They will fetch the necessary data and will tell the view what to do. We will be implementing eight controllers into Leaguer. Those will be: + + i. PM & Alerts – This controller will be used for sending and receiving private messages to and from the host. Players will be able to message the host in order to inform him/her of anything during the tournament. This will also allow the host to post any notifications he or she desires that will be displayed for all to see. + ii. Settings & Homepage – Used to handle the homepage. This will be the first web page seen by any user of the application. + iii. Login – This controller will be used when a user attempts to sign in to their profile on Leaguer. + iv. Search – This controller will be used to search the web-base for on going tournaments, players and past tournaments. + v. Tournament – Used for setting up a tournament. This will be restricted to the host of the tournament. + vi. User – The controller that will take each user to their own profile. + vii. Match/Peer Review – used for gather game statistics and the separate player reviews. +viii. Teams - This controller will be used to handle the separate teams. It will contain: a list of the team's members and will be used to handle team roster modifications. + +Each of these controllers will fetch the data specified by its separate section. The view will then be used to display all of this information, so Login will take the user to a login page, search will take the user to a search page and so on. + +The Model will be the data section that will map all of the information to their proper locations in the data base. + +# Design Issues + +## Scoring Algorithm + +In an effort to keep our system broad, one of our requirements is that Leaguer is adaptable to many competitions, not just League of Legends. How do we assure that the different scoring systems of different sports are represented in Leaguer? + +Option 1 + : One of our interfaces could be “Scoring System” which will be + implemented by many classes with common scoring systems. For + example there would be a implementing class in which the highest + score wins, and one in which the lowest score wins. This is likely + to be the winning option, as there are not too many obscure + scoring systems that we could not think of. + +Option 2 + : We could design an API in which the host writes a method to update + the scoring. This is pretty complex, and while it would allow more + customization, it is hard to imagine completing this task without + first completing option 1. + +## Offline Data Management + +Leaguer manages players and games within tournaments, but it also stores statistics about the games and players themselves. We need a system to store this information after the server-host shuts down the server. + +Option 1 + : Perhaps the simplest and most intuitive option is to implement a + database dump system. The server would dump the information into + an SQL format. All game and player data would be stored to the + host and could be restored to a new server. The host would be + responsible for preserving the data. Additional security measures + could be implemented to help protect data. This option leaves the + users with great control over the data. + +Option 2 + : We could host Leaguer ourselves with our own server. All users + would connect to it instead of to a user-hosted server. Game and + player information would be stored and maintained on Leaguer's + server and the users would not need to manage data themselves, but + instead we would have to host the service. + +## Fetching Data from Games + +Obtaining the statistics from the end of game or match is a vital step in Leaguer's function. A quick and easy method for obtaining this information will ensure smooth usability. + +Option 1 + : In the case of online multiplayer games, such as League of + Legends, it may be possible to obtain the information directly + from the game-hosted server or even websites that already do so. + In the case of League of Legends, `lolking.net` and `lolnexus.com` + already grab statistics from the server automatically. There are + also some open source projects, such as data-hut on GitHub, that + could be used to help extract and categorize the data itself. This + option is complex, but also highly desirable for compatible games, + as it ensures a fast and simple environment for our users. + +Option 2 + : Users manually enter the data themselves. Different games would + require different methods for the users to implement. In the case + of online games, users could take screenshot of a match's score + screen (and then the statistics would be manually entered in), or + a select pool of users could be responsible for recording the + information and then entering it in. This option is tedious and + undesirable. + +Option 3 + : Use Optical Character Recognition to obtain statistics from score + screen screenshots. This option would require someone to take a + screenshot in each match and submit it to Leaguer. This would + require more work than Option 1, but much less than Option 2. An + OCR plugin would have to be implemented for each game and thus + support would be limited from game to game. Outside contributors + could help widen the number of games with OCR support. + +# Design Details +## Class Descriptions and Interactions + +### MODELS + +![](DesignDocument-models.pdf)\ + +ActiveRecord::Base (abstract) + : The abstract model that all other models inherit from. + +Server + : Server model providing access to system settings such as Language, Time_Zone, Server_name, Owner_name, and Version. This class is edited and read by the MainController. + +Tournament + : This model represents the structure of a tournament. It will have several data sections to it including: The match settings, the matches contained inside of the tournament, a unique id for the tournament, and the registered players that are participating in the tournament. This class interacts with a multitude of other model classes (see UML) and all four tournament controllers. + +Match + : A match will be a single set of data that contains all of the statistics of one game. This includes: players personal scores, team members, scores for each team, game time, the tournament that match took place in, and the date. This model interacts with the match controller, and is both a part of and has a many to one relationship with a tournament object. + +Team + : This model will consist of a list of players for a tournament. The team creation process is chosen by the host of the tournament and team setup will either be pre-determined teams or randomly assigned teams. This model interacts with the tournament model class. + +User + : This model represents all types of users; hosts, players, and + spectators. These roles are identified by a “role” attribute. The user is an object that is often referenced by other classes, including tournament, match, and team. + +### VIEWS + +Asynchronous JavaScript may be used to load one view inside of +another. From the core architecture, this does not matter, as the +same HTTP requests are made, though the user interaction is a little +cleaner. + +layouts/application.html (abstract) + : An abstract HTML file, that contains the basic page layout that + all other views inherit. If a user is not logged in, it contains + a login form, and a registration button. The form causes a POST + to `LoginController#login()`, and the button causes a GET to + `UserController#new()`. If a user is logged in, it displays a + logout button that causes a POST to `LoginController#logout()`. + It may contain an alert box of recent alerts submitted by a + tournament host. It contains a search form that is POSTed to + `SearchController#show_results`. If the user is authorized to + publish alerts, it also contains a button that causes the browser + to GET `MessagesController#new_alert()`. + +common/permission_denied.html + : A generic page for when a user attempts to do something for which + they don't have authorization. + +common/invalid.html + : A generic page for handling invalid requests (such as logging out + when not logged in). + +main/homepage.html + : This page is visually simple. In addition to the basic functions + of `layouts/application`, this page has a “Go to Tournament” text + area, in which you enter a tournament title, and will take you to + the relevant tournament page. + +main/edit.html + : This page is a form for editing the server-wide configuration, + such as the language or the graphical theme. The form is + submitted to `MainController#update()`. + +search/results.html + : Shows the results of a search. Each item is clickable and + triggers a GET request to the relevant controller method. + +messages/new_alert.html + : This is a form for a host to submit a new system-wide alert. The + form is POSTed to `MessagesController#post_alert()`. + +messages/private.html + : This page is used to handle user private messaging. It both + displays private messages, and contains a form for sending a new + private message. New messages are POSTed to + `MessageController#post_private()` + +tournaments/index.html + : Shows a list of tournaments. Clicking on any of them causes the + browser GET that tournament via `TournamentController#show()`. If + the user is authorized, it also contains a button that causes the + browser to GET `TournamentsController#new()`. + +tournaments/show.html + : Shows the information for a single tournament. If the user is + authorized, it also shows an “edit” button that triggers a the + browser to GET `TournamentsController#edit()`. This is a + tree-like display of matches, where each match consists of a pair + of teams. All users can click on a match to go to that match’s + page. Host can see a gear on top left corner that represents + tournament settings, it will GET `TournamentsController#edit()`. + There will be an “end” button that will redirect to back to the + homepage after POSTing to `TournamentsController#end()`. + +tournaments/new.html + : A form for creating a new tournament. The form is POSTed to + `TournamentsController#create()`. + +tournaments/edit.html + : A form for editing an existing tournament. The form is POSTed to + `TournamentsController#update()`. + +matches/index.html + : Shows a list of matches. Clicking on any of them causes the + browser to GET that match via `MatchesController#show()`. + +matches/show.html + : Shows an individual match; a display of both teams. Each team's + players are clickable which causes a GET for the player's profile + HTML (`UsersController#show()`). A link above both teams will GET + the tournament the match belongs to + (`TournamentsController#show()`). If the user is authorized, it + also has a button to edit the match by GETting + `MatchesController#edit()`. + +matches/edit.html + : Shows a form to edit a match. The form is POSTed to + `MatchesController#update()`. After a match has been completed, + this included peer-review input by the players. + +teams/index.html + : Shows a list of teams. Clicking any of them causers the browser + to GET that team via `TeamsController#show()`. + +teams/show.html + : Show an individual team, including statistics, and links to + individual members (GET `UsersController#show()`). If the user is + authorized, it also has a button do edit the team by GETting + `TeamsController#edit()`. + +teams/edit.html + : A form to manually edit a team, and its members. The form + contents are POSTed to `TeamsController#update()`. + +users/index.html + : Show a list of users. Clicking any of them causers the browser + to GET that user via `UsersController#show()`. + +users/new.html + : Shows a form for creating a new user. It includes fields for + username, email, password, and other information. The form is + POSTed to `UsersController#create()`; + +users/show.html + : A page with the user's information. One can view the player's + reviews. If the user is authorized, it also has a button do edit + the user by GETting `UsersController#edit()`. + +users/edit.html + : A form to edit a user; including meta-data and tournament + registration. The form is POSTed to `UsersController#update()`. + +### CONTROLLERS + +Any time "assuming the user has permission" it is mentioned, if the +user doesn't have permission, it renders the +`common/permission_denied` view. This also means that the method +interacts with a `User` model to evaluate the permissions. + +ApplicationController (abstract) + : The base controller class that all other controllers inherit from. + +MainController + : This is the main controller. It has the following methods: + + - `show_homepage()` Responds to GET requests by rendering the + `main/homepage` view. + - `edit_settings()` Responds to GET requests by (if the user is + authenticated and is a host) rendering the `main/edit` view that + presents the user with a form to edit the `Server` model's + settings; assuming the user has permission. + - `update_settings()` Responds to POST requests by updating the + `Server` model configuration with the POSTed settings. It then + renders the `main/edit` view with the updated settings. This + assumes the user has the permissions. + +LoginController + : This controller handles session management. It contains two + methods: + + - `login()` Responds to POST requests by setting a session token + identifying the user. If the credentials are correct, it sends + a redirect that directs the browser to the page it would + otherwise be on. If the credentials are not correct, it renders + the `common/permission_denied` view. This queries the `User` + model to validate the username and password. + - `logout()` Responds to POST requests by clearing the session + token, logging the user out, then redirects to the home page + (`MainController#show_homepage()`). If the user was not logged in, + it renders the `common/invalid` view. + +SearchController + : This controller handles user search terms. It has one method: + + - `show_results()` Responds to POST by accessing whichever model(s) + contains the information requested and renders the `search/results` view. + +MessagesController + : This controller handles inter-user messages. It has a couple + methods that respond to GET requests: + + - `new_alert()` Renders the `messages/new_alert` template, + assuming the user has permission. + - `show_private()` Renders the `messages/private template, + assuming the user has permission. + + It also has methods that respond to POST requests: + + - `post_alert()` Publishes a new system-wide alert, assuming the + user has permission. It then redirects the browser to whichever + page it would otherwise be on. + - `post_private()` Sends a new private message, assuming the user + has permission. + +TournamentsController + : The following methods respond to GET requests by rendering the + `tournaments/*` view with the same name: + + - `index()` + - `show()` + - `new()` (assuming the user has permission) + - `edit()` (assuming the user has permission) + + The following methods respond to POST requests, assuming the user + has permission: + + - `create()` Creates a new `Tournament` with the POSTed data. + Then renders the `tournaments/show` view. + - `update()` Updates the specified `Tournament` with the POSTed + data. Then renders the `tournaments/edit` view. + - `end()` Ends the specified `Tournament`. Then redirects to + `MainController#show_hompage()`. + + All of these methods will interact with the `Tournament` model, + and all of its fields including users matches and + TournamentSettings. + +MatchesController + : The following methods respond to GET requests by rendering the + `matches/*` view with the same name: + + - `index()` + - `show()` + - `edit()` + + The following methods respond to POST requests, assuming the user + has permission: + + - `update()` Updates the specified `Match` with the POSTed data. + +TeamsController + : The following methods respond to GET requests by rendering the + `teams/*` view with the same name: + + - `index()` + - `show()` + - `edit()` + + The following methods respond to POST requests, assuming the user + has permission: + + - `update()` Update the specified `Team` with the POSTed data. + +UsersController + : The following methods respond to GET requests by rendering the + `users/*` view with the same name: + + - `index()` + - `show()` + - `new()` + - `edit()` + + The following methods respond to POST requests, assuming the user + has permission: + + - `create()` Creates a new `User` with the POSTed data. + - `update()` Update the specified `User` with the POSTed data. + - `delete()` Deletes the specified `User` account. + +## UML Diagram of Classes + +This diagram does not show all models inheriting from +`ActiveRecord::Base`, all views inheriting from `layouts/application`, +or all controllers inheriting from `ApplicationController`. It +does not show interactions with the `User` model that solely check +authorization to perform an action. It does not show controller +methods calling the error views. It shows transitions from a view to +a controller *only* when that is the *primary* purpose of the view; many +workflows can be interrupted at any time. Arrows between models and +controllers indicate which direction data is flowing. Any data +flowing from a model to the method of a controller is implicitly +passed to the view that method renders. + +![](DesignDocument-classes.pdf)\ diff --git a/doc/Diagram01.jpg b/doc/Diagram01.jpg new file mode 100644 index 0000000..0c85216 Binary files /dev/null and b/doc/Diagram01.jpg differ diff --git a/doc/Makefile b/doc/Makefile new file mode 100644 index 0000000..469b1a2 --- /dev/null +++ b/doc/Makefile @@ -0,0 +1,26 @@ +docs = $(patsubst %.md,%,$(wildcard *.md)) + +pdf: $(addsuffix .pdf,$(docs)) +html: $(addsuffix .html,$(docs)) + +%.pdf: %.md Makefile + pandoc $($@.args) -s $< -o $@ +%.html: %.md Makefile + pandoc -s $< -o $@ +%.png: %.dot Makefile + dot -Tpng < $< > $@ +%.pdf: %.dot Makefile + dot -Tpdf < $< > $@ +%.pdf: %.pptx Makefile + soffice --headless --convert-to pdf $< + +ProductBacklog.pdf: SystemModel.png +SystemModel.png: stickman.png + +DesignDocument.pdf: DesignDocument-architecture-model2.pdf DesignDocument-models.pdf DesignDocument-classes.pdf +DesignDocument.pdf.args = --table-of-contents --number-sections -f markdown+definition_lists + +clean: + rm -f -- *.pdf *.html + +.DELETE_ON_ERROR: diff --git a/doc/ProductBacklog.md b/doc/ProductBacklog.md new file mode 100644 index 0000000..59b5e11 --- /dev/null +++ b/doc/ProductBacklog.md @@ -0,0 +1,89 @@ +--- +title: Team 6 - Leaguer +author: [ Nathaniel Foy, Guntas Grewal, Tomer Kimia, Andrew Murrell, Luke Shumaker, Davis Webb ] +--- + +Problem Statement +----------------- + +In team-based tournament sports, often individual contributions are +overshadowed by the binary end result: win or lose. This +winner-takes-all mentality may unfairly pair players in later stages +of the tournament based on the team's score rather than their own in +early stages. + + +Background +---------- + +Generally, new team based competitions have been managed +electronically using archaic methods. The winning team advances and +the losing team is defeated. In the real world there are many +examples of individual review (as in football) and handicaps (as in +golf). Our goal is to create software that allows teams to compete +and review their peers to more accurately represent modern team +competitions. Our domain is online competition management and +e-sports. The targeted audience is defined on two levels, on a broad +level it is for any individual wishing to manage a competitive event, +on a niche level it is for individuals looking to manage and +participate in team competitions (like League of Legends). + +All existing solutions that we found were limited by the binary +win/lose. Several open-souce options exist, which we could possibly +extend. + +The most prominent of these is "XDojo". It has not been modified in +roughly two years, but has been used for several national +tournaments. Unfortunately, the documentation is not in English. +Because of this, evaluating it for possible adaptation is at the very +least, a spike. + +Another current offering is "OMGT" (Open Manager for Game +Tournaments). It seems to be reasonably well developed and stable, +though the install process is mostly undocumented, and while probably +not very complex, we haven't figured it out yet. + +The third current open source offering looked at was "tournamentmngr", +which seems to be unstable/incomplete. It is written in C#, which +gets in the way of our "easy to install" requirement. + +System Model +------------ + +![](./SystemModel.png)\ + +Requirements +------------ + + - Essential functional requirements + - As a host, I would like to create a new tournament. + - As a host, I would like to set some of the parameters of a + tournamet, such as number of players per team, whether + spectators ar allowed, and game type. + - As a player, I would like to register for a tournament. + - As a host, I would like to assign members to team, or have the + option to randomly assign teams. + - As a player, I would like to rate my peers, and would like to be + reviewed by my peers. + - As a player, or spectator, I would like to see the standings of + all players. + - As a host, or a player, I would like my win/rating history to be + stored so that I can have the same profile throughout many + tournaments. + - Essential non-functional requirements + - As a host, player, or spectator I would like the Project Leaguer + interface to be simple and easy to use. + - As a host, player, or spectator I would like the Project Leaguer + server to be secure and to operate quickly. + - Non-essential functional requirements + - As a host, I would like to be able to send public alerts to + players and spectators. + - As a player, I would like to be able to exchange private + messages with a host. + - As a player or spectator I would like access to Advanced + Tournament Search facilities. + - Non-essential non-functional requirements + - As a player or spectator I would like to utilize an Interactive Menu. + - As a spectator, I would like to be able to watch matches on "Twitch". + - As a player, or a spectator, I would like to be able to access + the service on a mobile device. diff --git a/doc/ProjectCharter.md b/doc/ProjectCharter.md new file mode 100644 index 0000000..f88ccd4 --- /dev/null +++ b/doc/ProjectCharter.md @@ -0,0 +1,26 @@ +1. In team-based tournament sports, often individual contributions are + overshadowed by the binary end result: win or lose. This + winner-takes-all mentality may unfairly pair players in later + stages of the tournament based on the team's score rather than + their own in early stages. + +2. Project Objectives: + * To address issues of fairness in tournament orchestration and + * To create a general-purpose open source solution for organizing + team-based tournaments where individual performance matters + * by implementing an out-of-the-box open source server software + * capable of managing pairings, scoring, and statistics for a + variety of applicable game types + * accessable via an intuitive web interface. + +3. Stakeholders - the development team, testers, and a future community of users. + +4. A Project Leaguer server provides the user with everything needed + to run a tournament: regisration, pairing, scoring, and statistics, + right away through a simple web interface. Project Leaguer also + gives its users a unique option for scoring, not available through + traditional tournament management techniques: peer review. By + providing a forward facing, web-based interface for tournament + participants to score their teammates, Project Leaguer allows + individual ability and activity to be recognized within the context + of an all-in, win-or-lose multiplayer team game. diff --git a/doc/ProjectLeaguerWorkloadBreakup.md b/doc/ProjectLeaguerWorkloadBreakup.md new file mode 100644 index 0000000..99d9c2e --- /dev/null +++ b/doc/ProjectLeaguerWorkloadBreakup.md @@ -0,0 +1,14 @@ +How to break up workload: + + * Login/Registration/Verification System + * SQL Database Design and Access + * User Interface + * Officiator Interface/Admin Access + * Pairings and Statistics + * Peer Review + * Secure Saved Server Image (backed up user profiles, database, and statistics) + * Separate Game Module Plugins + * General Abstractions + * Unit Testing and Error Handling + * Installing and Running Out-of-the-box + * Icons and Images diff --git a/doc/Sprint1.md b/doc/Sprint1.md new file mode 100644 index 0000000..03baf5d --- /dev/null +++ b/doc/Sprint1.md @@ -0,0 +1,92 @@ +--- +title: "Project Leaguer: Sprint 1" +author: [ Nathaniel Foy, Guntas Grewal, Tomer Kimia, Andrew Murrell, Luke Shumaker, Davis Webb ] +--- + +# User Stories + +1) As an administrator, I would like to install and boot my own server. + - Alternately: As a developer, I would like a demo/testing server, + with a basic Rails setup. +2) As a host/player, I would like to register and have an account. + - For this task, we will be creating the user registration and log + in capabilities for Leaguer. +3) As a host, I would like to start a tournamnet. + - For this task, we will be creating a base tournament system for a + host to run. +4) As a host/player, I would like to enter scores for players. + - For sprint own, the scores will be entered by hand. +5) As an administrator, I want to specify how users become hosts. +6) As a user I would like to see the progress of the tournament in my + browser. +7) As a user, I would like a presentable homepage. + - For this task, we will be creating a Leaguer homepage and ensure that it + is pleasing to the eye and easy to navigate. + +# Tasks + +The "size" is using the modified Fibonacci scale. A '1' is expected +to take less than an hour. A '3' is expected to take 3-6 hours. A +'5' should take the better part of a day or two. An 8 should take +several days. + ++---------------------------------------------------------+------+--------+----+ +| Task Description | Size | Person | US | ++=========================================================+======+========+====+ +| Learn Rails, set up Scaffolding for all Models, Views, | 8 | All | 1 | +| Controllers | | | | ++---------------------------------------------------------+------+--------+----+ +| Deploy rails on the server at 199.180.255.147 | 3 | Luke | 1 | ++---------------------------------------------------------+------+--------+----+ +| Peer review | 1 | All | 1 | ++---------------------------------------------------------+------+--------+----+ +| Create log-in system backend (verification, cookies, | 5 | Davis | 2 | +| and redirection) | | | | ++---------------------------------------------------------+------+--------+----+ +| Create log-in system UI (forms, CSS, and submission) | 2 | Tomer | 2 | ++---------------------------------------------------------+------+--------+----+ +| Test it | 1 | Foy | 2 | ++---------------------------------------------------------+------+--------+----+ +| Peer review | 1 | All | 2 | ++---------------------------------------------------------+------+--------+----+ +| Create Preliminary Tournament Settings Page | 3 | Guntas | 3 | ++---------------------------------------------------------+------+--------+----+ +| Design/Code Scoring/Pairing Algorithms and Procedures | 5 | Foy | 3 | ++---------------------------------------------------------+------+--------+----+ +| Observe Foy Design/Code Scoring/Pairing Algorithms | 2 | Dav+Foy| 3 | ++---------------------------------------------------------+------+--------+----+ +| Implement Tournament Registration and Tournament | 2 | Andrew | 3 | +| Controller | | | | ++---------------------------------------------------------+------+--------+----+ +| Test it | 1 | Andrew | 2 | ++---------------------------------------------------------+------+--------+----+ +| Peer review | 1 | All | 1 | ++---------------------------------------------------------+------+--------+----+ +| Design and implement match score models | 3 | Foy | 4 | ++---------------------------------------------------------+------+--------+----+ +| Implement match controller | 3 | Dav+And| 4 | ++---------------------------------------------------------+------+--------+----+ +| Create a Player-level Data Entry Page/Method for Results| 3 | Tomer | 4 | ++---------------------------------------------------------+------+--------+----+ +| Test it | 1 | Andrew | 2 | ++---------------------------------------------------------+------+--------+----+ +| Peer review | 1 | All | 1 | ++---------------------------------------------------------+------+--------+----+ +| Implement permissions system over the users system | 3 | Luke | 5 | ++---------------------------------------------------------+------+--------+----+ +| Create Admin-level Server Management Page | 2 | Luke | 5 | ++---------------------------------------------------------+------+--------+----+ +| Test it | 1 | Tomer | 2 | ++---------------------------------------------------------+------+--------+----+ +| Peer review | 1 | All | 1 | ++---------------------------------------------------------+------+--------+----+ +| Create View Tournament Page | 5 | All | 6 | ++---------------------------------------------------------+------+--------+----+ +| Test it | 1 | All | 2 | ++---------------------------------------------------------+------+--------+----+ +| Peer review | 1 | All | 1 | ++---------------------------------------------------------+------+--------+----+ +| Create Presentable Homepage | 5 | Guntas | 7 | ++---------------------------------------------------------+------+--------+----+ +| Peer review | 1 | All | 1 | ++---------------------------------------------------------+------+--------+----+ diff --git a/doc/SystemModel.dot b/doc/SystemModel.dot new file mode 100644 index 0000000..ea1836a --- /dev/null +++ b/doc/SystemModel.dot @@ -0,0 +1,60 @@ +digraph SystemModel { + rankdir=LR; + peripheries=0; + + /* users */ + { + node [image="stickman.png", labelloc="b", shape="none"]; + player[label="Player"]; + host[label="Host"]; + spectator[label="Spectator"]; + } + + /* subsystems */ + /* if you want to rename any of these, it is probably easiest + * to leave the ID the same, and just change the label */ + subgraph clusterSystem { + label = "System Boundry"; + style = filled; + + node [style=solid]; + peerReview[label="Peer Review"]; + performance[label="Performance"]; + standings[label="Standings"]; + gs[label="Game Score"]; + search[label="Search"]; + pm[label="Private Message"]; + alerts[label="Alerts"]; + pairings[label="Pairings"]; + details[label="Tournament Details"]; + backup[label="Backup"]; + registration[label="Registration"]; + } + + /* all the relationships */ + spectator -> search; + standings -> spectator; + alerts -> spectator; + pairings -> spectator; + + player -> spectator [arrowhead="onormal"]; + player -> peerReview; + player -> performance; + player -> registration; + player -> pm; + pm -> player; + + host->spectator [arrowhead="onormal"]; + host->alerts; + host->details; + host->registration; + host -> pm; + pm -> host; + + peerReview -> standings; + performance-> standings; + gs -> performance; + details -> backup; + details -> pairings; + registration -> pairings; +} diff --git a/doc/stickman.png b/doc/stickman.png new file mode 100644 index 0000000..00f16fc Binary files /dev/null and b/doc/stickman.png differ diff --git a/docs/.gitignore b/docs/.gitignore deleted file mode 100644 index ed193ea..0000000 --- a/docs/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -*.pdf -*.html -*.png -!stickman.png diff --git a/docs/DesignDocument-architecture-model2.pptx b/docs/DesignDocument-architecture-model2.pptx deleted file mode 100644 index 1a1a08a..0000000 Binary files a/docs/DesignDocument-architecture-model2.pptx and /dev/null differ diff --git a/docs/DesignDocument-classes.dot b/docs/DesignDocument-classes.dot deleted file mode 100644 index cccc477..0000000 --- a/docs/DesignDocument-classes.dot +++ /dev/null @@ -1,265 +0,0 @@ -digraph systemModel { - rankdir="LR"; - splines="line"; - - subgraph _clusterModels { - label="Models" - node[shape="record"]; - - //BaseModel[label="
ActiveRecord::Base (abstract)"] - - Server[label="
Server"]; - Tournament[label="
Tournament"]; - Match[label="
Match"]; - Team[label="
Team"]; - User[label="
User | role | password hash"]; - } - - subgraph _clusterViews { - label="views/"; - node[shape="rectangle"] - - /* - layouts_application[label="layouts/application (abstract)"] - subgraph clusterViewsCommon { - label="views/common/"; - common_permission_denied[label="common/permission_denied"]; - common_invalid[label="common/invalid"]; - } - */ - subgraph clusterViewsMain { - label="views/main/"; - main_homepage[label="main/homepage"]; - main_edit[label="main/edit"]; - } - search_results[label="search/results"]; - subgraph clusterViewsMessages { - label="views/messages/"; - messages_new_alert[label="messages/new_alert"]; - messages_private[label="messages/private"]; - } - subgraph clusterViewsTournament { - label="views/tournament/"; - tournaments_index[label="tournaments/index"]; - tournaments_show[label="tournaments/show"]; - tournaments_new[label="tournaments/new"]; - tournaments_edit[label="tournaments/edit"]; - } - subgraph clusterViewsMatches { - label="views/matches/"; - matches_show[label="matches/show"]; - matches_edit[label="matches/edit"]; - } - subgraph clusterViewsTeams { - label="views/teams/"; - teams_index[label="teams/index"]; - teams_show[label="teams/show"]; - teams_new[label="teams/new"]; - teams_edit[label="teams/edit"]; - } - subgraph clusterViewsUsers { - label="views/users/"; - users_index[label="users/index"]; - users_new[label="users/new"]; - users_show[label="users/show"]; - users_edit[label="users/edit"]; - } - } - - subgraph _clusterControllers { - label="Controllers"; - node[shape="record"]; - - //ApplicationController[label="
ApplicationController (abstract)"]; - - MainController[label="
MainController | show_homepage() | edit_settings() | update_settings()"]; - LoginController[label="
LoginController | login() | logout()"]; - SearchController[label="
SearchController | show_results()"]; - MessagesController[label="
MessagesController | new_alert() | post_alert() | show_private() | post_private()"]; - TournamentsController[label="
TournamentsController | index() | show() | new() | create() | edit() | update() | end()"]; - MatchesController[label="
MatchesController | index() | show() | edit() | update()"]; - TeamsController[label="
TeamsController | index() | show() | edit() | update()"] - UsersController[label="
UsersController | index() | show() | new() | create() | edit() | update() | delete()"] - } - - /* - subgraph inheritance { - # Kludge: Have a arrow going both ways, but one invisible, so - # that it doesn't try to force a position - - # models - - Server:main -> BaseModel[arrowhead=onormal]; - BaseModel -> Server:main[style=invis]; - - Tournament:main -> BaseModel[arrowhead=onormal]; - BaseModel -> Tournament:main[style=invis]; - - Match:main -> BaseModel[arrowhead=onormal]; - BaseModel -> Match:main[style=invis]; - - Team:main -> BaseModel[arrowhead=onormal]; - BaseModel -> Team:main[style=invis]; - - User:main -> BaseModel[arrowhead=onormal]; - BaseModel -> User:main[style=invis]; - - # views - - common_permission_denied -> layouts_application[arrowhead=onormal]; - layouts_application -> common_permission_denied[style=invis]; - - common_invalid -> layouts_application[arrowhead=onormal]; - layouts_application -> common_invalid[style=invis]; - - main_homepage -> layouts_application[arrowhead=onormal]; - layouts_application -> main_homepage[style=invis]; - - main_edit -> layouts_application[arrowhead=onormal]; - layouts_application -> main_edit[style=invis]; - - messages_new_alert -> layouts_application[arrowhead=onormal]; - layouts_application -> messages_new_alert[style=invis]; - - messages_private -> layouts_application[arrowhead=onormal]; - layouts_application -> messages_private[style=invis]; - - tournaments_index -> layouts_application[arrowhead=onormal]; - layouts_application -> tournaments_index[style=invis]; - - tournaments_show -> layouts_application[arrowhead=onormal]; - layouts_application -> tournaments_show[style=invis]; - - tournaments_new -> layouts_application[arrowhead=onormal]; - layouts_application -> tournaments_new[style=invis]; - - tournaments_edit -> layouts_application[arrowhead=onormal]; - layouts_application -> tournaments_edit[style=invis]; - - matches_show -> layouts_application[arrowhead=onormal]; - layouts_application -> matches_show[style=invis]; - - matches_edit -> layouts_application[arrowhead=onormal]; - layouts_application -> matches_edit[style=invis]; - - teams_index -> layouts_application[arrowhead=onormal]; - layouts_application -> teams_index[style=invis]; - - teams_show -> layouts_application[arrowhead=onormal]; - layouts_application -> teams_show[style=invis]; - - teams_new -> layouts_application[arrowhead=onormal]; - layouts_application -> teams_new[style=invis]; - - teams_edit -> layouts_application[arrowhead=onormal]; - layouts_application -> teams_edit[style=invis]; - - users_index -> layouts_application[arrowhead=onormal]; - layouts_application -> users_index[style=invis]; - - users_new -> layouts_application[arrowhead=onormal]; - layouts_application -> users_new[style=invis]; - - users_show -> layouts_application[arrowhead=onormal]; - layouts_application -> users_show[style=invis]; - - users_edit -> layouts_application[arrowhead=onormal]; - layouts_application -> users_edit[style=invis]; - - # controllers - - MainController:main -> ApplicationController[arrowhead="onormal"]; - ApplicationController -> MainController:main[style=invis]; - - TournamentsController:main -> ApplicationController[arrowhead="onormal"]; - ApplicationController -> TournamentsController:main[style=invis]; - - MessagesController:main -> ApplicationController[arrowhead="onormal"]; - ApplicationController -> MessagesController:main[style=invis]; - - LoginController:main -> ApplicationController[arrowhead="onormal"]; - ApplicationController -> LoginController:main[style=invis]; - - SearchController:main -> ApplicationController[arrowhead="onormal"]; - ApplicationController -> SearchController:main[style=invis]; - - UsersController:main -> ApplicationController[arrowhead="onormal"]; - ApplicationController -> UsersController:main[style=invis]; - - MatchesController:main -> ApplicationController[arrowhead="onormal"]; - ApplicationController -> MatchesController:main[style=invis]; - } - */ - - ################################################################### - # controller/view relations - ################################################################### - MainController:index -> main_homepage; - MainController:edit -> main_edit -> MainController:update -> main_edit; - - #LoginController:login -> common_permission_denied; - #LoginController:logout -> common_invalid; - - SearchController:show_results -> search_results; - - MessagesController:new_alert -> messages_new_alert -> MessagesController:post_alert; - MessagesController:show_private -> messages_private -> MessagesController:post_private -> messages_private; - - TournamentsController:index -> tournaments_index; - TournamentsController:show -> tournaments_show; - TournamentsController:new -> tournaments_new -> TournamentsController:create -> tournaments_edit -> TournamentsController:end; - TournamentsController:edit -> tournaments_edit -> TournamentsController:update -> tournaments_edit; - - MatchesController:show -> matches_show; - MatchesController:edit -> matches_edit -> MatchesController:update -> matches_edit; - - TeamsController:index -> teams_index; - TeamsController:show -> teams_show; - TeamsController:edit -> teams_edit -> TeamsController:update -> teams_edit; - - UsersController:index -> users_index; - UsersController:show -> users_show; - UsersController:new -> users_new -> UsersController:create -> users_edit -> UsersController:delete; - UsersController:edit -> users_edit -> UsersController:update -> users_edit; - - ################################################################### - # controller/model relations - ################################################################### - Server:main -> MainController:edit; - MainController:update -> Server:main; - - User:main -> LoginController:login; - - Tournament:main -> SearchController:show_results; - Match:main -> SearchController:show_results; - Team:main -> SearchController:show_results; - User:main -> SearchController:show_results; - - Tournament:main -> TournamentsController:index; - Tournament:main -> TournamentsController:show; - Match:main -> TournamentsController:show; - Tournament:main -> TournamentsController:edit; - TournamentsController:create -> Tournament:main; - TournamentsController:update -> Tournament:main; - TournamentsController:end -> Tournament:main; - - Match:main -> MatchesController:index; - Match:main -> MatchesController:show; - Team:main -> MatchesController:show; - User:main -> MatchesController:show; - Match:main -> MatchesController:edit; - MatchesController:update -> Match:main; - - Team:main -> TeamsController:index; - Team:main -> TeamsController:show; - User:main -> TeamsController:show; - Team:main -> TeamsController:edit; - TeamsController:update -> Team:main; - - User:main -> UsersController:index; - User:main -> UsersController:show; - User:main -> UsersController:edit; - UsersController:create -> User:main; - UsersController:update -> User:main; - UsersController:delete -> User:main; -} diff --git a/docs/DesignDocument-models.pptx b/docs/DesignDocument-models.pptx deleted file mode 100644 index e689a7c..0000000 Binary files a/docs/DesignDocument-models.pptx and /dev/null differ diff --git a/docs/DesignDocument.md b/docs/DesignDocument.md deleted file mode 100644 index 45f6d5f..0000000 --- a/docs/DesignDocument.md +++ /dev/null @@ -1,475 +0,0 @@ ---- -title: "Project Leaguer: Design Document" -author: [ Nathaniel Foy, Guntas Grewal, Tomer Kimia, Andrew Murrell, Luke Shumaker, Davis Webb ] ---- - -Version 1.0 – 2014.02.10 - -# Purpose - -The purpose of this document is to outlay the design, intent, and structure of -the Project Leaguer tournament organizing software. - -Released under an open license, Project Leaguer leverages powerful web -technologies to provide everything needed to organize an online -tournament. While it is designed with “League of Legends” in mind, it -should provide an online tournament interface that is easy to use for -tournament organizers, participants, and spectators for all kinds of -games, such as Chess, Poker, and more. Even better, Project Leaguer -offers scoring features and options, such as peer review and -team-independent individual scoring, which would be very difficult to -implement with traditional tournament organizing practices. - -The software itself operates as a stand-alone background server application -accessible and configurable though its web interface which reveals to users a -sleek web application which manages tournaments. - -# Non-Functional Requirements - -Security - : Because Project Leaguer servers may store sensitive user - information like name, email, statistics, user-name, profile, - etc. it is an important non-functional requirement that such data - is well secured from both accidental exposure and intentional - tampering. Even so, the System may not be responsible for the - theft of user information or even alterations made to the database - from a source different from that of Leaguer. - -Platform Compatibility - : A non-functional requirement for the system is to be able to run - on multiple platforms. Primarily a web based application, Leaguer - may not be able to install into embedded gaming devices and - special operation systems that do not run the interface that - Leaguer was initially built on. - -Response Time - : Even though the "Model 2" architecture tends to scale well for - medium/large applications and data sets, it is still important to - keep the response time of the system in mind. Using efficient data - structures, short time complexity algorithms, and minimizing - network overhead whenever possible will help to keep the response - time of the system reasonable even for large data sets or complex - statistics or scoring schemes. - - -# Design Outlines - -## Design Decisions and Components - -Project Leaguer is written on the Ruby on Rails platform and will use -the “Model 2” (often mis-identified as “MVC”) design -pattern/architecture. This architecture is comprised of three -interacting components: Controllers, Views, and Models. - -![](DesignDocument-architecture-model2.pdf)\ - -Controllers - : Requests received by the server are processed by a routing - subroutine and directed to a controller responsible for handling - them. Controllers accept these requests and manage any logic - necessary to obtain the correct content for display, retrieving - and updating information from the Model as needed. It then - creates a new request, places the content from the model in the - request (if applicable), decides which view it will be passed to, - and passes on the request. - -Models - : In Ruby on Rails, models are usually implemented as an interface - to a table in the database and a Ruby file which queries this - table and interacts with the other components. For example, a - "user" model would be connected to the "user" table and a file - "user.rb" in the app/models directory would provide an interface - to interact with the "user" controller. - -Views - : Views will primarily be dynamically generated HTML pages and will - display the users desired content inside of the web browser. These - may be implemented with inline Ruby scripts and tags within - traditional HTML. - -## Component Interaction - -Controllers will be used to run all of the background work of Leaguer. They will fetch the necessary data and will tell the view what to do. We will be implementing eight controllers into Leaguer. Those will be: - - i. PM & Alerts – This controller will be used for sending and receiving private messages to and from the host. Players will be able to message the host in order to inform him/her of anything during the tournament. This will also allow the host to post any notifications he or she desires that will be displayed for all to see. - ii. Settings & Homepage – Used to handle the homepage. This will be the first web page seen by any user of the application. - iii. Login – This controller will be used when a user attempts to sign in to their profile on Leaguer. - iv. Search – This controller will be used to search the web-base for on going tournaments, players and past tournaments. - v. Tournament – Used for setting up a tournament. This will be restricted to the host of the tournament. - vi. User – The controller that will take each user to their own profile. - vii. Match/Peer Review – used for gather game statistics and the separate player reviews. -viii. Teams - This controller will be used to handle the separate teams. It will contain: a list of the team's members and will be used to handle team roster modifications. - -Each of these controllers will fetch the data specified by its separate section. The view will then be used to display all of this information, so Login will take the user to a login page, search will take the user to a search page and so on. - -The Model will be the data section that will map all of the information to their proper locations in the data base. - -# Design Issues - -## Scoring Algorithm - -In an effort to keep our system broad, one of our requirements is that Leaguer is adaptable to many competitions, not just League of Legends. How do we assure that the different scoring systems of different sports are represented in Leaguer? - -Option 1 - : One of our interfaces could be “Scoring System” which will be - implemented by many classes with common scoring systems. For - example there would be a implementing class in which the highest - score wins, and one in which the lowest score wins. This is likely - to be the winning option, as there are not too many obscure - scoring systems that we could not think of. - -Option 2 - : We could design an API in which the host writes a method to update - the scoring. This is pretty complex, and while it would allow more - customization, it is hard to imagine completing this task without - first completing option 1. - -## Offline Data Management - -Leaguer manages players and games within tournaments, but it also stores statistics about the games and players themselves. We need a system to store this information after the server-host shuts down the server. - -Option 1 - : Perhaps the simplest and most intuitive option is to implement a - database dump system. The server would dump the information into - an SQL format. All game and player data would be stored to the - host and could be restored to a new server. The host would be - responsible for preserving the data. Additional security measures - could be implemented to help protect data. This option leaves the - users with great control over the data. - -Option 2 - : We could host Leaguer ourselves with our own server. All users - would connect to it instead of to a user-hosted server. Game and - player information would be stored and maintained on Leaguer's - server and the users would not need to manage data themselves, but - instead we would have to host the service. - -## Fetching Data from Games - -Obtaining the statistics from the end of game or match is a vital step in Leaguer's function. A quick and easy method for obtaining this information will ensure smooth usability. - -Option 1 - : In the case of online multiplayer games, such as League of - Legends, it may be possible to obtain the information directly - from the game-hosted server or even websites that already do so. - In the case of League of Legends, `lolking.net` and `lolnexus.com` - already grab statistics from the server automatically. There are - also some open source projects, such as data-hut on GitHub, that - could be used to help extract and categorize the data itself. This - option is complex, but also highly desirable for compatible games, - as it ensures a fast and simple environment for our users. - -Option 2 - : Users manually enter the data themselves. Different games would - require different methods for the users to implement. In the case - of online games, users could take screenshot of a match's score - screen (and then the statistics would be manually entered in), or - a select pool of users could be responsible for recording the - information and then entering it in. This option is tedious and - undesirable. - -Option 3 - : Use Optical Character Recognition to obtain statistics from score - screen screenshots. This option would require someone to take a - screenshot in each match and submit it to Leaguer. This would - require more work than Option 1, but much less than Option 2. An - OCR plugin would have to be implemented for each game and thus - support would be limited from game to game. Outside contributors - could help widen the number of games with OCR support. - -# Design Details -## Class Descriptions and Interactions - -### MODELS - -![](DesignDocument-models.pdf)\ - -ActiveRecord::Base (abstract) - : The abstract model that all other models inherit from. - -Server - : Server model providing access to system settings such as Language, Time_Zone, Server_name, Owner_name, and Version. This class is edited and read by the MainController. - -Tournament - : This model represents the structure of a tournament. It will have several data sections to it including: The match settings, the matches contained inside of the tournament, a unique id for the tournament, and the registered players that are participating in the tournament. This class interacts with a multitude of other model classes (see UML) and all four tournament controllers. - -Match - : A match will be a single set of data that contains all of the statistics of one game. This includes: players personal scores, team members, scores for each team, game time, the tournament that match took place in, and the date. This model interacts with the match controller, and is both a part of and has a many to one relationship with a tournament object. - -Team - : This model will consist of a list of players for a tournament. The team creation process is chosen by the host of the tournament and team setup will either be pre-determined teams or randomly assigned teams. This model interacts with the tournament model class. - -User - : This model represents all types of users; hosts, players, and - spectators. These roles are identified by a “role” attribute. The user is an object that is often referenced by other classes, including tournament, match, and team. - -### VIEWS - -Asynchronous JavaScript may be used to load one view inside of -another. From the core architecture, this does not matter, as the -same HTTP requests are made, though the user interaction is a little -cleaner. - -layouts/application.html (abstract) - : An abstract HTML file, that contains the basic page layout that - all other views inherit. If a user is not logged in, it contains - a login form, and a registration button. The form causes a POST - to `LoginController#login()`, and the button causes a GET to - `UserController#new()`. If a user is logged in, it displays a - logout button that causes a POST to `LoginController#logout()`. - It may contain an alert box of recent alerts submitted by a - tournament host. It contains a search form that is POSTed to - `SearchController#show_results`. If the user is authorized to - publish alerts, it also contains a button that causes the browser - to GET `MessagesController#new_alert()`. - -common/permission_denied.html - : A generic page for when a user attempts to do something for which - they don't have authorization. - -common/invalid.html - : A generic page for handling invalid requests (such as logging out - when not logged in). - -main/homepage.html - : This page is visually simple. In addition to the basic functions - of `layouts/application`, this page has a “Go to Tournament” text - area, in which you enter a tournament title, and will take you to - the relevant tournament page. - -main/edit.html - : This page is a form for editing the server-wide configuration, - such as the language or the graphical theme. The form is - submitted to `MainController#update()`. - -search/results.html - : Shows the results of a search. Each item is clickable and - triggers a GET request to the relevant controller method. - -messages/new_alert.html - : This is a form for a host to submit a new system-wide alert. The - form is POSTed to `MessagesController#post_alert()`. - -messages/private.html - : This page is used to handle user private messaging. It both - displays private messages, and contains a form for sending a new - private message. New messages are POSTed to - `MessageController#post_private()` - -tournaments/index.html - : Shows a list of tournaments. Clicking on any of them causes the - browser GET that tournament via `TournamentController#show()`. If - the user is authorized, it also contains a button that causes the - browser to GET `TournamentsController#new()`. - -tournaments/show.html - : Shows the information for a single tournament. If the user is - authorized, it also shows an “edit” button that triggers a the - browser to GET `TournamentsController#edit()`. This is a - tree-like display of matches, where each match consists of a pair - of teams. All users can click on a match to go to that match’s - page. Host can see a gear on top left corner that represents - tournament settings, it will GET `TournamentsController#edit()`. - There will be an “end” button that will redirect to back to the - homepage after POSTing to `TournamentsController#end()`. - -tournaments/new.html - : A form for creating a new tournament. The form is POSTed to - `TournamentsController#create()`. - -tournaments/edit.html - : A form for editing an existing tournament. The form is POSTed to - `TournamentsController#update()`. - -matches/index.html - : Shows a list of matches. Clicking on any of them causes the - browser to GET that match via `MatchesController#show()`. - -matches/show.html - : Shows an individual match; a display of both teams. Each team's - players are clickable which causes a GET for the player's profile - HTML (`UsersController#show()`). A link above both teams will GET - the tournament the match belongs to - (`TournamentsController#show()`). If the user is authorized, it - also has a button to edit the match by GETting - `MatchesController#edit()`. - -matches/edit.html - : Shows a form to edit a match. The form is POSTed to - `MatchesController#update()`. After a match has been completed, - this included peer-review input by the players. - -teams/index.html - : Shows a list of teams. Clicking any of them causers the browser - to GET that team via `TeamsController#show()`. - -teams/show.html - : Show an individual team, including statistics, and links to - individual members (GET `UsersController#show()`). If the user is - authorized, it also has a button do edit the team by GETting - `TeamsController#edit()`. - -teams/edit.html - : A form to manually edit a team, and its members. The form - contents are POSTed to `TeamsController#update()`. - -users/index.html - : Show a list of users. Clicking any of them causers the browser - to GET that user via `UsersController#show()`. - -users/new.html - : Shows a form for creating a new user. It includes fields for - username, email, password, and other information. The form is - POSTed to `UsersController#create()`; - -users/show.html - : A page with the user's information. One can view the player's - reviews. If the user is authorized, it also has a button do edit - the user by GETting `UsersController#edit()`. - -users/edit.html - : A form to edit a user; including meta-data and tournament - registration. The form is POSTed to `UsersController#update()`. - -### CONTROLLERS - -Any time "assuming the user has permission" it is mentioned, if the -user doesn't have permission, it renders the -`common/permission_denied` view. This also means that the method -interacts with a `User` model to evaluate the permissions. - -ApplicationController (abstract) - : The base controller class that all other controllers inherit from. - -MainController - : This is the main controller. It has the following methods: - - - `show_homepage()` Responds to GET requests by rendering the - `main/homepage` view. - - `edit_settings()` Responds to GET requests by (if the user is - authenticated and is a host) rendering the `main/edit` view that - presents the user with a form to edit the `Server` model's - settings; assuming the user has permission. - - `update_settings()` Responds to POST requests by updating the - `Server` model configuration with the POSTed settings. It then - renders the `main/edit` view with the updated settings. This - assumes the user has the permissions. - -LoginController - : This controller handles session management. It contains two - methods: - - - `login()` Responds to POST requests by setting a session token - identifying the user. If the credentials are correct, it sends - a redirect that directs the browser to the page it would - otherwise be on. If the credentials are not correct, it renders - the `common/permission_denied` view. This queries the `User` - model to validate the username and password. - - `logout()` Responds to POST requests by clearing the session - token, logging the user out, then redirects to the home page - (`MainController#show_homepage()`). If the user was not logged in, - it renders the `common/invalid` view. - -SearchController - : This controller handles user search terms. It has one method: - - - `show_results()` Responds to POST by accessing whichever model(s) - contains the information requested and renders the `search/results` view. - -MessagesController - : This controller handles inter-user messages. It has a couple - methods that respond to GET requests: - - - `new_alert()` Renders the `messages/new_alert` template, - assuming the user has permission. - - `show_private()` Renders the `messages/private template, - assuming the user has permission. - - It also has methods that respond to POST requests: - - - `post_alert()` Publishes a new system-wide alert, assuming the - user has permission. It then redirects the browser to whichever - page it would otherwise be on. - - `post_private()` Sends a new private message, assuming the user - has permission. - -TournamentsController - : The following methods respond to GET requests by rendering the - `tournaments/*` view with the same name: - - - `index()` - - `show()` - - `new()` (assuming the user has permission) - - `edit()` (assuming the user has permission) - - The following methods respond to POST requests, assuming the user - has permission: - - - `create()` Creates a new `Tournament` with the POSTed data. - Then renders the `tournaments/show` view. - - `update()` Updates the specified `Tournament` with the POSTed - data. Then renders the `tournaments/edit` view. - - `end()` Ends the specified `Tournament`. Then redirects to - `MainController#show_hompage()`. - - All of these methods will interact with the `Tournament` model, - and all of its fields including users matches and - TournamentSettings. - -MatchesController - : The following methods respond to GET requests by rendering the - `matches/*` view with the same name: - - - `index()` - - `show()` - - `edit()` - - The following methods respond to POST requests, assuming the user - has permission: - - - `update()` Updates the specified `Match` with the POSTed data. - -TeamsController - : The following methods respond to GET requests by rendering the - `teams/*` view with the same name: - - - `index()` - - `show()` - - `edit()` - - The following methods respond to POST requests, assuming the user - has permission: - - - `update()` Update the specified `Team` with the POSTed data. - -UsersController - : The following methods respond to GET requests by rendering the - `users/*` view with the same name: - - - `index()` - - `show()` - - `new()` - - `edit()` - - The following methods respond to POST requests, assuming the user - has permission: - - - `create()` Creates a new `User` with the POSTed data. - - `update()` Update the specified `User` with the POSTed data. - - `delete()` Deletes the specified `User` account. - -## UML Diagram of Classes - -This diagram does not show all models inheriting from -`ActiveRecord::Base`, all views inheriting from `layouts/application`, -or all controllers inheriting from `ApplicationController`. It -does not show interactions with the `User` model that solely check -authorization to perform an action. It does not show controller -methods calling the error views. It shows transitions from a view to -a controller *only* when that is the *primary* purpose of the view; many -workflows can be interrupted at any time. Arrows between models and -controllers indicate which direction data is flowing. Any data -flowing from a model to the method of a controller is implicitly -passed to the view that method renders. - -![](DesignDocument-classes.pdf)\ diff --git a/docs/Diagram01.jpg b/docs/Diagram01.jpg deleted file mode 100644 index 0c85216..0000000 Binary files a/docs/Diagram01.jpg and /dev/null differ diff --git a/docs/Makefile b/docs/Makefile deleted file mode 100644 index 469b1a2..0000000 --- a/docs/Makefile +++ /dev/null @@ -1,26 +0,0 @@ -docs = $(patsubst %.md,%,$(wildcard *.md)) - -pdf: $(addsuffix .pdf,$(docs)) -html: $(addsuffix .html,$(docs)) - -%.pdf: %.md Makefile - pandoc $($@.args) -s $< -o $@ -%.html: %.md Makefile - pandoc -s $< -o $@ -%.png: %.dot Makefile - dot -Tpng < $< > $@ -%.pdf: %.dot Makefile - dot -Tpdf < $< > $@ -%.pdf: %.pptx Makefile - soffice --headless --convert-to pdf $< - -ProductBacklog.pdf: SystemModel.png -SystemModel.png: stickman.png - -DesignDocument.pdf: DesignDocument-architecture-model2.pdf DesignDocument-models.pdf DesignDocument-classes.pdf -DesignDocument.pdf.args = --table-of-contents --number-sections -f markdown+definition_lists - -clean: - rm -f -- *.pdf *.html - -.DELETE_ON_ERROR: diff --git a/docs/ProductBacklog.md b/docs/ProductBacklog.md deleted file mode 100644 index 59b5e11..0000000 --- a/docs/ProductBacklog.md +++ /dev/null @@ -1,89 +0,0 @@ ---- -title: Team 6 - Leaguer -author: [ Nathaniel Foy, Guntas Grewal, Tomer Kimia, Andrew Murrell, Luke Shumaker, Davis Webb ] ---- - -Problem Statement ------------------ - -In team-based tournament sports, often individual contributions are -overshadowed by the binary end result: win or lose. This -winner-takes-all mentality may unfairly pair players in later stages -of the tournament based on the team's score rather than their own in -early stages. - - -Background ----------- - -Generally, new team based competitions have been managed -electronically using archaic methods. The winning team advances and -the losing team is defeated. In the real world there are many -examples of individual review (as in football) and handicaps (as in -golf). Our goal is to create software that allows teams to compete -and review their peers to more accurately represent modern team -competitions. Our domain is online competition management and -e-sports. The targeted audience is defined on two levels, on a broad -level it is for any individual wishing to manage a competitive event, -on a niche level it is for individuals looking to manage and -participate in team competitions (like League of Legends). - -All existing solutions that we found were limited by the binary -win/lose. Several open-souce options exist, which we could possibly -extend. - -The most prominent of these is "XDojo". It has not been modified in -roughly two years, but has been used for several national -tournaments. Unfortunately, the documentation is not in English. -Because of this, evaluating it for possible adaptation is at the very -least, a spike. - -Another current offering is "OMGT" (Open Manager for Game -Tournaments). It seems to be reasonably well developed and stable, -though the install process is mostly undocumented, and while probably -not very complex, we haven't figured it out yet. - -The third current open source offering looked at was "tournamentmngr", -which seems to be unstable/incomplete. It is written in C#, which -gets in the way of our "easy to install" requirement. - -System Model ------------- - -![](./SystemModel.png)\ - -Requirements ------------- - - - Essential functional requirements - - As a host, I would like to create a new tournament. - - As a host, I would like to set some of the parameters of a - tournamet, such as number of players per team, whether - spectators ar allowed, and game type. - - As a player, I would like to register for a tournament. - - As a host, I would like to assign members to team, or have the - option to randomly assign teams. - - As a player, I would like to rate my peers, and would like to be - reviewed by my peers. - - As a player, or spectator, I would like to see the standings of - all players. - - As a host, or a player, I would like my win/rating history to be - stored so that I can have the same profile throughout many - tournaments. - - Essential non-functional requirements - - As a host, player, or spectator I would like the Project Leaguer - interface to be simple and easy to use. - - As a host, player, or spectator I would like the Project Leaguer - server to be secure and to operate quickly. - - Non-essential functional requirements - - As a host, I would like to be able to send public alerts to - players and spectators. - - As a player, I would like to be able to exchange private - messages with a host. - - As a player or spectator I would like access to Advanced - Tournament Search facilities. - - Non-essential non-functional requirements - - As a player or spectator I would like to utilize an Interactive Menu. - - As a spectator, I would like to be able to watch matches on "Twitch". - - As a player, or a spectator, I would like to be able to access - the service on a mobile device. diff --git a/docs/ProjectCharter.md b/docs/ProjectCharter.md deleted file mode 100644 index f88ccd4..0000000 --- a/docs/ProjectCharter.md +++ /dev/null @@ -1,26 +0,0 @@ -1. In team-based tournament sports, often individual contributions are - overshadowed by the binary end result: win or lose. This - winner-takes-all mentality may unfairly pair players in later - stages of the tournament based on the team's score rather than - their own in early stages. - -2. Project Objectives: - * To address issues of fairness in tournament orchestration and - * To create a general-purpose open source solution for organizing - team-based tournaments where individual performance matters - * by implementing an out-of-the-box open source server software - * capable of managing pairings, scoring, and statistics for a - variety of applicable game types - * accessable via an intuitive web interface. - -3. Stakeholders - the development team, testers, and a future community of users. - -4. A Project Leaguer server provides the user with everything needed - to run a tournament: regisration, pairing, scoring, and statistics, - right away through a simple web interface. Project Leaguer also - gives its users a unique option for scoring, not available through - traditional tournament management techniques: peer review. By - providing a forward facing, web-based interface for tournament - participants to score their teammates, Project Leaguer allows - individual ability and activity to be recognized within the context - of an all-in, win-or-lose multiplayer team game. diff --git a/docs/ProjectLeaguerWorkloadBreakup.md b/docs/ProjectLeaguerWorkloadBreakup.md deleted file mode 100644 index 99d9c2e..0000000 --- a/docs/ProjectLeaguerWorkloadBreakup.md +++ /dev/null @@ -1,14 +0,0 @@ -How to break up workload: - - * Login/Registration/Verification System - * SQL Database Design and Access - * User Interface - * Officiator Interface/Admin Access - * Pairings and Statistics - * Peer Review - * Secure Saved Server Image (backed up user profiles, database, and statistics) - * Separate Game Module Plugins - * General Abstractions - * Unit Testing and Error Handling - * Installing and Running Out-of-the-box - * Icons and Images diff --git a/docs/Sprint1.md b/docs/Sprint1.md deleted file mode 100644 index 03baf5d..0000000 --- a/docs/Sprint1.md +++ /dev/null @@ -1,92 +0,0 @@ ---- -title: "Project Leaguer: Sprint 1" -author: [ Nathaniel Foy, Guntas Grewal, Tomer Kimia, Andrew Murrell, Luke Shumaker, Davis Webb ] ---- - -# User Stories - -1) As an administrator, I would like to install and boot my own server. - - Alternately: As a developer, I would like a demo/testing server, - with a basic Rails setup. -2) As a host/player, I would like to register and have an account. - - For this task, we will be creating the user registration and log - in capabilities for Leaguer. -3) As a host, I would like to start a tournamnet. - - For this task, we will be creating a base tournament system for a - host to run. -4) As a host/player, I would like to enter scores for players. - - For sprint own, the scores will be entered by hand. -5) As an administrator, I want to specify how users become hosts. -6) As a user I would like to see the progress of the tournament in my - browser. -7) As a user, I would like a presentable homepage. - - For this task, we will be creating a Leaguer homepage and ensure that it - is pleasing to the eye and easy to navigate. - -# Tasks - -The "size" is using the modified Fibonacci scale. A '1' is expected -to take less than an hour. A '3' is expected to take 3-6 hours. A -'5' should take the better part of a day or two. An 8 should take -several days. - -+---------------------------------------------------------+------+--------+----+ -| Task Description | Size | Person | US | -+=========================================================+======+========+====+ -| Learn Rails, set up Scaffolding for all Models, Views, | 8 | All | 1 | -| Controllers | | | | -+---------------------------------------------------------+------+--------+----+ -| Deploy rails on the server at 199.180.255.147 | 3 | Luke | 1 | -+---------------------------------------------------------+------+--------+----+ -| Peer review | 1 | All | 1 | -+---------------------------------------------------------+------+--------+----+ -| Create log-in system backend (verification, cookies, | 5 | Davis | 2 | -| and redirection) | | | | -+---------------------------------------------------------+------+--------+----+ -| Create log-in system UI (forms, CSS, and submission) | 2 | Tomer | 2 | -+---------------------------------------------------------+------+--------+----+ -| Test it | 1 | Foy | 2 | -+---------------------------------------------------------+------+--------+----+ -| Peer review | 1 | All | 2 | -+---------------------------------------------------------+------+--------+----+ -| Create Preliminary Tournament Settings Page | 3 | Guntas | 3 | -+---------------------------------------------------------+------+--------+----+ -| Design/Code Scoring/Pairing Algorithms and Procedures | 5 | Foy | 3 | -+---------------------------------------------------------+------+--------+----+ -| Observe Foy Design/Code Scoring/Pairing Algorithms | 2 | Dav+Foy| 3 | -+---------------------------------------------------------+------+--------+----+ -| Implement Tournament Registration and Tournament | 2 | Andrew | 3 | -| Controller | | | | -+---------------------------------------------------------+------+--------+----+ -| Test it | 1 | Andrew | 2 | -+---------------------------------------------------------+------+--------+----+ -| Peer review | 1 | All | 1 | -+---------------------------------------------------------+------+--------+----+ -| Design and implement match score models | 3 | Foy | 4 | -+---------------------------------------------------------+------+--------+----+ -| Implement match controller | 3 | Dav+And| 4 | -+---------------------------------------------------------+------+--------+----+ -| Create a Player-level Data Entry Page/Method for Results| 3 | Tomer | 4 | -+---------------------------------------------------------+------+--------+----+ -| Test it | 1 | Andrew | 2 | -+---------------------------------------------------------+------+--------+----+ -| Peer review | 1 | All | 1 | -+---------------------------------------------------------+------+--------+----+ -| Implement permissions system over the users system | 3 | Luke | 5 | -+---------------------------------------------------------+------+--------+----+ -| Create Admin-level Server Management Page | 2 | Luke | 5 | -+---------------------------------------------------------+------+--------+----+ -| Test it | 1 | Tomer | 2 | -+---------------------------------------------------------+------+--------+----+ -| Peer review | 1 | All | 1 | -+---------------------------------------------------------+------+--------+----+ -| Create View Tournament Page | 5 | All | 6 | -+---------------------------------------------------------+------+--------+----+ -| Test it | 1 | All | 2 | -+---------------------------------------------------------+------+--------+----+ -| Peer review | 1 | All | 1 | -+---------------------------------------------------------+------+--------+----+ -| Create Presentable Homepage | 5 | Guntas | 7 | -+---------------------------------------------------------+------+--------+----+ -| Peer review | 1 | All | 1 | -+---------------------------------------------------------+------+--------+----+ diff --git a/docs/SystemModel.dot b/docs/SystemModel.dot deleted file mode 100644 index ea1836a..0000000 --- a/docs/SystemModel.dot +++ /dev/null @@ -1,60 +0,0 @@ -digraph SystemModel { - rankdir=LR; - peripheries=0; - - /* users */ - { - node [image="stickman.png", labelloc="b", shape="none"]; - player[label="Player"]; - host[label="Host"]; - spectator[label="Spectator"]; - } - - /* subsystems */ - /* if you want to rename any of these, it is probably easiest - * to leave the ID the same, and just change the label */ - subgraph clusterSystem { - label = "System Boundry"; - style = filled; - - node [style=solid]; - peerReview[label="Peer Review"]; - performance[label="Performance"]; - standings[label="Standings"]; - gs[label="Game Score"]; - search[label="Search"]; - pm[label="Private Message"]; - alerts[label="Alerts"]; - pairings[label="Pairings"]; - details[label="Tournament Details"]; - backup[label="Backup"]; - registration[label="Registration"]; - } - - /* all the relationships */ - spectator -> search; - standings -> spectator; - alerts -> spectator; - pairings -> spectator; - - player -> spectator [arrowhead="onormal"]; - player -> peerReview; - player -> performance; - player -> registration; - player -> pm; - pm -> player; - - host->spectator [arrowhead="onormal"]; - host->alerts; - host->details; - host->registration; - host -> pm; - pm -> host; - - peerReview -> standings; - performance-> standings; - gs -> performance; - details -> backup; - details -> pairings; - registration -> pairings; -} diff --git a/docs/stickman.png b/docs/stickman.png deleted file mode 100644 index 00f16fc..0000000 Binary files a/docs/stickman.png and /dev/null differ -- cgit v1.1-4-g5e80 From 65289cfb93599cdad1f3476f2f8728e5b0752779 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sat, 1 Mar 2014 23:20:08 -0500 Subject: doc/.gitignore: ignore generated documentation --- db/migrate/20140304015910_create_servers.rb | 8 -------- db/migrate/20140304015913_create_tournaments.rb | 9 --------- db/migrate/20140304015915_create_matches.rb | 9 --------- db/migrate/20140304015917_create_teams.rb | 8 -------- db/migrate/20140304015922_create_users.rb | 11 ----------- db/migrate/20140304015924_create_user_team_pairs.rb | 10 ---------- db/migrate/20140304015926_create_team_match_pairs.rb | 10 ---------- db/migrate/20140304015928_create_alerts.rb | 10 ---------- db/migrate/20140304015931_create_pms.rb | 11 ----------- db/migrate/20140304015933_create_games.rb | 13 ------------- db/migrate/20140304015935_create_game_attributes.rb | 11 ----------- db/migrate/20140304015938_create_server_settings.rb | 8 -------- db/migrate/20140304015944_create_tournament_options.rb | 8 -------- db/migrate/20140304015955_create_servers.rb | 8 ++++++++ db/migrate/20140304015957_create_tournaments.rb | 9 +++++++++ db/migrate/20140304020000_create_matches.rb | 9 +++++++++ db/migrate/20140304020002_create_teams.rb | 8 ++++++++ db/migrate/20140304020006_create_users.rb | 11 +++++++++++ db/migrate/20140304020009_create_user_team_pairs.rb | 10 ++++++++++ db/migrate/20140304020011_create_team_match_pairs.rb | 10 ++++++++++ db/migrate/20140304020013_create_alerts.rb | 10 ++++++++++ db/migrate/20140304020015_create_pms.rb | 11 +++++++++++ db/migrate/20140304020018_create_games.rb | 13 +++++++++++++ db/migrate/20140304020020_create_game_attributes.rb | 11 +++++++++++ db/migrate/20140304020022_create_server_settings.rb | 8 ++++++++ db/migrate/20140304020029_create_tournament_options.rb | 8 ++++++++ db/schema.rb | 2 +- doc/.gitignore | 9 +++++++-- 28 files changed, 134 insertions(+), 129 deletions(-) delete mode 100644 db/migrate/20140304015910_create_servers.rb delete mode 100644 db/migrate/20140304015913_create_tournaments.rb delete mode 100644 db/migrate/20140304015915_create_matches.rb delete mode 100644 db/migrate/20140304015917_create_teams.rb delete mode 100644 db/migrate/20140304015922_create_users.rb delete mode 100644 db/migrate/20140304015924_create_user_team_pairs.rb delete mode 100644 db/migrate/20140304015926_create_team_match_pairs.rb delete mode 100644 db/migrate/20140304015928_create_alerts.rb delete mode 100644 db/migrate/20140304015931_create_pms.rb delete mode 100644 db/migrate/20140304015933_create_games.rb delete mode 100644 db/migrate/20140304015935_create_game_attributes.rb delete mode 100644 db/migrate/20140304015938_create_server_settings.rb delete mode 100644 db/migrate/20140304015944_create_tournament_options.rb create mode 100644 db/migrate/20140304015955_create_servers.rb create mode 100644 db/migrate/20140304015957_create_tournaments.rb create mode 100644 db/migrate/20140304020000_create_matches.rb create mode 100644 db/migrate/20140304020002_create_teams.rb create mode 100644 db/migrate/20140304020006_create_users.rb create mode 100644 db/migrate/20140304020009_create_user_team_pairs.rb create mode 100644 db/migrate/20140304020011_create_team_match_pairs.rb create mode 100644 db/migrate/20140304020013_create_alerts.rb create mode 100644 db/migrate/20140304020015_create_pms.rb create mode 100644 db/migrate/20140304020018_create_games.rb create mode 100644 db/migrate/20140304020020_create_game_attributes.rb create mode 100644 db/migrate/20140304020022_create_server_settings.rb create mode 100644 db/migrate/20140304020029_create_tournament_options.rb diff --git a/db/migrate/20140304015910_create_servers.rb b/db/migrate/20140304015910_create_servers.rb deleted file mode 100644 index f33241a..0000000 --- a/db/migrate/20140304015910_create_servers.rb +++ /dev/null @@ -1,8 +0,0 @@ -class CreateServers < ActiveRecord::Migration - def change - create_table :servers do |t| - - t.timestamps - end - end -end diff --git a/db/migrate/20140304015913_create_tournaments.rb b/db/migrate/20140304015913_create_tournaments.rb deleted file mode 100644 index 36fcf7e..0000000 --- a/db/migrate/20140304015913_create_tournaments.rb +++ /dev/null @@ -1,9 +0,0 @@ -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/20140304015915_create_matches.rb b/db/migrate/20140304015915_create_matches.rb deleted file mode 100644 index 6c0c157..0000000 --- a/db/migrate/20140304015915_create_matches.rb +++ /dev/null @@ -1,9 +0,0 @@ -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/20140304015917_create_teams.rb b/db/migrate/20140304015917_create_teams.rb deleted file mode 100644 index dd8397d..0000000 --- a/db/migrate/20140304015917_create_teams.rb +++ /dev/null @@ -1,8 +0,0 @@ -class CreateTeams < ActiveRecord::Migration - def change - create_table :teams do |t| - - t.timestamps - end - end -end diff --git a/db/migrate/20140304015922_create_users.rb b/db/migrate/20140304015922_create_users.rb deleted file mode 100644 index f0986d4..0000000 --- a/db/migrate/20140304015922_create_users.rb +++ /dev/null @@ -1,11 +0,0 @@ -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/20140304015924_create_user_team_pairs.rb b/db/migrate/20140304015924_create_user_team_pairs.rb deleted file mode 100644 index 2c492ac..0000000 --- a/db/migrate/20140304015924_create_user_team_pairs.rb +++ /dev/null @@ -1,10 +0,0 @@ -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/20140304015926_create_team_match_pairs.rb b/db/migrate/20140304015926_create_team_match_pairs.rb deleted file mode 100644 index 8fac07e..0000000 --- a/db/migrate/20140304015926_create_team_match_pairs.rb +++ /dev/null @@ -1,10 +0,0 @@ -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/20140304015928_create_alerts.rb b/db/migrate/20140304015928_create_alerts.rb deleted file mode 100644 index 68a8e10..0000000 --- a/db/migrate/20140304015928_create_alerts.rb +++ /dev/null @@ -1,10 +0,0 @@ -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/20140304015931_create_pms.rb b/db/migrate/20140304015931_create_pms.rb deleted file mode 100644 index 93bb5c6..0000000 --- a/db/migrate/20140304015931_create_pms.rb +++ /dev/null @@ -1,11 +0,0 @@ -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/20140304015933_create_games.rb b/db/migrate/20140304015933_create_games.rb deleted file mode 100644 index 59d4ef0..0000000 --- a/db/migrate/20140304015933_create_games.rb +++ /dev/null @@ -1,13 +0,0 @@ -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/20140304015935_create_game_attributes.rb b/db/migrate/20140304015935_create_game_attributes.rb deleted file mode 100644 index b63f134..0000000 --- a/db/migrate/20140304015935_create_game_attributes.rb +++ /dev/null @@ -1,11 +0,0 @@ -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/20140304015938_create_server_settings.rb b/db/migrate/20140304015938_create_server_settings.rb deleted file mode 100644 index dfdd91b..0000000 --- a/db/migrate/20140304015938_create_server_settings.rb +++ /dev/null @@ -1,8 +0,0 @@ -class CreateServerSettings < ActiveRecord::Migration - def change - create_table :server_settings do |t| - - t.timestamps - end - end -end diff --git a/db/migrate/20140304015944_create_tournament_options.rb b/db/migrate/20140304015944_create_tournament_options.rb deleted file mode 100644 index d2df22e..0000000 --- a/db/migrate/20140304015944_create_tournament_options.rb +++ /dev/null @@ -1,8 +0,0 @@ -class CreateTournamentOptions < ActiveRecord::Migration - def change - create_table :tournament_options do |t| - - t.timestamps - end - end -end diff --git a/db/migrate/20140304015955_create_servers.rb b/db/migrate/20140304015955_create_servers.rb new file mode 100644 index 0000000..f33241a --- /dev/null +++ b/db/migrate/20140304015955_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/20140304015957_create_tournaments.rb b/db/migrate/20140304015957_create_tournaments.rb new file mode 100644 index 0000000..36fcf7e --- /dev/null +++ b/db/migrate/20140304015957_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/20140304020000_create_matches.rb b/db/migrate/20140304020000_create_matches.rb new file mode 100644 index 0000000..6c0c157 --- /dev/null +++ b/db/migrate/20140304020000_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/20140304020002_create_teams.rb b/db/migrate/20140304020002_create_teams.rb new file mode 100644 index 0000000..dd8397d --- /dev/null +++ b/db/migrate/20140304020002_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/20140304020006_create_users.rb b/db/migrate/20140304020006_create_users.rb new file mode 100644 index 0000000..f0986d4 --- /dev/null +++ b/db/migrate/20140304020006_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/20140304020009_create_user_team_pairs.rb b/db/migrate/20140304020009_create_user_team_pairs.rb new file mode 100644 index 0000000..2c492ac --- /dev/null +++ b/db/migrate/20140304020009_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/20140304020011_create_team_match_pairs.rb b/db/migrate/20140304020011_create_team_match_pairs.rb new file mode 100644 index 0000000..8fac07e --- /dev/null +++ b/db/migrate/20140304020011_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/20140304020013_create_alerts.rb b/db/migrate/20140304020013_create_alerts.rb new file mode 100644 index 0000000..68a8e10 --- /dev/null +++ b/db/migrate/20140304020013_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/20140304020015_create_pms.rb b/db/migrate/20140304020015_create_pms.rb new file mode 100644 index 0000000..93bb5c6 --- /dev/null +++ b/db/migrate/20140304020015_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/20140304020018_create_games.rb b/db/migrate/20140304020018_create_games.rb new file mode 100644 index 0000000..59d4ef0 --- /dev/null +++ b/db/migrate/20140304020018_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/20140304020020_create_game_attributes.rb b/db/migrate/20140304020020_create_game_attributes.rb new file mode 100644 index 0000000..b63f134 --- /dev/null +++ b/db/migrate/20140304020020_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/20140304020022_create_server_settings.rb b/db/migrate/20140304020022_create_server_settings.rb new file mode 100644 index 0000000..dfdd91b --- /dev/null +++ b/db/migrate/20140304020022_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/20140304020029_create_tournament_options.rb b/db/migrate/20140304020029_create_tournament_options.rb new file mode 100644 index 0000000..d2df22e --- /dev/null +++ b/db/migrate/20140304020029_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 index 2ffb746..196a341 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 20140304015944) do +ActiveRecord::Schema.define(version: 20140304020029) do create_table "alerts", force: true do |t| t.integer "author_id" diff --git a/doc/.gitignore b/doc/.gitignore index ed193ea..54a1602 100644 --- a/doc/.gitignore +++ b/doc/.gitignore @@ -1,4 +1,9 @@ -*.pdf +/api +/app +/guides + *.html +*.pdf *.png -!stickman.png + +!/stickman.png -- cgit v1.1-4-g5e80 From fbe54253ea8c31796a16d0fb90b7d3b5be717b1c Mon Sep 17 00:00:00 2001 From: Tomer Kimia Date: Sun, 2 Mar 2014 11:11:04 -0500 Subject: added preliminary homepage --- app/assets/javascripts/static.js.coffee | 3 +++ app/assets/stylesheets/static.css.scss | 3 +++ app/controllers/static_controller.rb | 2 ++ app/helpers/static_helper.rb | 2 ++ db/migrate/20140304015739_create_servers.rb | 8 -------- db/migrate/20140304015742_create_tournaments.rb | 9 --------- db/migrate/20140304015744_create_matches.rb | 9 --------- db/migrate/20140304015746_create_teams.rb | 8 -------- db/migrate/20140304015751_create_users.rb | 11 ----------- db/migrate/20140304015753_create_user_team_pairs.rb | 10 ---------- db/migrate/20140304015755_create_team_match_pairs.rb | 10 ---------- db/migrate/20140304015757_create_alerts.rb | 10 ---------- db/migrate/20140304015800_create_pms.rb | 11 ----------- db/migrate/20140304015802_create_games.rb | 13 ------------- db/migrate/20140304015804_create_game_attributes.rb | 11 ----------- db/migrate/20140304015807_create_server_settings.rb | 8 -------- db/migrate/20140304015813_create_tournament_options.rb | 8 -------- db/migrate/20140304015824_create_servers.rb | 8 ++++++++ db/migrate/20140304015826_create_tournaments.rb | 9 +++++++++ db/migrate/20140304015828_create_matches.rb | 9 +++++++++ db/migrate/20140304015831_create_teams.rb | 8 ++++++++ db/migrate/20140304015835_create_users.rb | 11 +++++++++++ db/migrate/20140304015837_create_user_team_pairs.rb | 10 ++++++++++ db/migrate/20140304015839_create_team_match_pairs.rb | 10 ++++++++++ db/migrate/20140304015842_create_alerts.rb | 10 ++++++++++ db/migrate/20140304015844_create_pms.rb | 11 +++++++++++ db/migrate/20140304015846_create_games.rb | 13 +++++++++++++ db/migrate/20140304015849_create_game_attributes.rb | 11 +++++++++++ db/migrate/20140304015851_create_server_settings.rb | 8 ++++++++ db/migrate/20140304015859_create_tournament_options.rb | 8 ++++++++ db/schema.rb | 2 +- generate.sh | 1 + spec/controllers/static_controller_spec.rb | 5 +++++ spec/helpers/static_helper_spec.rb | 15 +++++++++++++++ 34 files changed, 158 insertions(+), 127 deletions(-) create mode 100644 app/assets/javascripts/static.js.coffee create mode 100644 app/assets/stylesheets/static.css.scss create mode 100644 app/controllers/static_controller.rb create mode 100644 app/helpers/static_helper.rb delete mode 100644 db/migrate/20140304015739_create_servers.rb delete mode 100644 db/migrate/20140304015742_create_tournaments.rb delete mode 100644 db/migrate/20140304015744_create_matches.rb delete mode 100644 db/migrate/20140304015746_create_teams.rb delete mode 100644 db/migrate/20140304015751_create_users.rb delete mode 100644 db/migrate/20140304015753_create_user_team_pairs.rb delete mode 100644 db/migrate/20140304015755_create_team_match_pairs.rb delete mode 100644 db/migrate/20140304015757_create_alerts.rb delete mode 100644 db/migrate/20140304015800_create_pms.rb delete mode 100644 db/migrate/20140304015802_create_games.rb delete mode 100644 db/migrate/20140304015804_create_game_attributes.rb delete mode 100644 db/migrate/20140304015807_create_server_settings.rb delete mode 100644 db/migrate/20140304015813_create_tournament_options.rb create mode 100644 db/migrate/20140304015824_create_servers.rb create mode 100644 db/migrate/20140304015826_create_tournaments.rb create mode 100644 db/migrate/20140304015828_create_matches.rb create mode 100644 db/migrate/20140304015831_create_teams.rb create mode 100644 db/migrate/20140304015835_create_users.rb create mode 100644 db/migrate/20140304015837_create_user_team_pairs.rb create mode 100644 db/migrate/20140304015839_create_team_match_pairs.rb create mode 100644 db/migrate/20140304015842_create_alerts.rb create mode 100644 db/migrate/20140304015844_create_pms.rb create mode 100644 db/migrate/20140304015846_create_games.rb create mode 100644 db/migrate/20140304015849_create_game_attributes.rb create mode 100644 db/migrate/20140304015851_create_server_settings.rb create mode 100644 db/migrate/20140304015859_create_tournament_options.rb create mode 100644 spec/controllers/static_controller_spec.rb create mode 100644 spec/helpers/static_helper_spec.rb 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/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/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/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/db/migrate/20140304015739_create_servers.rb b/db/migrate/20140304015739_create_servers.rb deleted file mode 100644 index f33241a..0000000 --- a/db/migrate/20140304015739_create_servers.rb +++ /dev/null @@ -1,8 +0,0 @@ -class CreateServers < ActiveRecord::Migration - def change - create_table :servers do |t| - - t.timestamps - end - end -end diff --git a/db/migrate/20140304015742_create_tournaments.rb b/db/migrate/20140304015742_create_tournaments.rb deleted file mode 100644 index 36fcf7e..0000000 --- a/db/migrate/20140304015742_create_tournaments.rb +++ /dev/null @@ -1,9 +0,0 @@ -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/20140304015744_create_matches.rb b/db/migrate/20140304015744_create_matches.rb deleted file mode 100644 index 6c0c157..0000000 --- a/db/migrate/20140304015744_create_matches.rb +++ /dev/null @@ -1,9 +0,0 @@ -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/20140304015746_create_teams.rb b/db/migrate/20140304015746_create_teams.rb deleted file mode 100644 index dd8397d..0000000 --- a/db/migrate/20140304015746_create_teams.rb +++ /dev/null @@ -1,8 +0,0 @@ -class CreateTeams < ActiveRecord::Migration - def change - create_table :teams do |t| - - t.timestamps - end - end -end diff --git a/db/migrate/20140304015751_create_users.rb b/db/migrate/20140304015751_create_users.rb deleted file mode 100644 index f0986d4..0000000 --- a/db/migrate/20140304015751_create_users.rb +++ /dev/null @@ -1,11 +0,0 @@ -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/20140304015753_create_user_team_pairs.rb b/db/migrate/20140304015753_create_user_team_pairs.rb deleted file mode 100644 index 2c492ac..0000000 --- a/db/migrate/20140304015753_create_user_team_pairs.rb +++ /dev/null @@ -1,10 +0,0 @@ -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/20140304015755_create_team_match_pairs.rb b/db/migrate/20140304015755_create_team_match_pairs.rb deleted file mode 100644 index 8fac07e..0000000 --- a/db/migrate/20140304015755_create_team_match_pairs.rb +++ /dev/null @@ -1,10 +0,0 @@ -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/20140304015757_create_alerts.rb b/db/migrate/20140304015757_create_alerts.rb deleted file mode 100644 index 68a8e10..0000000 --- a/db/migrate/20140304015757_create_alerts.rb +++ /dev/null @@ -1,10 +0,0 @@ -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/20140304015800_create_pms.rb b/db/migrate/20140304015800_create_pms.rb deleted file mode 100644 index 93bb5c6..0000000 --- a/db/migrate/20140304015800_create_pms.rb +++ /dev/null @@ -1,11 +0,0 @@ -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/20140304015802_create_games.rb b/db/migrate/20140304015802_create_games.rb deleted file mode 100644 index 59d4ef0..0000000 --- a/db/migrate/20140304015802_create_games.rb +++ /dev/null @@ -1,13 +0,0 @@ -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/20140304015804_create_game_attributes.rb b/db/migrate/20140304015804_create_game_attributes.rb deleted file mode 100644 index b63f134..0000000 --- a/db/migrate/20140304015804_create_game_attributes.rb +++ /dev/null @@ -1,11 +0,0 @@ -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/20140304015807_create_server_settings.rb b/db/migrate/20140304015807_create_server_settings.rb deleted file mode 100644 index dfdd91b..0000000 --- a/db/migrate/20140304015807_create_server_settings.rb +++ /dev/null @@ -1,8 +0,0 @@ -class CreateServerSettings < ActiveRecord::Migration - def change - create_table :server_settings do |t| - - t.timestamps - end - end -end diff --git a/db/migrate/20140304015813_create_tournament_options.rb b/db/migrate/20140304015813_create_tournament_options.rb deleted file mode 100644 index d2df22e..0000000 --- a/db/migrate/20140304015813_create_tournament_options.rb +++ /dev/null @@ -1,8 +0,0 @@ -class CreateTournamentOptions < ActiveRecord::Migration - def change - create_table :tournament_options do |t| - - t.timestamps - end - end -end diff --git a/db/migrate/20140304015824_create_servers.rb b/db/migrate/20140304015824_create_servers.rb new file mode 100644 index 0000000..f33241a --- /dev/null +++ b/db/migrate/20140304015824_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/20140304015826_create_tournaments.rb b/db/migrate/20140304015826_create_tournaments.rb new file mode 100644 index 0000000..36fcf7e --- /dev/null +++ b/db/migrate/20140304015826_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/20140304015828_create_matches.rb b/db/migrate/20140304015828_create_matches.rb new file mode 100644 index 0000000..6c0c157 --- /dev/null +++ b/db/migrate/20140304015828_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/20140304015831_create_teams.rb b/db/migrate/20140304015831_create_teams.rb new file mode 100644 index 0000000..dd8397d --- /dev/null +++ b/db/migrate/20140304015831_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/20140304015835_create_users.rb b/db/migrate/20140304015835_create_users.rb new file mode 100644 index 0000000..f0986d4 --- /dev/null +++ b/db/migrate/20140304015835_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/20140304015837_create_user_team_pairs.rb b/db/migrate/20140304015837_create_user_team_pairs.rb new file mode 100644 index 0000000..2c492ac --- /dev/null +++ b/db/migrate/20140304015837_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/20140304015839_create_team_match_pairs.rb b/db/migrate/20140304015839_create_team_match_pairs.rb new file mode 100644 index 0000000..8fac07e --- /dev/null +++ b/db/migrate/20140304015839_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/20140304015842_create_alerts.rb b/db/migrate/20140304015842_create_alerts.rb new file mode 100644 index 0000000..68a8e10 --- /dev/null +++ b/db/migrate/20140304015842_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/20140304015844_create_pms.rb b/db/migrate/20140304015844_create_pms.rb new file mode 100644 index 0000000..93bb5c6 --- /dev/null +++ b/db/migrate/20140304015844_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/20140304015846_create_games.rb b/db/migrate/20140304015846_create_games.rb new file mode 100644 index 0000000..59d4ef0 --- /dev/null +++ b/db/migrate/20140304015846_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/20140304015849_create_game_attributes.rb b/db/migrate/20140304015849_create_game_attributes.rb new file mode 100644 index 0000000..b63f134 --- /dev/null +++ b/db/migrate/20140304015849_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/20140304015851_create_server_settings.rb b/db/migrate/20140304015851_create_server_settings.rb new file mode 100644 index 0000000..dfdd91b --- /dev/null +++ b/db/migrate/20140304015851_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/20140304015859_create_tournament_options.rb b/db/migrate/20140304015859_create_tournament_options.rb new file mode 100644 index 0000000..d2df22e --- /dev/null +++ b/db/migrate/20140304015859_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 index ae688b1..4e1da7f 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 20140304015813) do +ActiveRecord::Schema.define(version: 20140304015859) do create_table "alerts", force: true do |t| t.integer "author_id" diff --git a/generate.sh b/generate.sh index 2bf027a..807b9ef 100755 --- a/generate.sh +++ b/generate.sh @@ -28,6 +28,7 @@ bundle exec rails generate model game_attribute game:references key:text type:in bundle exec rails generate model server_settings $NOTEST bundle exec rails generate controller search $NOTEST bundle exec rails generate controller main $NOTEST +bundle exec rails generate controller static $NOTEST #for the tournament controller to generate options bundle exec rails generate model tournament_option $NOTEST 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/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 -- cgit v1.1-4-g5e80 From 4e682a9a8596326a2d1faab6c44e5a54918c5ba0 Mon Sep 17 00:00:00 2001 From: DavisLWebb Date: Sun, 2 Mar 2014 15:04:26 -0500 Subject: Gemfile.lock --- Gemfile.lock | 10 +++++----- config/application.rb | 2 ++ db/migrate/20140304015610_create_servers.rb | 8 -------- db/migrate/20140304015612_create_tournaments.rb | 9 --------- db/migrate/20140304015615_create_matches.rb | 9 --------- db/migrate/20140304015617_create_teams.rb | 8 -------- db/migrate/20140304015622_create_users.rb | 11 ----------- db/migrate/20140304015624_create_user_team_pairs.rb | 10 ---------- db/migrate/20140304015626_create_team_match_pairs.rb | 10 ---------- db/migrate/20140304015628_create_alerts.rb | 10 ---------- db/migrate/20140304015631_create_pms.rb | 11 ----------- db/migrate/20140304015633_create_games.rb | 13 ------------- db/migrate/20140304015635_create_game_attributes.rb | 11 ----------- db/migrate/20140304015638_create_server_settings.rb | 8 -------- db/migrate/20140304015644_create_tournament_options.rb | 8 -------- db/migrate/20140304015655_create_servers.rb | 8 ++++++++ db/migrate/20140304015657_create_tournaments.rb | 9 +++++++++ db/migrate/20140304015700_create_matches.rb | 9 +++++++++ db/migrate/20140304015702_create_teams.rb | 8 ++++++++ db/migrate/20140304015706_create_users.rb | 11 +++++++++++ db/migrate/20140304015709_create_user_team_pairs.rb | 10 ++++++++++ db/migrate/20140304015711_create_team_match_pairs.rb | 10 ++++++++++ db/migrate/20140304015713_create_alerts.rb | 10 ++++++++++ db/migrate/20140304015715_create_pms.rb | 11 +++++++++++ db/migrate/20140304015718_create_games.rb | 13 +++++++++++++ db/migrate/20140304015720_create_game_attributes.rb | 11 +++++++++++ db/migrate/20140304015722_create_server_settings.rb | 8 ++++++++ db/migrate/20140304015729_create_tournament_options.rb | 8 ++++++++ db/schema.rb | 2 +- log/.keep | 0 test/controllers/.keep | 0 test/fixtures/.keep | 0 test/helpers/.keep | 0 test/integration/.keep | 0 test/mailers/.keep | 0 test/models/.keep | 0 test/test_helper.rb | 15 --------------- 37 files changed, 134 insertions(+), 147 deletions(-) delete mode 100644 db/migrate/20140304015610_create_servers.rb delete mode 100644 db/migrate/20140304015612_create_tournaments.rb delete mode 100644 db/migrate/20140304015615_create_matches.rb delete mode 100644 db/migrate/20140304015617_create_teams.rb delete mode 100644 db/migrate/20140304015622_create_users.rb delete mode 100644 db/migrate/20140304015624_create_user_team_pairs.rb delete mode 100644 db/migrate/20140304015626_create_team_match_pairs.rb delete mode 100644 db/migrate/20140304015628_create_alerts.rb delete mode 100644 db/migrate/20140304015631_create_pms.rb delete mode 100644 db/migrate/20140304015633_create_games.rb delete mode 100644 db/migrate/20140304015635_create_game_attributes.rb delete mode 100644 db/migrate/20140304015638_create_server_settings.rb delete mode 100644 db/migrate/20140304015644_create_tournament_options.rb create mode 100644 db/migrate/20140304015655_create_servers.rb create mode 100644 db/migrate/20140304015657_create_tournaments.rb create mode 100644 db/migrate/20140304015700_create_matches.rb create mode 100644 db/migrate/20140304015702_create_teams.rb create mode 100644 db/migrate/20140304015706_create_users.rb create mode 100644 db/migrate/20140304015709_create_user_team_pairs.rb create mode 100644 db/migrate/20140304015711_create_team_match_pairs.rb create mode 100644 db/migrate/20140304015713_create_alerts.rb create mode 100644 db/migrate/20140304015715_create_pms.rb create mode 100644 db/migrate/20140304015718_create_games.rb create mode 100644 db/migrate/20140304015720_create_game_attributes.rb create mode 100644 db/migrate/20140304015722_create_server_settings.rb create mode 100644 db/migrate/20140304015729_create_tournament_options.rb delete mode 100644 log/.keep delete mode 100644 test/controllers/.keep delete mode 100644 test/fixtures/.keep delete mode 100644 test/helpers/.keep delete mode 100644 test/integration/.keep delete mode 100644 test/mailers/.keep delete mode 100644 test/models/.keep delete mode 100644 test/test_helper.rb diff --git a/Gemfile.lock b/Gemfile.lock index b47c41e..9dd0199 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -26,7 +26,7 @@ GEM thread_safe (~> 0.1) tzinfo (~> 0.3.37) arel (4.0.2) - atomic (1.1.14) + atomic (1.1.15) bcrypt-ruby (3.1.2) bootstrap-sass (3.1.1.0) sass (~> 3.2) @@ -115,7 +115,7 @@ GEM multi_json (~> 1.0) rubyzip (< 1.0.0) websocket (~> 1.0.4) - sprockets (2.10.1) + sprockets (2.11.0) hike (~> 1.2) multi_json (~> 1.0) rack (~> 1.0) @@ -124,13 +124,13 @@ GEM actionpack (>= 3.0) activesupport (>= 3.0) sprockets (~> 2.8) - sqlite3 (1.3.8) + sqlite3 (1.3.9) therubyracer (0.12.1) libv8 (~> 3.16.14.0) ref thor (0.18.1) - thread_safe (0.1.3) - atomic + thread_safe (0.2.0) + atomic (>= 1.1.7, < 2) tilt (1.4.1) treetop (1.4.15) polyglot diff --git a/config/application.rb b/config/application.rb index bf581b8..57c9163 100644 --- a/config/application.rb +++ b/config/application.rb @@ -12,6 +12,8 @@ module Leaguer # Application configuration should go into files in config/initializers # -- all .rb files in that directory are automatically loaded. + I18n.enforce_available_locales = true + # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone. # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC. # config.time_zone = 'Central Time (US & Canada)' diff --git a/db/migrate/20140304015610_create_servers.rb b/db/migrate/20140304015610_create_servers.rb deleted file mode 100644 index f33241a..0000000 --- a/db/migrate/20140304015610_create_servers.rb +++ /dev/null @@ -1,8 +0,0 @@ -class CreateServers < ActiveRecord::Migration - def change - create_table :servers do |t| - - t.timestamps - end - end -end diff --git a/db/migrate/20140304015612_create_tournaments.rb b/db/migrate/20140304015612_create_tournaments.rb deleted file mode 100644 index 36fcf7e..0000000 --- a/db/migrate/20140304015612_create_tournaments.rb +++ /dev/null @@ -1,9 +0,0 @@ -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/20140304015615_create_matches.rb b/db/migrate/20140304015615_create_matches.rb deleted file mode 100644 index 6c0c157..0000000 --- a/db/migrate/20140304015615_create_matches.rb +++ /dev/null @@ -1,9 +0,0 @@ -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/20140304015617_create_teams.rb b/db/migrate/20140304015617_create_teams.rb deleted file mode 100644 index dd8397d..0000000 --- a/db/migrate/20140304015617_create_teams.rb +++ /dev/null @@ -1,8 +0,0 @@ -class CreateTeams < ActiveRecord::Migration - def change - create_table :teams do |t| - - t.timestamps - end - end -end diff --git a/db/migrate/20140304015622_create_users.rb b/db/migrate/20140304015622_create_users.rb deleted file mode 100644 index f0986d4..0000000 --- a/db/migrate/20140304015622_create_users.rb +++ /dev/null @@ -1,11 +0,0 @@ -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/20140304015624_create_user_team_pairs.rb b/db/migrate/20140304015624_create_user_team_pairs.rb deleted file mode 100644 index 2c492ac..0000000 --- a/db/migrate/20140304015624_create_user_team_pairs.rb +++ /dev/null @@ -1,10 +0,0 @@ -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/20140304015626_create_team_match_pairs.rb b/db/migrate/20140304015626_create_team_match_pairs.rb deleted file mode 100644 index 8fac07e..0000000 --- a/db/migrate/20140304015626_create_team_match_pairs.rb +++ /dev/null @@ -1,10 +0,0 @@ -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/20140304015628_create_alerts.rb b/db/migrate/20140304015628_create_alerts.rb deleted file mode 100644 index 68a8e10..0000000 --- a/db/migrate/20140304015628_create_alerts.rb +++ /dev/null @@ -1,10 +0,0 @@ -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/20140304015631_create_pms.rb b/db/migrate/20140304015631_create_pms.rb deleted file mode 100644 index 93bb5c6..0000000 --- a/db/migrate/20140304015631_create_pms.rb +++ /dev/null @@ -1,11 +0,0 @@ -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/20140304015633_create_games.rb b/db/migrate/20140304015633_create_games.rb deleted file mode 100644 index 59d4ef0..0000000 --- a/db/migrate/20140304015633_create_games.rb +++ /dev/null @@ -1,13 +0,0 @@ -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/20140304015635_create_game_attributes.rb b/db/migrate/20140304015635_create_game_attributes.rb deleted file mode 100644 index b63f134..0000000 --- a/db/migrate/20140304015635_create_game_attributes.rb +++ /dev/null @@ -1,11 +0,0 @@ -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/20140304015638_create_server_settings.rb b/db/migrate/20140304015638_create_server_settings.rb deleted file mode 100644 index dfdd91b..0000000 --- a/db/migrate/20140304015638_create_server_settings.rb +++ /dev/null @@ -1,8 +0,0 @@ -class CreateServerSettings < ActiveRecord::Migration - def change - create_table :server_settings do |t| - - t.timestamps - end - end -end diff --git a/db/migrate/20140304015644_create_tournament_options.rb b/db/migrate/20140304015644_create_tournament_options.rb deleted file mode 100644 index d2df22e..0000000 --- a/db/migrate/20140304015644_create_tournament_options.rb +++ /dev/null @@ -1,8 +0,0 @@ -class CreateTournamentOptions < ActiveRecord::Migration - def change - create_table :tournament_options do |t| - - t.timestamps - end - end -end diff --git a/db/migrate/20140304015655_create_servers.rb b/db/migrate/20140304015655_create_servers.rb new file mode 100644 index 0000000..f33241a --- /dev/null +++ b/db/migrate/20140304015655_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/20140304015657_create_tournaments.rb b/db/migrate/20140304015657_create_tournaments.rb new file mode 100644 index 0000000..36fcf7e --- /dev/null +++ b/db/migrate/20140304015657_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/20140304015700_create_matches.rb b/db/migrate/20140304015700_create_matches.rb new file mode 100644 index 0000000..6c0c157 --- /dev/null +++ b/db/migrate/20140304015700_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/20140304015702_create_teams.rb b/db/migrate/20140304015702_create_teams.rb new file mode 100644 index 0000000..dd8397d --- /dev/null +++ b/db/migrate/20140304015702_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/20140304015706_create_users.rb b/db/migrate/20140304015706_create_users.rb new file mode 100644 index 0000000..f0986d4 --- /dev/null +++ b/db/migrate/20140304015706_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/20140304015709_create_user_team_pairs.rb b/db/migrate/20140304015709_create_user_team_pairs.rb new file mode 100644 index 0000000..2c492ac --- /dev/null +++ b/db/migrate/20140304015709_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/20140304015711_create_team_match_pairs.rb b/db/migrate/20140304015711_create_team_match_pairs.rb new file mode 100644 index 0000000..8fac07e --- /dev/null +++ b/db/migrate/20140304015711_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/20140304015713_create_alerts.rb b/db/migrate/20140304015713_create_alerts.rb new file mode 100644 index 0000000..68a8e10 --- /dev/null +++ b/db/migrate/20140304015713_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/20140304015715_create_pms.rb b/db/migrate/20140304015715_create_pms.rb new file mode 100644 index 0000000..93bb5c6 --- /dev/null +++ b/db/migrate/20140304015715_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/20140304015718_create_games.rb b/db/migrate/20140304015718_create_games.rb new file mode 100644 index 0000000..59d4ef0 --- /dev/null +++ b/db/migrate/20140304015718_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/20140304015720_create_game_attributes.rb b/db/migrate/20140304015720_create_game_attributes.rb new file mode 100644 index 0000000..b63f134 --- /dev/null +++ b/db/migrate/20140304015720_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/20140304015722_create_server_settings.rb b/db/migrate/20140304015722_create_server_settings.rb new file mode 100644 index 0000000..dfdd91b --- /dev/null +++ b/db/migrate/20140304015722_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/20140304015729_create_tournament_options.rb b/db/migrate/20140304015729_create_tournament_options.rb new file mode 100644 index 0000000..d2df22e --- /dev/null +++ b/db/migrate/20140304015729_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 index d44352e..4a44343 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 20140304015644) do +ActiveRecord::Schema.define(version: 20140304015729) do create_table "alerts", force: true do |t| t.integer "author_id" diff --git a/log/.keep b/log/.keep deleted file mode 100644 index e69de29..0000000 diff --git a/test/controllers/.keep b/test/controllers/.keep deleted file mode 100644 index e69de29..0000000 diff --git a/test/fixtures/.keep b/test/fixtures/.keep deleted file mode 100644 index e69de29..0000000 diff --git a/test/helpers/.keep b/test/helpers/.keep deleted file mode 100644 index e69de29..0000000 diff --git a/test/integration/.keep b/test/integration/.keep deleted file mode 100644 index e69de29..0000000 diff --git a/test/mailers/.keep b/test/mailers/.keep deleted file mode 100644 index e69de29..0000000 diff --git a/test/models/.keep b/test/models/.keep deleted file mode 100644 index e69de29..0000000 diff --git a/test/test_helper.rb b/test/test_helper.rb deleted file mode 100644 index bc7e05d..0000000 --- a/test/test_helper.rb +++ /dev/null @@ -1,15 +0,0 @@ -ENV["RAILS_ENV"] ||= "test" -require File.expand_path('../../config/environment', __FILE__) -require 'rails/test_help' - -class ActiveSupport::TestCase - ActiveRecord::Migration.check_pending! - - # Setup all fixtures in test/fixtures/*.yml for all tests in alphabetical order. - # - # Note: You'll currently still have to declare fixtures explicitly in integration tests - # -- they do not yet inherit this setting - fixtures :all - - # Add more helper methods to be used by all tests here... -end -- cgit v1.1-4-g5e80 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:

+ +
    + <% @alert.errors.full_messages.each do |msg| %> +
  • <%= msg %>
  • + <% end %> +
+
+ <% 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:

+ +
    + <% @game.errors.full_messages.each do |msg| %> +
  • <%= msg %>
  • + <% end %> +
+
+ <% 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:

+ +
    + <% @match.errors.full_messages.each do |msg| %> +
  • <%= msg %>
  • + <% end %> +
+
+ <% 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:

+ +
    + <% @pm.errors.full_messages.each do |msg| %> +
  • <%= msg %>
  • + <% end %> +
+
+ <% 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:

+ +
    + <% @server.errors.full_messages.each do |msg| %> +
  • <%= msg %>
  • + <% end %> +
+
+ <% 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:

+ +
    + <% @team.errors.full_messages.each do |msg| %> +
  • <%= msg %>
  • + <% end %> +
+
+ <% 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:

+ +
    + <% @tournament.errors.full_messages.each do |msg| %> +
  • <%= msg %>
  • + <% end %> +
+
+ <% 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 From fd059f33294c86bc5a9fcd718461de992786a223 Mon Sep 17 00:00:00 2001 From: AndrewMurrell Date: Sun, 2 Mar 2014 18:41:22 -0500 Subject: The start script is less obnoxious now. --- db/migrate/20140304020354_create_servers.rb | 8 -------- db/migrate/20140304020356_create_tournaments.rb | 9 --------- db/migrate/20140304020359_create_matches.rb | 9 --------- db/migrate/20140304020401_create_teams.rb | 8 -------- db/migrate/20140304020407_create_users.rb | 11 ----------- db/migrate/20140304020410_create_user_team_pairs.rb | 10 ---------- db/migrate/20140304020412_create_team_match_pairs.rb | 10 ---------- db/migrate/20140304020414_create_alerts.rb | 10 ---------- db/migrate/20140304020416_create_pms.rb | 11 ----------- db/migrate/20140304020419_create_games.rb | 13 ------------- db/migrate/20140304020421_create_game_attributes.rb | 11 ----------- db/migrate/20140304020423_create_server_settings.rb | 8 -------- db/migrate/20140304020432_create_tournament_options.rb | 8 -------- db/migrate/20140304020443_create_servers.rb | 8 ++++++++ db/migrate/20140304020445_create_tournaments.rb | 9 +++++++++ db/migrate/20140304020447_create_matches.rb | 9 +++++++++ db/migrate/20140304020450_create_teams.rb | 8 ++++++++ db/migrate/20140304020456_create_users.rb | 11 +++++++++++ db/migrate/20140304020458_create_user_team_pairs.rb | 10 ++++++++++ db/migrate/20140304020501_create_team_match_pairs.rb | 10 ++++++++++ db/migrate/20140304020503_create_alerts.rb | 10 ++++++++++ db/migrate/20140304020505_create_pms.rb | 11 +++++++++++ db/migrate/20140304020508_create_games.rb | 13 +++++++++++++ db/migrate/20140304020510_create_game_attributes.rb | 11 +++++++++++ db/migrate/20140304020512_create_server_settings.rb | 8 ++++++++ db/migrate/20140304020521_create_tournament_options.rb | 8 ++++++++ db/schema.rb | 2 +- start.sh | 2 +- 28 files changed, 128 insertions(+), 128 deletions(-) delete mode 100644 db/migrate/20140304020354_create_servers.rb delete mode 100644 db/migrate/20140304020356_create_tournaments.rb delete mode 100644 db/migrate/20140304020359_create_matches.rb delete mode 100644 db/migrate/20140304020401_create_teams.rb delete mode 100644 db/migrate/20140304020407_create_users.rb delete mode 100644 db/migrate/20140304020410_create_user_team_pairs.rb delete mode 100644 db/migrate/20140304020412_create_team_match_pairs.rb delete mode 100644 db/migrate/20140304020414_create_alerts.rb delete mode 100644 db/migrate/20140304020416_create_pms.rb delete mode 100644 db/migrate/20140304020419_create_games.rb delete mode 100644 db/migrate/20140304020421_create_game_attributes.rb delete mode 100644 db/migrate/20140304020423_create_server_settings.rb delete mode 100644 db/migrate/20140304020432_create_tournament_options.rb create mode 100644 db/migrate/20140304020443_create_servers.rb create mode 100644 db/migrate/20140304020445_create_tournaments.rb create mode 100644 db/migrate/20140304020447_create_matches.rb create mode 100644 db/migrate/20140304020450_create_teams.rb create mode 100644 db/migrate/20140304020456_create_users.rb create mode 100644 db/migrate/20140304020458_create_user_team_pairs.rb create mode 100644 db/migrate/20140304020501_create_team_match_pairs.rb create mode 100644 db/migrate/20140304020503_create_alerts.rb create mode 100644 db/migrate/20140304020505_create_pms.rb create mode 100644 db/migrate/20140304020508_create_games.rb create mode 100644 db/migrate/20140304020510_create_game_attributes.rb create mode 100644 db/migrate/20140304020512_create_server_settings.rb create mode 100644 db/migrate/20140304020521_create_tournament_options.rb diff --git a/db/migrate/20140304020354_create_servers.rb b/db/migrate/20140304020354_create_servers.rb deleted file mode 100644 index f33241a..0000000 --- a/db/migrate/20140304020354_create_servers.rb +++ /dev/null @@ -1,8 +0,0 @@ -class CreateServers < ActiveRecord::Migration - def change - create_table :servers do |t| - - t.timestamps - end - end -end diff --git a/db/migrate/20140304020356_create_tournaments.rb b/db/migrate/20140304020356_create_tournaments.rb deleted file mode 100644 index 36fcf7e..0000000 --- a/db/migrate/20140304020356_create_tournaments.rb +++ /dev/null @@ -1,9 +0,0 @@ -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/20140304020359_create_matches.rb b/db/migrate/20140304020359_create_matches.rb deleted file mode 100644 index 6c0c157..0000000 --- a/db/migrate/20140304020359_create_matches.rb +++ /dev/null @@ -1,9 +0,0 @@ -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/20140304020401_create_teams.rb b/db/migrate/20140304020401_create_teams.rb deleted file mode 100644 index dd8397d..0000000 --- a/db/migrate/20140304020401_create_teams.rb +++ /dev/null @@ -1,8 +0,0 @@ -class CreateTeams < ActiveRecord::Migration - def change - create_table :teams do |t| - - t.timestamps - end - end -end diff --git a/db/migrate/20140304020407_create_users.rb b/db/migrate/20140304020407_create_users.rb deleted file mode 100644 index f0986d4..0000000 --- a/db/migrate/20140304020407_create_users.rb +++ /dev/null @@ -1,11 +0,0 @@ -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/20140304020410_create_user_team_pairs.rb b/db/migrate/20140304020410_create_user_team_pairs.rb deleted file mode 100644 index 2c492ac..0000000 --- a/db/migrate/20140304020410_create_user_team_pairs.rb +++ /dev/null @@ -1,10 +0,0 @@ -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/20140304020412_create_team_match_pairs.rb b/db/migrate/20140304020412_create_team_match_pairs.rb deleted file mode 100644 index 8fac07e..0000000 --- a/db/migrate/20140304020412_create_team_match_pairs.rb +++ /dev/null @@ -1,10 +0,0 @@ -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/20140304020414_create_alerts.rb b/db/migrate/20140304020414_create_alerts.rb deleted file mode 100644 index 68a8e10..0000000 --- a/db/migrate/20140304020414_create_alerts.rb +++ /dev/null @@ -1,10 +0,0 @@ -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/20140304020416_create_pms.rb b/db/migrate/20140304020416_create_pms.rb deleted file mode 100644 index 93bb5c6..0000000 --- a/db/migrate/20140304020416_create_pms.rb +++ /dev/null @@ -1,11 +0,0 @@ -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/20140304020419_create_games.rb b/db/migrate/20140304020419_create_games.rb deleted file mode 100644 index 59d4ef0..0000000 --- a/db/migrate/20140304020419_create_games.rb +++ /dev/null @@ -1,13 +0,0 @@ -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/20140304020421_create_game_attributes.rb b/db/migrate/20140304020421_create_game_attributes.rb deleted file mode 100644 index b63f134..0000000 --- a/db/migrate/20140304020421_create_game_attributes.rb +++ /dev/null @@ -1,11 +0,0 @@ -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/20140304020423_create_server_settings.rb b/db/migrate/20140304020423_create_server_settings.rb deleted file mode 100644 index dfdd91b..0000000 --- a/db/migrate/20140304020423_create_server_settings.rb +++ /dev/null @@ -1,8 +0,0 @@ -class CreateServerSettings < ActiveRecord::Migration - def change - create_table :server_settings do |t| - - t.timestamps - end - end -end diff --git a/db/migrate/20140304020432_create_tournament_options.rb b/db/migrate/20140304020432_create_tournament_options.rb deleted file mode 100644 index d2df22e..0000000 --- a/db/migrate/20140304020432_create_tournament_options.rb +++ /dev/null @@ -1,8 +0,0 @@ -class CreateTournamentOptions < ActiveRecord::Migration - def change - create_table :tournament_options do |t| - - t.timestamps - end - end -end diff --git a/db/migrate/20140304020443_create_servers.rb b/db/migrate/20140304020443_create_servers.rb new file mode 100644 index 0000000..f33241a --- /dev/null +++ b/db/migrate/20140304020443_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/20140304020445_create_tournaments.rb b/db/migrate/20140304020445_create_tournaments.rb new file mode 100644 index 0000000..36fcf7e --- /dev/null +++ b/db/migrate/20140304020445_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/20140304020447_create_matches.rb b/db/migrate/20140304020447_create_matches.rb new file mode 100644 index 0000000..6c0c157 --- /dev/null +++ b/db/migrate/20140304020447_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/20140304020450_create_teams.rb b/db/migrate/20140304020450_create_teams.rb new file mode 100644 index 0000000..dd8397d --- /dev/null +++ b/db/migrate/20140304020450_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/20140304020456_create_users.rb b/db/migrate/20140304020456_create_users.rb new file mode 100644 index 0000000..f0986d4 --- /dev/null +++ b/db/migrate/20140304020456_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/20140304020458_create_user_team_pairs.rb b/db/migrate/20140304020458_create_user_team_pairs.rb new file mode 100644 index 0000000..2c492ac --- /dev/null +++ b/db/migrate/20140304020458_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/20140304020501_create_team_match_pairs.rb b/db/migrate/20140304020501_create_team_match_pairs.rb new file mode 100644 index 0000000..8fac07e --- /dev/null +++ b/db/migrate/20140304020501_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/20140304020503_create_alerts.rb b/db/migrate/20140304020503_create_alerts.rb new file mode 100644 index 0000000..68a8e10 --- /dev/null +++ b/db/migrate/20140304020503_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/20140304020505_create_pms.rb b/db/migrate/20140304020505_create_pms.rb new file mode 100644 index 0000000..93bb5c6 --- /dev/null +++ b/db/migrate/20140304020505_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/20140304020508_create_games.rb b/db/migrate/20140304020508_create_games.rb new file mode 100644 index 0000000..59d4ef0 --- /dev/null +++ b/db/migrate/20140304020508_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/20140304020510_create_game_attributes.rb b/db/migrate/20140304020510_create_game_attributes.rb new file mode 100644 index 0000000..b63f134 --- /dev/null +++ b/db/migrate/20140304020510_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/20140304020512_create_server_settings.rb b/db/migrate/20140304020512_create_server_settings.rb new file mode 100644 index 0000000..dfdd91b --- /dev/null +++ b/db/migrate/20140304020512_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/20140304020521_create_tournament_options.rb b/db/migrate/20140304020521_create_tournament_options.rb new file mode 100644 index 0000000..d2df22e --- /dev/null +++ b/db/migrate/20140304020521_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 index dc34863..87bf66d 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 20140304020432) do +ActiveRecord::Schema.define(version: 20140304020521) do create_table "alerts", force: true do |t| t.integer "author_id" diff --git a/start.sh b/start.sh index 01b7f72..6c0d594 100755 --- a/start.sh +++ b/start.sh @@ -1,5 +1,5 @@ #!/bin/bash generate.sh -bundle exec rails server 2> server.talk & +nohup bundle exec rails server & -- cgit v1.1-4-g5e80 From c7469584f3fa51666d5df074d012741cbb2f3663 Mon Sep 17 00:00:00 2001 From: AndrewMurrell Date: Sun, 2 Mar 2014 19:10:29 -0500 Subject: Added --force flags for parts of the generator. --- db/migrate/20140304020443_create_servers.rb | 8 -------- db/migrate/20140304020445_create_tournaments.rb | 9 --------- db/migrate/20140304020447_create_matches.rb | 9 --------- db/migrate/20140304020450_create_teams.rb | 8 -------- db/migrate/20140304020456_create_users.rb | 11 ----------- db/migrate/20140304020458_create_user_team_pairs.rb | 10 ---------- db/migrate/20140304020501_create_team_match_pairs.rb | 10 ---------- db/migrate/20140304020503_create_alerts.rb | 10 ---------- db/migrate/20140304020505_create_pms.rb | 11 ----------- db/migrate/20140304020508_create_games.rb | 13 ------------- db/migrate/20140304020510_create_game_attributes.rb | 11 ----------- db/migrate/20140304020512_create_server_settings.rb | 8 -------- db/migrate/20140304020521_create_tournament_options.rb | 8 -------- db/migrate/20140304020531_create_servers.rb | 8 ++++++++ db/migrate/20140304020533_create_tournaments.rb | 9 +++++++++ db/migrate/20140304020536_create_matches.rb | 9 +++++++++ db/migrate/20140304020538_create_teams.rb | 8 ++++++++ db/migrate/20140304020545_create_users.rb | 11 +++++++++++ db/migrate/20140304020547_create_user_team_pairs.rb | 10 ++++++++++ db/migrate/20140304020549_create_team_match_pairs.rb | 10 ++++++++++ db/migrate/20140304020551_create_alerts.rb | 10 ++++++++++ db/migrate/20140304020554_create_pms.rb | 11 +++++++++++ db/migrate/20140304020556_create_games.rb | 13 +++++++++++++ db/migrate/20140304020558_create_game_attributes.rb | 11 +++++++++++ db/migrate/20140304020601_create_server_settings.rb | 8 ++++++++ db/migrate/20140304020609_create_tournament_options.rb | 8 ++++++++ db/schema.rb | 2 +- generate.sh | 6 +++--- 28 files changed, 130 insertions(+), 130 deletions(-) delete mode 100644 db/migrate/20140304020443_create_servers.rb delete mode 100644 db/migrate/20140304020445_create_tournaments.rb delete mode 100644 db/migrate/20140304020447_create_matches.rb delete mode 100644 db/migrate/20140304020450_create_teams.rb delete mode 100644 db/migrate/20140304020456_create_users.rb delete mode 100644 db/migrate/20140304020458_create_user_team_pairs.rb delete mode 100644 db/migrate/20140304020501_create_team_match_pairs.rb delete mode 100644 db/migrate/20140304020503_create_alerts.rb delete mode 100644 db/migrate/20140304020505_create_pms.rb delete mode 100644 db/migrate/20140304020508_create_games.rb delete mode 100644 db/migrate/20140304020510_create_game_attributes.rb delete mode 100644 db/migrate/20140304020512_create_server_settings.rb delete mode 100644 db/migrate/20140304020521_create_tournament_options.rb create mode 100644 db/migrate/20140304020531_create_servers.rb create mode 100644 db/migrate/20140304020533_create_tournaments.rb create mode 100644 db/migrate/20140304020536_create_matches.rb create mode 100644 db/migrate/20140304020538_create_teams.rb create mode 100644 db/migrate/20140304020545_create_users.rb create mode 100644 db/migrate/20140304020547_create_user_team_pairs.rb create mode 100644 db/migrate/20140304020549_create_team_match_pairs.rb create mode 100644 db/migrate/20140304020551_create_alerts.rb create mode 100644 db/migrate/20140304020554_create_pms.rb create mode 100644 db/migrate/20140304020556_create_games.rb create mode 100644 db/migrate/20140304020558_create_game_attributes.rb create mode 100644 db/migrate/20140304020601_create_server_settings.rb create mode 100644 db/migrate/20140304020609_create_tournament_options.rb diff --git a/db/migrate/20140304020443_create_servers.rb b/db/migrate/20140304020443_create_servers.rb deleted file mode 100644 index f33241a..0000000 --- a/db/migrate/20140304020443_create_servers.rb +++ /dev/null @@ -1,8 +0,0 @@ -class CreateServers < ActiveRecord::Migration - def change - create_table :servers do |t| - - t.timestamps - end - end -end diff --git a/db/migrate/20140304020445_create_tournaments.rb b/db/migrate/20140304020445_create_tournaments.rb deleted file mode 100644 index 36fcf7e..0000000 --- a/db/migrate/20140304020445_create_tournaments.rb +++ /dev/null @@ -1,9 +0,0 @@ -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/20140304020447_create_matches.rb b/db/migrate/20140304020447_create_matches.rb deleted file mode 100644 index 6c0c157..0000000 --- a/db/migrate/20140304020447_create_matches.rb +++ /dev/null @@ -1,9 +0,0 @@ -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/20140304020450_create_teams.rb b/db/migrate/20140304020450_create_teams.rb deleted file mode 100644 index dd8397d..0000000 --- a/db/migrate/20140304020450_create_teams.rb +++ /dev/null @@ -1,8 +0,0 @@ -class CreateTeams < ActiveRecord::Migration - def change - create_table :teams do |t| - - t.timestamps - end - end -end diff --git a/db/migrate/20140304020456_create_users.rb b/db/migrate/20140304020456_create_users.rb deleted file mode 100644 index f0986d4..0000000 --- a/db/migrate/20140304020456_create_users.rb +++ /dev/null @@ -1,11 +0,0 @@ -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/20140304020458_create_user_team_pairs.rb b/db/migrate/20140304020458_create_user_team_pairs.rb deleted file mode 100644 index 2c492ac..0000000 --- a/db/migrate/20140304020458_create_user_team_pairs.rb +++ /dev/null @@ -1,10 +0,0 @@ -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/20140304020501_create_team_match_pairs.rb b/db/migrate/20140304020501_create_team_match_pairs.rb deleted file mode 100644 index 8fac07e..0000000 --- a/db/migrate/20140304020501_create_team_match_pairs.rb +++ /dev/null @@ -1,10 +0,0 @@ -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/20140304020503_create_alerts.rb b/db/migrate/20140304020503_create_alerts.rb deleted file mode 100644 index 68a8e10..0000000 --- a/db/migrate/20140304020503_create_alerts.rb +++ /dev/null @@ -1,10 +0,0 @@ -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/20140304020505_create_pms.rb b/db/migrate/20140304020505_create_pms.rb deleted file mode 100644 index 93bb5c6..0000000 --- a/db/migrate/20140304020505_create_pms.rb +++ /dev/null @@ -1,11 +0,0 @@ -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/20140304020508_create_games.rb b/db/migrate/20140304020508_create_games.rb deleted file mode 100644 index 59d4ef0..0000000 --- a/db/migrate/20140304020508_create_games.rb +++ /dev/null @@ -1,13 +0,0 @@ -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/20140304020510_create_game_attributes.rb b/db/migrate/20140304020510_create_game_attributes.rb deleted file mode 100644 index b63f134..0000000 --- a/db/migrate/20140304020510_create_game_attributes.rb +++ /dev/null @@ -1,11 +0,0 @@ -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/20140304020512_create_server_settings.rb b/db/migrate/20140304020512_create_server_settings.rb deleted file mode 100644 index dfdd91b..0000000 --- a/db/migrate/20140304020512_create_server_settings.rb +++ /dev/null @@ -1,8 +0,0 @@ -class CreateServerSettings < ActiveRecord::Migration - def change - create_table :server_settings do |t| - - t.timestamps - end - end -end diff --git a/db/migrate/20140304020521_create_tournament_options.rb b/db/migrate/20140304020521_create_tournament_options.rb deleted file mode 100644 index d2df22e..0000000 --- a/db/migrate/20140304020521_create_tournament_options.rb +++ /dev/null @@ -1,8 +0,0 @@ -class CreateTournamentOptions < ActiveRecord::Migration - def change - create_table :tournament_options do |t| - - t.timestamps - end - end -end diff --git a/db/migrate/20140304020531_create_servers.rb b/db/migrate/20140304020531_create_servers.rb new file mode 100644 index 0000000..f33241a --- /dev/null +++ b/db/migrate/20140304020531_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/20140304020533_create_tournaments.rb b/db/migrate/20140304020533_create_tournaments.rb new file mode 100644 index 0000000..36fcf7e --- /dev/null +++ b/db/migrate/20140304020533_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/20140304020536_create_matches.rb b/db/migrate/20140304020536_create_matches.rb new file mode 100644 index 0000000..6c0c157 --- /dev/null +++ b/db/migrate/20140304020536_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/20140304020538_create_teams.rb b/db/migrate/20140304020538_create_teams.rb new file mode 100644 index 0000000..dd8397d --- /dev/null +++ b/db/migrate/20140304020538_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/20140304020545_create_users.rb b/db/migrate/20140304020545_create_users.rb new file mode 100644 index 0000000..f0986d4 --- /dev/null +++ b/db/migrate/20140304020545_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/20140304020547_create_user_team_pairs.rb b/db/migrate/20140304020547_create_user_team_pairs.rb new file mode 100644 index 0000000..2c492ac --- /dev/null +++ b/db/migrate/20140304020547_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/20140304020549_create_team_match_pairs.rb b/db/migrate/20140304020549_create_team_match_pairs.rb new file mode 100644 index 0000000..8fac07e --- /dev/null +++ b/db/migrate/20140304020549_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/20140304020551_create_alerts.rb b/db/migrate/20140304020551_create_alerts.rb new file mode 100644 index 0000000..68a8e10 --- /dev/null +++ b/db/migrate/20140304020551_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/20140304020554_create_pms.rb b/db/migrate/20140304020554_create_pms.rb new file mode 100644 index 0000000..93bb5c6 --- /dev/null +++ b/db/migrate/20140304020554_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/20140304020556_create_games.rb b/db/migrate/20140304020556_create_games.rb new file mode 100644 index 0000000..59d4ef0 --- /dev/null +++ b/db/migrate/20140304020556_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/20140304020558_create_game_attributes.rb b/db/migrate/20140304020558_create_game_attributes.rb new file mode 100644 index 0000000..b63f134 --- /dev/null +++ b/db/migrate/20140304020558_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/20140304020601_create_server_settings.rb b/db/migrate/20140304020601_create_server_settings.rb new file mode 100644 index 0000000..dfdd91b --- /dev/null +++ b/db/migrate/20140304020601_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/20140304020609_create_tournament_options.rb b/db/migrate/20140304020609_create_tournament_options.rb new file mode 100644 index 0000000..d2df22e --- /dev/null +++ b/db/migrate/20140304020609_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 index 87bf66d..847a686 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 20140304020521) do +ActiveRecord::Schema.define(version: 20140304020609) do create_table "alerts", force: true do |t| t.integer "author_id" diff --git a/generate.sh b/generate.sh index 7f70d56..ea96b9b 100755 --- a/generate.sh +++ b/generate.sh @@ -13,9 +13,9 @@ NOTEST='--skip-test-unit' set -x -bundle exec rails generate scaffold server $NOTEST -bundle exec rails generate scaffold tournament game:references $NOTEST -bundle exec rails generate scaffold match tournament:references $NOTEST +bundle exec rails generate scaffold server --force $NOTEST +bundle exec rails generate scaffold tournament game:references --force $NOTEST +bundle exec rails generate scaffold match tournament:references --force $NOTEST bundle exec rails generate scaffold team $NOTEST bundle exec rails generate controller users $NOTEST bundle exec rails generate controller Sessions -- cgit v1.1-4-g5e80 From fefe3f469243d6c932c256cc8798bae35e4ff1c4 Mon Sep 17 00:00:00 2001 From: AndrewMurrell Date: Sun, 2 Mar 2014 21:10:49 -0500 Subject: Added Tournament Name. --- app/controllers/matches_controller.rb | 2 +- app/views/matches/_form.html.erb | 4 ++++ app/views/matches/index.html.erb | 2 ++ app/views/matches/index.json.jbuilder | 2 +- app/views/matches/show.html.erb | 5 +++++ app/views/matches/show.json.jbuilder | 2 +- db/migrate/20140304020531_create_servers.rb | 8 -------- db/migrate/20140304020533_create_tournaments.rb | 9 --------- db/migrate/20140304020536_create_matches.rb | 9 --------- db/migrate/20140304020538_create_teams.rb | 8 -------- db/migrate/20140304020545_create_users.rb | 11 ----------- db/migrate/20140304020547_create_user_team_pairs.rb | 10 ---------- db/migrate/20140304020549_create_team_match_pairs.rb | 10 ---------- db/migrate/20140304020551_create_alerts.rb | 10 ---------- db/migrate/20140304020554_create_pms.rb | 11 ----------- db/migrate/20140304020556_create_games.rb | 13 ------------- db/migrate/20140304020558_create_game_attributes.rb | 11 ----------- db/migrate/20140304020601_create_server_settings.rb | 8 -------- db/migrate/20140304020609_create_tournament_options.rb | 8 -------- db/migrate/20140304020709_create_servers.rb | 8 ++++++++ db/migrate/20140304020711_create_tournaments.rb | 9 +++++++++ db/migrate/20140304020713_create_matches.rb | 10 ++++++++++ db/migrate/20140304020716_create_teams.rb | 8 ++++++++ db/migrate/20140304020722_create_users.rb | 11 +++++++++++ db/migrate/20140304020724_create_user_team_pairs.rb | 10 ++++++++++ db/migrate/20140304020727_create_team_match_pairs.rb | 10 ++++++++++ db/migrate/20140304020729_create_alerts.rb | 10 ++++++++++ db/migrate/20140304020731_create_pms.rb | 11 +++++++++++ db/migrate/20140304020733_create_games.rb | 13 +++++++++++++ db/migrate/20140304020736_create_game_attributes.rb | 11 +++++++++++ db/migrate/20140304020738_create_server_settings.rb | 8 ++++++++ db/migrate/20140304020747_create_tournament_options.rb | 8 ++++++++ db/schema.rb | 3 ++- generate.sh | 2 +- spec/views/matches/edit.html.erb_spec.rb | 4 +++- spec/views/matches/index.html.erb_spec.rb | 7 +++++-- spec/views/matches/new.html.erb_spec.rb | 4 +++- spec/views/matches/show.html.erb_spec.rb | 4 +++- 38 files changed, 158 insertions(+), 136 deletions(-) delete mode 100644 db/migrate/20140304020531_create_servers.rb delete mode 100644 db/migrate/20140304020533_create_tournaments.rb delete mode 100644 db/migrate/20140304020536_create_matches.rb delete mode 100644 db/migrate/20140304020538_create_teams.rb delete mode 100644 db/migrate/20140304020545_create_users.rb delete mode 100644 db/migrate/20140304020547_create_user_team_pairs.rb delete mode 100644 db/migrate/20140304020549_create_team_match_pairs.rb delete mode 100644 db/migrate/20140304020551_create_alerts.rb delete mode 100644 db/migrate/20140304020554_create_pms.rb delete mode 100644 db/migrate/20140304020556_create_games.rb delete mode 100644 db/migrate/20140304020558_create_game_attributes.rb delete mode 100644 db/migrate/20140304020601_create_server_settings.rb delete mode 100644 db/migrate/20140304020609_create_tournament_options.rb create mode 100644 db/migrate/20140304020709_create_servers.rb create mode 100644 db/migrate/20140304020711_create_tournaments.rb create mode 100644 db/migrate/20140304020713_create_matches.rb create mode 100644 db/migrate/20140304020716_create_teams.rb create mode 100644 db/migrate/20140304020722_create_users.rb create mode 100644 db/migrate/20140304020724_create_user_team_pairs.rb create mode 100644 db/migrate/20140304020727_create_team_match_pairs.rb create mode 100644 db/migrate/20140304020729_create_alerts.rb create mode 100644 db/migrate/20140304020731_create_pms.rb create mode 100644 db/migrate/20140304020733_create_games.rb create mode 100644 db/migrate/20140304020736_create_game_attributes.rb create mode 100644 db/migrate/20140304020738_create_server_settings.rb create mode 100644 db/migrate/20140304020747_create_tournament_options.rb diff --git a/app/controllers/matches_controller.rb b/app/controllers/matches_controller.rb index e9f3c5a..984be3f 100644 --- a/app/controllers/matches_controller.rb +++ b/app/controllers/matches_controller.rb @@ -69,6 +69,6 @@ class MatchesController < ApplicationController # Never trust parameters from the scary internet, only allow the white list through. def match_params - params.require(:match).permit(:tournament_id) + params.require(:match).permit(:tournament_id, :name) end end diff --git a/app/views/matches/_form.html.erb b/app/views/matches/_form.html.erb index 34494c3..c5f1ba8 100644 --- a/app/views/matches/_form.html.erb +++ b/app/views/matches/_form.html.erb @@ -15,6 +15,10 @@ <%= f.label :tournament_id %>
<%= f.text_field :tournament_id %> +

+ <%= f.label :name %>
+ <%= f.text_field :name %> +
<%= f.submit %>
diff --git a/app/views/matches/index.html.erb b/app/views/matches/index.html.erb index d8122ac..0742770 100644 --- a/app/views/matches/index.html.erb +++ b/app/views/matches/index.html.erb @@ -4,6 +4,7 @@ Tournament + Name @@ -14,6 +15,7 @@ <% @matches.each do |match| %> <%= match.tournament %> + <%= match.name %> <%= link_to 'Show', match %> <%= link_to 'Edit', edit_match_path(match) %> <%= link_to 'Destroy', match, method: :delete, data: { confirm: 'Are you sure?' } %> diff --git a/app/views/matches/index.json.jbuilder b/app/views/matches/index.json.jbuilder index c8ada7a..08ae0ef 100644 --- a/app/views/matches/index.json.jbuilder +++ b/app/views/matches/index.json.jbuilder @@ -1,4 +1,4 @@ json.array!(@matches) do |match| - json.extract! match, :id, :tournament_id + json.extract! match, :id, :tournament_id, :name json.url match_url(match, format: :json) end diff --git a/app/views/matches/show.html.erb b/app/views/matches/show.html.erb index 7bab721..0b02ae7 100644 --- a/app/views/matches/show.html.erb +++ b/app/views/matches/show.html.erb @@ -5,5 +5,10 @@ <%= @match.tournament %>

+

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

+ <%= 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 index 2e45395..128550f 100644 --- a/app/views/matches/show.json.jbuilder +++ b/app/views/matches/show.json.jbuilder @@ -1 +1 @@ -json.extract! @match, :id, :tournament_id, :created_at, :updated_at +json.extract! @match, :id, :tournament_id, :name, :created_at, :updated_at diff --git a/db/migrate/20140304020531_create_servers.rb b/db/migrate/20140304020531_create_servers.rb deleted file mode 100644 index f33241a..0000000 --- a/db/migrate/20140304020531_create_servers.rb +++ /dev/null @@ -1,8 +0,0 @@ -class CreateServers < ActiveRecord::Migration - def change - create_table :servers do |t| - - t.timestamps - end - end -end diff --git a/db/migrate/20140304020533_create_tournaments.rb b/db/migrate/20140304020533_create_tournaments.rb deleted file mode 100644 index 36fcf7e..0000000 --- a/db/migrate/20140304020533_create_tournaments.rb +++ /dev/null @@ -1,9 +0,0 @@ -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/20140304020536_create_matches.rb b/db/migrate/20140304020536_create_matches.rb deleted file mode 100644 index 6c0c157..0000000 --- a/db/migrate/20140304020536_create_matches.rb +++ /dev/null @@ -1,9 +0,0 @@ -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/20140304020538_create_teams.rb b/db/migrate/20140304020538_create_teams.rb deleted file mode 100644 index dd8397d..0000000 --- a/db/migrate/20140304020538_create_teams.rb +++ /dev/null @@ -1,8 +0,0 @@ -class CreateTeams < ActiveRecord::Migration - def change - create_table :teams do |t| - - t.timestamps - end - end -end diff --git a/db/migrate/20140304020545_create_users.rb b/db/migrate/20140304020545_create_users.rb deleted file mode 100644 index f0986d4..0000000 --- a/db/migrate/20140304020545_create_users.rb +++ /dev/null @@ -1,11 +0,0 @@ -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/20140304020547_create_user_team_pairs.rb b/db/migrate/20140304020547_create_user_team_pairs.rb deleted file mode 100644 index 2c492ac..0000000 --- a/db/migrate/20140304020547_create_user_team_pairs.rb +++ /dev/null @@ -1,10 +0,0 @@ -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/20140304020549_create_team_match_pairs.rb b/db/migrate/20140304020549_create_team_match_pairs.rb deleted file mode 100644 index 8fac07e..0000000 --- a/db/migrate/20140304020549_create_team_match_pairs.rb +++ /dev/null @@ -1,10 +0,0 @@ -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/20140304020551_create_alerts.rb b/db/migrate/20140304020551_create_alerts.rb deleted file mode 100644 index 68a8e10..0000000 --- a/db/migrate/20140304020551_create_alerts.rb +++ /dev/null @@ -1,10 +0,0 @@ -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/20140304020554_create_pms.rb b/db/migrate/20140304020554_create_pms.rb deleted file mode 100644 index 93bb5c6..0000000 --- a/db/migrate/20140304020554_create_pms.rb +++ /dev/null @@ -1,11 +0,0 @@ -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/20140304020556_create_games.rb b/db/migrate/20140304020556_create_games.rb deleted file mode 100644 index 59d4ef0..0000000 --- a/db/migrate/20140304020556_create_games.rb +++ /dev/null @@ -1,13 +0,0 @@ -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/20140304020558_create_game_attributes.rb b/db/migrate/20140304020558_create_game_attributes.rb deleted file mode 100644 index b63f134..0000000 --- a/db/migrate/20140304020558_create_game_attributes.rb +++ /dev/null @@ -1,11 +0,0 @@ -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/20140304020601_create_server_settings.rb b/db/migrate/20140304020601_create_server_settings.rb deleted file mode 100644 index dfdd91b..0000000 --- a/db/migrate/20140304020601_create_server_settings.rb +++ /dev/null @@ -1,8 +0,0 @@ -class CreateServerSettings < ActiveRecord::Migration - def change - create_table :server_settings do |t| - - t.timestamps - end - end -end diff --git a/db/migrate/20140304020609_create_tournament_options.rb b/db/migrate/20140304020609_create_tournament_options.rb deleted file mode 100644 index d2df22e..0000000 --- a/db/migrate/20140304020609_create_tournament_options.rb +++ /dev/null @@ -1,8 +0,0 @@ -class CreateTournamentOptions < ActiveRecord::Migration - def change - create_table :tournament_options do |t| - - t.timestamps - end - end -end diff --git a/db/migrate/20140304020709_create_servers.rb b/db/migrate/20140304020709_create_servers.rb new file mode 100644 index 0000000..f33241a --- /dev/null +++ b/db/migrate/20140304020709_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/20140304020711_create_tournaments.rb b/db/migrate/20140304020711_create_tournaments.rb new file mode 100644 index 0000000..36fcf7e --- /dev/null +++ b/db/migrate/20140304020711_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/20140304020713_create_matches.rb b/db/migrate/20140304020713_create_matches.rb new file mode 100644 index 0000000..325863d --- /dev/null +++ b/db/migrate/20140304020713_create_matches.rb @@ -0,0 +1,10 @@ +class CreateMatches < ActiveRecord::Migration + def change + create_table :matches do |t| + t.references :tournament, index: true + t.string :name + + t.timestamps + end + end +end diff --git a/db/migrate/20140304020716_create_teams.rb b/db/migrate/20140304020716_create_teams.rb new file mode 100644 index 0000000..dd8397d --- /dev/null +++ b/db/migrate/20140304020716_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/20140304020722_create_users.rb b/db/migrate/20140304020722_create_users.rb new file mode 100644 index 0000000..f0986d4 --- /dev/null +++ b/db/migrate/20140304020722_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/20140304020724_create_user_team_pairs.rb b/db/migrate/20140304020724_create_user_team_pairs.rb new file mode 100644 index 0000000..2c492ac --- /dev/null +++ b/db/migrate/20140304020724_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/20140304020727_create_team_match_pairs.rb b/db/migrate/20140304020727_create_team_match_pairs.rb new file mode 100644 index 0000000..8fac07e --- /dev/null +++ b/db/migrate/20140304020727_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/20140304020729_create_alerts.rb b/db/migrate/20140304020729_create_alerts.rb new file mode 100644 index 0000000..68a8e10 --- /dev/null +++ b/db/migrate/20140304020729_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/20140304020731_create_pms.rb b/db/migrate/20140304020731_create_pms.rb new file mode 100644 index 0000000..93bb5c6 --- /dev/null +++ b/db/migrate/20140304020731_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/20140304020733_create_games.rb b/db/migrate/20140304020733_create_games.rb new file mode 100644 index 0000000..59d4ef0 --- /dev/null +++ b/db/migrate/20140304020733_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/20140304020736_create_game_attributes.rb b/db/migrate/20140304020736_create_game_attributes.rb new file mode 100644 index 0000000..b63f134 --- /dev/null +++ b/db/migrate/20140304020736_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/20140304020738_create_server_settings.rb b/db/migrate/20140304020738_create_server_settings.rb new file mode 100644 index 0000000..dfdd91b --- /dev/null +++ b/db/migrate/20140304020738_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/20140304020747_create_tournament_options.rb b/db/migrate/20140304020747_create_tournament_options.rb new file mode 100644 index 0000000..d2df22e --- /dev/null +++ b/db/migrate/20140304020747_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 index 847a686..9069230 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 20140304020609) do +ActiveRecord::Schema.define(version: 20140304020747) do create_table "alerts", force: true do |t| t.integer "author_id" @@ -44,6 +44,7 @@ ActiveRecord::Schema.define(version: 20140304020609) do create_table "matches", force: true do |t| t.integer "tournament_id" + t.string "name" t.datetime "created_at" t.datetime "updated_at" end diff --git a/generate.sh b/generate.sh index ea96b9b..336ea5b 100755 --- a/generate.sh +++ b/generate.sh @@ -15,7 +15,7 @@ NOTEST='--skip-test-unit' set -x bundle exec rails generate scaffold server --force $NOTEST bundle exec rails generate scaffold tournament game:references --force $NOTEST -bundle exec rails generate scaffold match tournament:references --force $NOTEST +bundle exec rails generate scaffold match tournament:references name:string --force $NOTEST bundle exec rails generate scaffold team $NOTEST bundle exec rails generate controller users $NOTEST bundle exec rails generate controller Sessions diff --git a/spec/views/matches/edit.html.erb_spec.rb b/spec/views/matches/edit.html.erb_spec.rb index 0f7c673..fca468f 100644 --- a/spec/views/matches/edit.html.erb_spec.rb +++ b/spec/views/matches/edit.html.erb_spec.rb @@ -3,7 +3,8 @@ require 'spec_helper' describe "matches/edit" do before(:each) do @match = assign(:match, stub_model(Match, - :tournament => nil + :tournament => nil, + :name => "MyString" )) end @@ -13,6 +14,7 @@ describe "matches/edit" do # 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]" + assert_select "input#match_name[name=?]", "match[name]" end end end diff --git a/spec/views/matches/index.html.erb_spec.rb b/spec/views/matches/index.html.erb_spec.rb index e920f16..d3be1b5 100644 --- a/spec/views/matches/index.html.erb_spec.rb +++ b/spec/views/matches/index.html.erb_spec.rb @@ -4,10 +4,12 @@ describe "matches/index" do before(:each) do assign(:matches, [ stub_model(Match, - :tournament => nil + :tournament => nil, + :name => "Name" ), stub_model(Match, - :tournament => nil + :tournament => nil, + :name => "Name" ) ]) end @@ -16,5 +18,6 @@ describe "matches/index" 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 => "Name".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 index c3537dc..4423d2c 100644 --- a/spec/views/matches/new.html.erb_spec.rb +++ b/spec/views/matches/new.html.erb_spec.rb @@ -3,7 +3,8 @@ require 'spec_helper' describe "matches/new" do before(:each) do assign(:match, stub_model(Match, - :tournament => nil + :tournament => nil, + :name => "MyString" ).as_new_record) end @@ -13,6 +14,7 @@ describe "matches/new" do # 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]" + assert_select "input#match_name[name=?]", "match[name]" end end end diff --git a/spec/views/matches/show.html.erb_spec.rb b/spec/views/matches/show.html.erb_spec.rb index 4460feb..642119d 100644 --- a/spec/views/matches/show.html.erb_spec.rb +++ b/spec/views/matches/show.html.erb_spec.rb @@ -3,7 +3,8 @@ require 'spec_helper' describe "matches/show" do before(:each) do @match = assign(:match, stub_model(Match, - :tournament => nil + :tournament => nil, + :name => "Name" )) end @@ -11,5 +12,6 @@ describe "matches/show" do render # Run the generator again with the --webrat flag if you want to use webrat matchers rendered.should match(//) + rendered.should match(/Name/) end end -- cgit v1.1-4-g5e80 From ec0ee835e8671fc5a421b7e7bcb54d4eec6deedb Mon Sep 17 00:00:00 2001 From: DavisLWebb Date: Sun, 2 Mar 2014 21:14:29 -0500 Subject: changed the generate.sh --- db/migrate/20140304020531_create_servers.rb | 8 -------- db/migrate/20140304020533_create_tournaments.rb | 9 --------- db/migrate/20140304020536_create_matches.rb | 9 --------- db/migrate/20140304020538_create_teams.rb | 8 -------- db/migrate/20140304020545_create_users.rb | 11 ----------- db/migrate/20140304020547_create_user_team_pairs.rb | 10 ---------- db/migrate/20140304020549_create_team_match_pairs.rb | 10 ---------- db/migrate/20140304020551_create_alerts.rb | 10 ---------- db/migrate/20140304020554_create_pms.rb | 11 ----------- db/migrate/20140304020556_create_games.rb | 13 ------------- db/migrate/20140304020558_create_game_attributes.rb | 11 ----------- db/migrate/20140304020601_create_server_settings.rb | 8 -------- db/migrate/20140304020609_create_tournament_options.rb | 8 -------- db/migrate/20140304020620_create_servers.rb | 8 ++++++++ db/migrate/20140304020622_create_tournaments.rb | 9 +++++++++ db/migrate/20140304020625_create_matches.rb | 9 +++++++++ db/migrate/20140304020627_create_teams.rb | 8 ++++++++ db/migrate/20140304020633_create_users.rb | 11 +++++++++++ db/migrate/20140304020636_create_user_team_pairs.rb | 10 ++++++++++ db/migrate/20140304020638_create_team_match_pairs.rb | 10 ++++++++++ db/migrate/20140304020640_create_alerts.rb | 10 ++++++++++ db/migrate/20140304020642_create_pms.rb | 11 +++++++++++ db/migrate/20140304020645_create_games.rb | 13 +++++++++++++ db/migrate/20140304020647_create_game_attributes.rb | 11 +++++++++++ db/migrate/20140304020649_create_server_settings.rb | 8 ++++++++ db/migrate/20140304020658_create_tournament_options.rb | 8 ++++++++ db/schema.rb | 2 +- generate.sh | 7 +++++++ 28 files changed, 134 insertions(+), 127 deletions(-) delete mode 100644 db/migrate/20140304020531_create_servers.rb delete mode 100644 db/migrate/20140304020533_create_tournaments.rb delete mode 100644 db/migrate/20140304020536_create_matches.rb delete mode 100644 db/migrate/20140304020538_create_teams.rb delete mode 100644 db/migrate/20140304020545_create_users.rb delete mode 100644 db/migrate/20140304020547_create_user_team_pairs.rb delete mode 100644 db/migrate/20140304020549_create_team_match_pairs.rb delete mode 100644 db/migrate/20140304020551_create_alerts.rb delete mode 100644 db/migrate/20140304020554_create_pms.rb delete mode 100644 db/migrate/20140304020556_create_games.rb delete mode 100644 db/migrate/20140304020558_create_game_attributes.rb delete mode 100644 db/migrate/20140304020601_create_server_settings.rb delete mode 100644 db/migrate/20140304020609_create_tournament_options.rb create mode 100644 db/migrate/20140304020620_create_servers.rb create mode 100644 db/migrate/20140304020622_create_tournaments.rb create mode 100644 db/migrate/20140304020625_create_matches.rb create mode 100644 db/migrate/20140304020627_create_teams.rb create mode 100644 db/migrate/20140304020633_create_users.rb create mode 100644 db/migrate/20140304020636_create_user_team_pairs.rb create mode 100644 db/migrate/20140304020638_create_team_match_pairs.rb create mode 100644 db/migrate/20140304020640_create_alerts.rb create mode 100644 db/migrate/20140304020642_create_pms.rb create mode 100644 db/migrate/20140304020645_create_games.rb create mode 100644 db/migrate/20140304020647_create_game_attributes.rb create mode 100644 db/migrate/20140304020649_create_server_settings.rb create mode 100644 db/migrate/20140304020658_create_tournament_options.rb diff --git a/db/migrate/20140304020531_create_servers.rb b/db/migrate/20140304020531_create_servers.rb deleted file mode 100644 index f33241a..0000000 --- a/db/migrate/20140304020531_create_servers.rb +++ /dev/null @@ -1,8 +0,0 @@ -class CreateServers < ActiveRecord::Migration - def change - create_table :servers do |t| - - t.timestamps - end - end -end diff --git a/db/migrate/20140304020533_create_tournaments.rb b/db/migrate/20140304020533_create_tournaments.rb deleted file mode 100644 index 36fcf7e..0000000 --- a/db/migrate/20140304020533_create_tournaments.rb +++ /dev/null @@ -1,9 +0,0 @@ -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/20140304020536_create_matches.rb b/db/migrate/20140304020536_create_matches.rb deleted file mode 100644 index 6c0c157..0000000 --- a/db/migrate/20140304020536_create_matches.rb +++ /dev/null @@ -1,9 +0,0 @@ -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/20140304020538_create_teams.rb b/db/migrate/20140304020538_create_teams.rb deleted file mode 100644 index dd8397d..0000000 --- a/db/migrate/20140304020538_create_teams.rb +++ /dev/null @@ -1,8 +0,0 @@ -class CreateTeams < ActiveRecord::Migration - def change - create_table :teams do |t| - - t.timestamps - end - end -end diff --git a/db/migrate/20140304020545_create_users.rb b/db/migrate/20140304020545_create_users.rb deleted file mode 100644 index f0986d4..0000000 --- a/db/migrate/20140304020545_create_users.rb +++ /dev/null @@ -1,11 +0,0 @@ -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/20140304020547_create_user_team_pairs.rb b/db/migrate/20140304020547_create_user_team_pairs.rb deleted file mode 100644 index 2c492ac..0000000 --- a/db/migrate/20140304020547_create_user_team_pairs.rb +++ /dev/null @@ -1,10 +0,0 @@ -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/20140304020549_create_team_match_pairs.rb b/db/migrate/20140304020549_create_team_match_pairs.rb deleted file mode 100644 index 8fac07e..0000000 --- a/db/migrate/20140304020549_create_team_match_pairs.rb +++ /dev/null @@ -1,10 +0,0 @@ -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/20140304020551_create_alerts.rb b/db/migrate/20140304020551_create_alerts.rb deleted file mode 100644 index 68a8e10..0000000 --- a/db/migrate/20140304020551_create_alerts.rb +++ /dev/null @@ -1,10 +0,0 @@ -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/20140304020554_create_pms.rb b/db/migrate/20140304020554_create_pms.rb deleted file mode 100644 index 93bb5c6..0000000 --- a/db/migrate/20140304020554_create_pms.rb +++ /dev/null @@ -1,11 +0,0 @@ -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/20140304020556_create_games.rb b/db/migrate/20140304020556_create_games.rb deleted file mode 100644 index 59d4ef0..0000000 --- a/db/migrate/20140304020556_create_games.rb +++ /dev/null @@ -1,13 +0,0 @@ -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/20140304020558_create_game_attributes.rb b/db/migrate/20140304020558_create_game_attributes.rb deleted file mode 100644 index b63f134..0000000 --- a/db/migrate/20140304020558_create_game_attributes.rb +++ /dev/null @@ -1,11 +0,0 @@ -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/20140304020601_create_server_settings.rb b/db/migrate/20140304020601_create_server_settings.rb deleted file mode 100644 index dfdd91b..0000000 --- a/db/migrate/20140304020601_create_server_settings.rb +++ /dev/null @@ -1,8 +0,0 @@ -class CreateServerSettings < ActiveRecord::Migration - def change - create_table :server_settings do |t| - - t.timestamps - end - end -end diff --git a/db/migrate/20140304020609_create_tournament_options.rb b/db/migrate/20140304020609_create_tournament_options.rb deleted file mode 100644 index d2df22e..0000000 --- a/db/migrate/20140304020609_create_tournament_options.rb +++ /dev/null @@ -1,8 +0,0 @@ -class CreateTournamentOptions < ActiveRecord::Migration - def change - create_table :tournament_options do |t| - - t.timestamps - end - end -end diff --git a/db/migrate/20140304020620_create_servers.rb b/db/migrate/20140304020620_create_servers.rb new file mode 100644 index 0000000..f33241a --- /dev/null +++ b/db/migrate/20140304020620_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/20140304020622_create_tournaments.rb b/db/migrate/20140304020622_create_tournaments.rb new file mode 100644 index 0000000..36fcf7e --- /dev/null +++ b/db/migrate/20140304020622_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/20140304020625_create_matches.rb b/db/migrate/20140304020625_create_matches.rb new file mode 100644 index 0000000..6c0c157 --- /dev/null +++ b/db/migrate/20140304020625_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/20140304020627_create_teams.rb b/db/migrate/20140304020627_create_teams.rb new file mode 100644 index 0000000..dd8397d --- /dev/null +++ b/db/migrate/20140304020627_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/20140304020633_create_users.rb b/db/migrate/20140304020633_create_users.rb new file mode 100644 index 0000000..f0986d4 --- /dev/null +++ b/db/migrate/20140304020633_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/20140304020636_create_user_team_pairs.rb b/db/migrate/20140304020636_create_user_team_pairs.rb new file mode 100644 index 0000000..2c492ac --- /dev/null +++ b/db/migrate/20140304020636_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/20140304020638_create_team_match_pairs.rb b/db/migrate/20140304020638_create_team_match_pairs.rb new file mode 100644 index 0000000..8fac07e --- /dev/null +++ b/db/migrate/20140304020638_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/20140304020640_create_alerts.rb b/db/migrate/20140304020640_create_alerts.rb new file mode 100644 index 0000000..68a8e10 --- /dev/null +++ b/db/migrate/20140304020640_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/20140304020642_create_pms.rb b/db/migrate/20140304020642_create_pms.rb new file mode 100644 index 0000000..93bb5c6 --- /dev/null +++ b/db/migrate/20140304020642_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/20140304020645_create_games.rb b/db/migrate/20140304020645_create_games.rb new file mode 100644 index 0000000..59d4ef0 --- /dev/null +++ b/db/migrate/20140304020645_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/20140304020647_create_game_attributes.rb b/db/migrate/20140304020647_create_game_attributes.rb new file mode 100644 index 0000000..b63f134 --- /dev/null +++ b/db/migrate/20140304020647_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/20140304020649_create_server_settings.rb b/db/migrate/20140304020649_create_server_settings.rb new file mode 100644 index 0000000..dfdd91b --- /dev/null +++ b/db/migrate/20140304020649_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/20140304020658_create_tournament_options.rb b/db/migrate/20140304020658_create_tournament_options.rb new file mode 100644 index 0000000..d2df22e --- /dev/null +++ b/db/migrate/20140304020658_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 index 847a686..4e4d940 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 20140304020609) do +ActiveRecord::Schema.define(version: 20140304020658) do create_table "alerts", force: true do |t| t.integer "author_id" diff --git a/generate.sh b/generate.sh index ea96b9b..51546a1 100755 --- a/generate.sh +++ b/generate.sh @@ -31,6 +31,13 @@ bundle exec rails generate controller search $NOTEST bundle exec rails generate controller main $NOTEST bundle exec rails generate controller static $NOTEST +#added some stuff to the database + +rails generate migration add_index_to_user_email +rails generate migration add_index_to_user_name +rails generate migration add_password_digest_to_users +rails generate migration add_remember_token_to_users + #for the tournament controller to generate options bundle exec rails generate model tournament_option $NOTEST -- cgit v1.1-4-g5e80 From b21c833a0974b79585d94e2afa4db980a5061123 Mon Sep 17 00:00:00 2001 From: AndrewMurrell Date: Sun, 2 Mar 2014 22:12:58 -0500 Subject: Merge branch 'master' of http://github.com/LukeShu/leaguer --- db/migrate/20140304020757_create_servers.rb | 8 -------- db/migrate/20140304020800_create_tournaments.rb | 9 --------- db/migrate/20140304020802_create_matches.rb | 10 ---------- db/migrate/20140304020804_create_teams.rb | 8 -------- db/migrate/20140304020811_create_users.rb | 11 ----------- db/migrate/20140304020813_create_user_team_pairs.rb | 10 ---------- db/migrate/20140304020815_create_team_match_pairs.rb | 10 ---------- db/migrate/20140304020817_create_alerts.rb | 10 ---------- db/migrate/20140304020820_create_pms.rb | 11 ----------- db/migrate/20140304020822_create_games.rb | 13 ------------- db/migrate/20140304020824_create_game_attributes.rb | 11 ----------- db/migrate/20140304020827_create_server_settings.rb | 8 -------- db/migrate/20140304020835_create_tournament_options.rb | 8 -------- db/migrate/20140304020846_create_servers.rb | 8 ++++++++ db/migrate/20140304020848_create_tournaments.rb | 9 +++++++++ db/migrate/20140304020850_create_matches.rb | 10 ++++++++++ db/migrate/20140304020853_create_teams.rb | 8 ++++++++ db/migrate/20140304020859_create_users.rb | 11 +++++++++++ db/migrate/20140304020902_create_user_team_pairs.rb | 10 ++++++++++ db/migrate/20140304020904_create_team_match_pairs.rb | 10 ++++++++++ db/migrate/20140304020906_create_alerts.rb | 10 ++++++++++ db/migrate/20140304020908_create_pms.rb | 11 +++++++++++ db/migrate/20140304020911_create_games.rb | 13 +++++++++++++ db/migrate/20140304020913_create_game_attributes.rb | 11 +++++++++++ db/migrate/20140304020915_create_server_settings.rb | 8 ++++++++ db/migrate/20140304020924_create_tournament_options.rb | 8 ++++++++ db/schema.rb | 2 +- 27 files changed, 128 insertions(+), 128 deletions(-) delete mode 100644 db/migrate/20140304020757_create_servers.rb delete mode 100644 db/migrate/20140304020800_create_tournaments.rb delete mode 100644 db/migrate/20140304020802_create_matches.rb delete mode 100644 db/migrate/20140304020804_create_teams.rb delete mode 100644 db/migrate/20140304020811_create_users.rb delete mode 100644 db/migrate/20140304020813_create_user_team_pairs.rb delete mode 100644 db/migrate/20140304020815_create_team_match_pairs.rb delete mode 100644 db/migrate/20140304020817_create_alerts.rb delete mode 100644 db/migrate/20140304020820_create_pms.rb delete mode 100644 db/migrate/20140304020822_create_games.rb delete mode 100644 db/migrate/20140304020824_create_game_attributes.rb delete mode 100644 db/migrate/20140304020827_create_server_settings.rb delete mode 100644 db/migrate/20140304020835_create_tournament_options.rb create mode 100644 db/migrate/20140304020846_create_servers.rb create mode 100644 db/migrate/20140304020848_create_tournaments.rb create mode 100644 db/migrate/20140304020850_create_matches.rb create mode 100644 db/migrate/20140304020853_create_teams.rb create mode 100644 db/migrate/20140304020859_create_users.rb create mode 100644 db/migrate/20140304020902_create_user_team_pairs.rb create mode 100644 db/migrate/20140304020904_create_team_match_pairs.rb create mode 100644 db/migrate/20140304020906_create_alerts.rb create mode 100644 db/migrate/20140304020908_create_pms.rb create mode 100644 db/migrate/20140304020911_create_games.rb create mode 100644 db/migrate/20140304020913_create_game_attributes.rb create mode 100644 db/migrate/20140304020915_create_server_settings.rb create mode 100644 db/migrate/20140304020924_create_tournament_options.rb diff --git a/db/migrate/20140304020757_create_servers.rb b/db/migrate/20140304020757_create_servers.rb deleted file mode 100644 index f33241a..0000000 --- a/db/migrate/20140304020757_create_servers.rb +++ /dev/null @@ -1,8 +0,0 @@ -class CreateServers < ActiveRecord::Migration - def change - create_table :servers do |t| - - t.timestamps - end - end -end diff --git a/db/migrate/20140304020800_create_tournaments.rb b/db/migrate/20140304020800_create_tournaments.rb deleted file mode 100644 index 36fcf7e..0000000 --- a/db/migrate/20140304020800_create_tournaments.rb +++ /dev/null @@ -1,9 +0,0 @@ -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/20140304020802_create_matches.rb b/db/migrate/20140304020802_create_matches.rb deleted file mode 100644 index 325863d..0000000 --- a/db/migrate/20140304020802_create_matches.rb +++ /dev/null @@ -1,10 +0,0 @@ -class CreateMatches < ActiveRecord::Migration - def change - create_table :matches do |t| - t.references :tournament, index: true - t.string :name - - t.timestamps - end - end -end diff --git a/db/migrate/20140304020804_create_teams.rb b/db/migrate/20140304020804_create_teams.rb deleted file mode 100644 index dd8397d..0000000 --- a/db/migrate/20140304020804_create_teams.rb +++ /dev/null @@ -1,8 +0,0 @@ -class CreateTeams < ActiveRecord::Migration - def change - create_table :teams do |t| - - t.timestamps - end - end -end diff --git a/db/migrate/20140304020811_create_users.rb b/db/migrate/20140304020811_create_users.rb deleted file mode 100644 index f0986d4..0000000 --- a/db/migrate/20140304020811_create_users.rb +++ /dev/null @@ -1,11 +0,0 @@ -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/20140304020813_create_user_team_pairs.rb b/db/migrate/20140304020813_create_user_team_pairs.rb deleted file mode 100644 index 2c492ac..0000000 --- a/db/migrate/20140304020813_create_user_team_pairs.rb +++ /dev/null @@ -1,10 +0,0 @@ -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/20140304020815_create_team_match_pairs.rb b/db/migrate/20140304020815_create_team_match_pairs.rb deleted file mode 100644 index 8fac07e..0000000 --- a/db/migrate/20140304020815_create_team_match_pairs.rb +++ /dev/null @@ -1,10 +0,0 @@ -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/20140304020817_create_alerts.rb b/db/migrate/20140304020817_create_alerts.rb deleted file mode 100644 index 68a8e10..0000000 --- a/db/migrate/20140304020817_create_alerts.rb +++ /dev/null @@ -1,10 +0,0 @@ -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/20140304020820_create_pms.rb b/db/migrate/20140304020820_create_pms.rb deleted file mode 100644 index 93bb5c6..0000000 --- a/db/migrate/20140304020820_create_pms.rb +++ /dev/null @@ -1,11 +0,0 @@ -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/20140304020822_create_games.rb b/db/migrate/20140304020822_create_games.rb deleted file mode 100644 index 59d4ef0..0000000 --- a/db/migrate/20140304020822_create_games.rb +++ /dev/null @@ -1,13 +0,0 @@ -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/20140304020824_create_game_attributes.rb b/db/migrate/20140304020824_create_game_attributes.rb deleted file mode 100644 index b63f134..0000000 --- a/db/migrate/20140304020824_create_game_attributes.rb +++ /dev/null @@ -1,11 +0,0 @@ -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/20140304020827_create_server_settings.rb b/db/migrate/20140304020827_create_server_settings.rb deleted file mode 100644 index dfdd91b..0000000 --- a/db/migrate/20140304020827_create_server_settings.rb +++ /dev/null @@ -1,8 +0,0 @@ -class CreateServerSettings < ActiveRecord::Migration - def change - create_table :server_settings do |t| - - t.timestamps - end - end -end diff --git a/db/migrate/20140304020835_create_tournament_options.rb b/db/migrate/20140304020835_create_tournament_options.rb deleted file mode 100644 index d2df22e..0000000 --- a/db/migrate/20140304020835_create_tournament_options.rb +++ /dev/null @@ -1,8 +0,0 @@ -class CreateTournamentOptions < ActiveRecord::Migration - def change - create_table :tournament_options do |t| - - t.timestamps - end - end -end diff --git a/db/migrate/20140304020846_create_servers.rb b/db/migrate/20140304020846_create_servers.rb new file mode 100644 index 0000000..f33241a --- /dev/null +++ b/db/migrate/20140304020846_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/20140304020848_create_tournaments.rb b/db/migrate/20140304020848_create_tournaments.rb new file mode 100644 index 0000000..36fcf7e --- /dev/null +++ b/db/migrate/20140304020848_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/20140304020850_create_matches.rb b/db/migrate/20140304020850_create_matches.rb new file mode 100644 index 0000000..325863d --- /dev/null +++ b/db/migrate/20140304020850_create_matches.rb @@ -0,0 +1,10 @@ +class CreateMatches < ActiveRecord::Migration + def change + create_table :matches do |t| + t.references :tournament, index: true + t.string :name + + t.timestamps + end + end +end diff --git a/db/migrate/20140304020853_create_teams.rb b/db/migrate/20140304020853_create_teams.rb new file mode 100644 index 0000000..dd8397d --- /dev/null +++ b/db/migrate/20140304020853_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/20140304020859_create_users.rb b/db/migrate/20140304020859_create_users.rb new file mode 100644 index 0000000..f0986d4 --- /dev/null +++ b/db/migrate/20140304020859_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/20140304020902_create_user_team_pairs.rb b/db/migrate/20140304020902_create_user_team_pairs.rb new file mode 100644 index 0000000..2c492ac --- /dev/null +++ b/db/migrate/20140304020902_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/20140304020904_create_team_match_pairs.rb b/db/migrate/20140304020904_create_team_match_pairs.rb new file mode 100644 index 0000000..8fac07e --- /dev/null +++ b/db/migrate/20140304020904_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/20140304020906_create_alerts.rb b/db/migrate/20140304020906_create_alerts.rb new file mode 100644 index 0000000..68a8e10 --- /dev/null +++ b/db/migrate/20140304020906_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/20140304020908_create_pms.rb b/db/migrate/20140304020908_create_pms.rb new file mode 100644 index 0000000..93bb5c6 --- /dev/null +++ b/db/migrate/20140304020908_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/20140304020911_create_games.rb b/db/migrate/20140304020911_create_games.rb new file mode 100644 index 0000000..59d4ef0 --- /dev/null +++ b/db/migrate/20140304020911_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/20140304020913_create_game_attributes.rb b/db/migrate/20140304020913_create_game_attributes.rb new file mode 100644 index 0000000..b63f134 --- /dev/null +++ b/db/migrate/20140304020913_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/20140304020915_create_server_settings.rb b/db/migrate/20140304020915_create_server_settings.rb new file mode 100644 index 0000000..dfdd91b --- /dev/null +++ b/db/migrate/20140304020915_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/20140304020924_create_tournament_options.rb b/db/migrate/20140304020924_create_tournament_options.rb new file mode 100644 index 0000000..d2df22e --- /dev/null +++ b/db/migrate/20140304020924_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 index 5e2024b..f4bff97 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 20140304020835) do +ActiveRecord::Schema.define(version: 20140304020924) do create_table "alerts", force: true do |t| t.integer "author_id" -- cgit v1.1-4-g5e80 From b59aa7c21ae04a399639209717b980d731c5bf13 Mon Sep 17 00:00:00 2001 From: AndrewMurrell Date: Mon, 3 Mar 2014 11:40:05 -0500 Subject: Some of the stuff I forgot to commit last night. Updated and cleaned up some pages as well as getting the gameType listing to work. --- db/migrate/20140304020846_create_servers.rb | 8 -------- db/migrate/20140304020848_create_tournaments.rb | 9 --------- db/migrate/20140304020850_create_matches.rb | 10 ---------- db/migrate/20140304020853_create_teams.rb | 8 -------- db/migrate/20140304020859_create_users.rb | 11 ----------- db/migrate/20140304020902_create_user_team_pairs.rb | 10 ---------- db/migrate/20140304020904_create_team_match_pairs.rb | 10 ---------- db/migrate/20140304020906_create_alerts.rb | 10 ---------- db/migrate/20140304020908_create_pms.rb | 11 ----------- db/migrate/20140304020911_create_games.rb | 13 ------------- db/migrate/20140304020913_create_game_attributes.rb | 11 ----------- db/migrate/20140304020915_create_server_settings.rb | 8 -------- db/migrate/20140304020924_create_tournament_options.rb | 8 -------- db/migrate/20140304020934_create_servers.rb | 8 ++++++++ db/migrate/20140304020937_create_tournaments.rb | 9 +++++++++ db/migrate/20140304020939_create_matches.rb | 10 ++++++++++ db/migrate/20140304020941_create_teams.rb | 8 ++++++++ db/migrate/20140304020944_create_alerts.rb | 10 ++++++++++ db/migrate/20140304020946_create_pms.rb | 11 +++++++++++ db/migrate/20140304020948_create_games.rb | 13 +++++++++++++ db/migrate/20140304020951_create_game_attributes.rb | 11 +++++++++++ db/migrate/20140304020953_create_server_settings.rb | 8 ++++++++ db/migrate/20140304020955_create_users.rb | 11 +++++++++++ db/migrate/20140304020957_create_user_team_pairs.rb | 10 ++++++++++ db/migrate/20140304021000_create_team_match_pairs.rb | 10 ++++++++++ db/migrate/20140304021012_create_tournament_options.rb | 8 ++++++++ db/schema.rb | 2 +- generate.sh | 14 ++++++++------ 28 files changed, 136 insertions(+), 134 deletions(-) delete mode 100644 db/migrate/20140304020846_create_servers.rb delete mode 100644 db/migrate/20140304020848_create_tournaments.rb delete mode 100644 db/migrate/20140304020850_create_matches.rb delete mode 100644 db/migrate/20140304020853_create_teams.rb delete mode 100644 db/migrate/20140304020859_create_users.rb delete mode 100644 db/migrate/20140304020902_create_user_team_pairs.rb delete mode 100644 db/migrate/20140304020904_create_team_match_pairs.rb delete mode 100644 db/migrate/20140304020906_create_alerts.rb delete mode 100644 db/migrate/20140304020908_create_pms.rb delete mode 100644 db/migrate/20140304020911_create_games.rb delete mode 100644 db/migrate/20140304020913_create_game_attributes.rb delete mode 100644 db/migrate/20140304020915_create_server_settings.rb delete mode 100644 db/migrate/20140304020924_create_tournament_options.rb create mode 100644 db/migrate/20140304020934_create_servers.rb create mode 100644 db/migrate/20140304020937_create_tournaments.rb create mode 100644 db/migrate/20140304020939_create_matches.rb create mode 100644 db/migrate/20140304020941_create_teams.rb create mode 100644 db/migrate/20140304020944_create_alerts.rb create mode 100644 db/migrate/20140304020946_create_pms.rb create mode 100644 db/migrate/20140304020948_create_games.rb create mode 100644 db/migrate/20140304020951_create_game_attributes.rb create mode 100644 db/migrate/20140304020953_create_server_settings.rb create mode 100644 db/migrate/20140304020955_create_users.rb create mode 100644 db/migrate/20140304020957_create_user_team_pairs.rb create mode 100644 db/migrate/20140304021000_create_team_match_pairs.rb create mode 100644 db/migrate/20140304021012_create_tournament_options.rb diff --git a/db/migrate/20140304020846_create_servers.rb b/db/migrate/20140304020846_create_servers.rb deleted file mode 100644 index f33241a..0000000 --- a/db/migrate/20140304020846_create_servers.rb +++ /dev/null @@ -1,8 +0,0 @@ -class CreateServers < ActiveRecord::Migration - def change - create_table :servers do |t| - - t.timestamps - end - end -end diff --git a/db/migrate/20140304020848_create_tournaments.rb b/db/migrate/20140304020848_create_tournaments.rb deleted file mode 100644 index 36fcf7e..0000000 --- a/db/migrate/20140304020848_create_tournaments.rb +++ /dev/null @@ -1,9 +0,0 @@ -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/20140304020850_create_matches.rb b/db/migrate/20140304020850_create_matches.rb deleted file mode 100644 index 325863d..0000000 --- a/db/migrate/20140304020850_create_matches.rb +++ /dev/null @@ -1,10 +0,0 @@ -class CreateMatches < ActiveRecord::Migration - def change - create_table :matches do |t| - t.references :tournament, index: true - t.string :name - - t.timestamps - end - end -end diff --git a/db/migrate/20140304020853_create_teams.rb b/db/migrate/20140304020853_create_teams.rb deleted file mode 100644 index dd8397d..0000000 --- a/db/migrate/20140304020853_create_teams.rb +++ /dev/null @@ -1,8 +0,0 @@ -class CreateTeams < ActiveRecord::Migration - def change - create_table :teams do |t| - - t.timestamps - end - end -end diff --git a/db/migrate/20140304020859_create_users.rb b/db/migrate/20140304020859_create_users.rb deleted file mode 100644 index f0986d4..0000000 --- a/db/migrate/20140304020859_create_users.rb +++ /dev/null @@ -1,11 +0,0 @@ -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/20140304020902_create_user_team_pairs.rb b/db/migrate/20140304020902_create_user_team_pairs.rb deleted file mode 100644 index 2c492ac..0000000 --- a/db/migrate/20140304020902_create_user_team_pairs.rb +++ /dev/null @@ -1,10 +0,0 @@ -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/20140304020904_create_team_match_pairs.rb b/db/migrate/20140304020904_create_team_match_pairs.rb deleted file mode 100644 index 8fac07e..0000000 --- a/db/migrate/20140304020904_create_team_match_pairs.rb +++ /dev/null @@ -1,10 +0,0 @@ -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/20140304020906_create_alerts.rb b/db/migrate/20140304020906_create_alerts.rb deleted file mode 100644 index 68a8e10..0000000 --- a/db/migrate/20140304020906_create_alerts.rb +++ /dev/null @@ -1,10 +0,0 @@ -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/20140304020908_create_pms.rb b/db/migrate/20140304020908_create_pms.rb deleted file mode 100644 index 93bb5c6..0000000 --- a/db/migrate/20140304020908_create_pms.rb +++ /dev/null @@ -1,11 +0,0 @@ -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/20140304020911_create_games.rb b/db/migrate/20140304020911_create_games.rb deleted file mode 100644 index 59d4ef0..0000000 --- a/db/migrate/20140304020911_create_games.rb +++ /dev/null @@ -1,13 +0,0 @@ -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/20140304020913_create_game_attributes.rb b/db/migrate/20140304020913_create_game_attributes.rb deleted file mode 100644 index b63f134..0000000 --- a/db/migrate/20140304020913_create_game_attributes.rb +++ /dev/null @@ -1,11 +0,0 @@ -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/20140304020915_create_server_settings.rb b/db/migrate/20140304020915_create_server_settings.rb deleted file mode 100644 index dfdd91b..0000000 --- a/db/migrate/20140304020915_create_server_settings.rb +++ /dev/null @@ -1,8 +0,0 @@ -class CreateServerSettings < ActiveRecord::Migration - def change - create_table :server_settings do |t| - - t.timestamps - end - end -end diff --git a/db/migrate/20140304020924_create_tournament_options.rb b/db/migrate/20140304020924_create_tournament_options.rb deleted file mode 100644 index d2df22e..0000000 --- a/db/migrate/20140304020924_create_tournament_options.rb +++ /dev/null @@ -1,8 +0,0 @@ -class CreateTournamentOptions < ActiveRecord::Migration - def change - create_table :tournament_options do |t| - - t.timestamps - end - end -end diff --git a/db/migrate/20140304020934_create_servers.rb b/db/migrate/20140304020934_create_servers.rb new file mode 100644 index 0000000..f33241a --- /dev/null +++ b/db/migrate/20140304020934_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/20140304020937_create_tournaments.rb b/db/migrate/20140304020937_create_tournaments.rb new file mode 100644 index 0000000..36fcf7e --- /dev/null +++ b/db/migrate/20140304020937_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/20140304020939_create_matches.rb b/db/migrate/20140304020939_create_matches.rb new file mode 100644 index 0000000..325863d --- /dev/null +++ b/db/migrate/20140304020939_create_matches.rb @@ -0,0 +1,10 @@ +class CreateMatches < ActiveRecord::Migration + def change + create_table :matches do |t| + t.references :tournament, index: true + t.string :name + + t.timestamps + end + end +end diff --git a/db/migrate/20140304020941_create_teams.rb b/db/migrate/20140304020941_create_teams.rb new file mode 100644 index 0000000..dd8397d --- /dev/null +++ b/db/migrate/20140304020941_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/20140304020944_create_alerts.rb b/db/migrate/20140304020944_create_alerts.rb new file mode 100644 index 0000000..68a8e10 --- /dev/null +++ b/db/migrate/20140304020944_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/20140304020946_create_pms.rb b/db/migrate/20140304020946_create_pms.rb new file mode 100644 index 0000000..93bb5c6 --- /dev/null +++ b/db/migrate/20140304020946_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/20140304020948_create_games.rb b/db/migrate/20140304020948_create_games.rb new file mode 100644 index 0000000..59d4ef0 --- /dev/null +++ b/db/migrate/20140304020948_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/20140304020951_create_game_attributes.rb b/db/migrate/20140304020951_create_game_attributes.rb new file mode 100644 index 0000000..b63f134 --- /dev/null +++ b/db/migrate/20140304020951_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/20140304020953_create_server_settings.rb b/db/migrate/20140304020953_create_server_settings.rb new file mode 100644 index 0000000..dfdd91b --- /dev/null +++ b/db/migrate/20140304020953_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/20140304020955_create_users.rb b/db/migrate/20140304020955_create_users.rb new file mode 100644 index 0000000..f0986d4 --- /dev/null +++ b/db/migrate/20140304020955_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/20140304020957_create_user_team_pairs.rb b/db/migrate/20140304020957_create_user_team_pairs.rb new file mode 100644 index 0000000..2c492ac --- /dev/null +++ b/db/migrate/20140304020957_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/20140304021000_create_team_match_pairs.rb b/db/migrate/20140304021000_create_team_match_pairs.rb new file mode 100644 index 0000000..8fac07e --- /dev/null +++ b/db/migrate/20140304021000_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/20140304021012_create_tournament_options.rb b/db/migrate/20140304021012_create_tournament_options.rb new file mode 100644 index 0000000..d2df22e --- /dev/null +++ b/db/migrate/20140304021012_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 index f4bff97..123736f 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 20140304020924) do +ActiveRecord::Schema.define(version: 20140304021012) do create_table "alerts", force: true do |t| t.integer "author_id" diff --git a/generate.sh b/generate.sh index 766453e..7f0467c 100755 --- a/generate.sh +++ b/generate.sh @@ -17,19 +17,21 @@ bundle exec rails generate scaffold server --force $NOTEST bundle exec rails generate scaffold tournament game:references --force $NOTEST bundle exec rails generate scaffold match tournament:references name:string --force $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 bundle exec rails generate scaffold alert author:references message:text $NOTEST bundle exec rails generate scaffold pm author:references recipient:references message:text $NOTEST -bundle exec rails generate scaffold game name:text players_per_team:integer teams_per_match:integer set_rounds:integer randomized_teams:integer $NOTEST +bundle exec rails generate scaffold game name:text players_per_team:integer teams_per_match:integer set_rounds:integer randomized_teams:integer --force $NOTEST + bundle exec rails generate model game_attribute game:references key:text type:integer $NOTEST bundle exec rails generate model server_settings $NOTEST +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 + bundle exec rails generate controller search $NOTEST bundle exec rails generate controller main $NOTEST bundle exec rails generate controller static $NOTEST +bundle exec rails generate controller users $NOTEST +bundle exec rails generate controller Sessions #added some stuff to the database -- cgit v1.1-4-g5e80 From da4724adddc136b9a50123b8b019d15b95e8931e Mon Sep 17 00:00:00 2001 From: AndrewMurrell Date: Mon, 3 Mar 2014 14:09:32 -0500 Subject: Made it possible to log in from the sign up page. As in I put a link under the mess I made. --- db/migrate/20140304021023_create_servers.rb | 8 -------- db/migrate/20140304021025_create_tournaments.rb | 9 --------- db/migrate/20140304021028_create_matches.rb | 10 ---------- db/migrate/20140304021030_create_teams.rb | 8 -------- db/migrate/20140304021032_create_alerts.rb | 10 ---------- db/migrate/20140304021035_create_pms.rb | 11 ----------- db/migrate/20140304021037_create_games.rb | 13 ------------- db/migrate/20140304021039_create_game_attributes.rb | 11 ----------- db/migrate/20140304021042_create_server_settings.rb | 8 -------- db/migrate/20140304021044_create_users.rb | 11 ----------- db/migrate/20140304021046_create_user_team_pairs.rb | 10 ---------- db/migrate/20140304021048_create_team_match_pairs.rb | 10 ---------- db/migrate/20140304021101_create_tournament_options.rb | 8 -------- db/migrate/20140304021112_create_servers.rb | 8 ++++++++ db/migrate/20140304021114_create_tournaments.rb | 9 +++++++++ db/migrate/20140304021116_create_matches.rb | 10 ++++++++++ db/migrate/20140304021119_create_teams.rb | 8 ++++++++ db/migrate/20140304021121_create_alerts.rb | 10 ++++++++++ db/migrate/20140304021123_create_pms.rb | 11 +++++++++++ db/migrate/20140304021126_create_games.rb | 13 +++++++++++++ db/migrate/20140304021128_create_game_attributes.rb | 11 +++++++++++ db/migrate/20140304021130_create_server_settings.rb | 8 ++++++++ db/migrate/20140304021133_create_users.rb | 11 +++++++++++ db/migrate/20140304021135_create_user_team_pairs.rb | 10 ++++++++++ db/migrate/20140304021137_create_team_match_pairs.rb | 10 ++++++++++ db/migrate/20140304021150_create_tournament_options.rb | 8 ++++++++ db/schema.rb | 2 +- generate.sh | 2 +- 28 files changed, 129 insertions(+), 129 deletions(-) delete mode 100644 db/migrate/20140304021023_create_servers.rb delete mode 100644 db/migrate/20140304021025_create_tournaments.rb delete mode 100644 db/migrate/20140304021028_create_matches.rb delete mode 100644 db/migrate/20140304021030_create_teams.rb delete mode 100644 db/migrate/20140304021032_create_alerts.rb delete mode 100644 db/migrate/20140304021035_create_pms.rb delete mode 100644 db/migrate/20140304021037_create_games.rb delete mode 100644 db/migrate/20140304021039_create_game_attributes.rb delete mode 100644 db/migrate/20140304021042_create_server_settings.rb delete mode 100644 db/migrate/20140304021044_create_users.rb delete mode 100644 db/migrate/20140304021046_create_user_team_pairs.rb delete mode 100644 db/migrate/20140304021048_create_team_match_pairs.rb delete mode 100644 db/migrate/20140304021101_create_tournament_options.rb create mode 100644 db/migrate/20140304021112_create_servers.rb create mode 100644 db/migrate/20140304021114_create_tournaments.rb create mode 100644 db/migrate/20140304021116_create_matches.rb create mode 100644 db/migrate/20140304021119_create_teams.rb create mode 100644 db/migrate/20140304021121_create_alerts.rb create mode 100644 db/migrate/20140304021123_create_pms.rb create mode 100644 db/migrate/20140304021126_create_games.rb create mode 100644 db/migrate/20140304021128_create_game_attributes.rb create mode 100644 db/migrate/20140304021130_create_server_settings.rb create mode 100644 db/migrate/20140304021133_create_users.rb create mode 100644 db/migrate/20140304021135_create_user_team_pairs.rb create mode 100644 db/migrate/20140304021137_create_team_match_pairs.rb create mode 100644 db/migrate/20140304021150_create_tournament_options.rb diff --git a/db/migrate/20140304021023_create_servers.rb b/db/migrate/20140304021023_create_servers.rb deleted file mode 100644 index f33241a..0000000 --- a/db/migrate/20140304021023_create_servers.rb +++ /dev/null @@ -1,8 +0,0 @@ -class CreateServers < ActiveRecord::Migration - def change - create_table :servers do |t| - - t.timestamps - end - end -end diff --git a/db/migrate/20140304021025_create_tournaments.rb b/db/migrate/20140304021025_create_tournaments.rb deleted file mode 100644 index 36fcf7e..0000000 --- a/db/migrate/20140304021025_create_tournaments.rb +++ /dev/null @@ -1,9 +0,0 @@ -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/20140304021028_create_matches.rb b/db/migrate/20140304021028_create_matches.rb deleted file mode 100644 index 325863d..0000000 --- a/db/migrate/20140304021028_create_matches.rb +++ /dev/null @@ -1,10 +0,0 @@ -class CreateMatches < ActiveRecord::Migration - def change - create_table :matches do |t| - t.references :tournament, index: true - t.string :name - - t.timestamps - end - end -end diff --git a/db/migrate/20140304021030_create_teams.rb b/db/migrate/20140304021030_create_teams.rb deleted file mode 100644 index dd8397d..0000000 --- a/db/migrate/20140304021030_create_teams.rb +++ /dev/null @@ -1,8 +0,0 @@ -class CreateTeams < ActiveRecord::Migration - def change - create_table :teams do |t| - - t.timestamps - end - end -end diff --git a/db/migrate/20140304021032_create_alerts.rb b/db/migrate/20140304021032_create_alerts.rb deleted file mode 100644 index 68a8e10..0000000 --- a/db/migrate/20140304021032_create_alerts.rb +++ /dev/null @@ -1,10 +0,0 @@ -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/20140304021035_create_pms.rb b/db/migrate/20140304021035_create_pms.rb deleted file mode 100644 index 93bb5c6..0000000 --- a/db/migrate/20140304021035_create_pms.rb +++ /dev/null @@ -1,11 +0,0 @@ -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/20140304021037_create_games.rb b/db/migrate/20140304021037_create_games.rb deleted file mode 100644 index 59d4ef0..0000000 --- a/db/migrate/20140304021037_create_games.rb +++ /dev/null @@ -1,13 +0,0 @@ -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/20140304021039_create_game_attributes.rb b/db/migrate/20140304021039_create_game_attributes.rb deleted file mode 100644 index b63f134..0000000 --- a/db/migrate/20140304021039_create_game_attributes.rb +++ /dev/null @@ -1,11 +0,0 @@ -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/20140304021042_create_server_settings.rb b/db/migrate/20140304021042_create_server_settings.rb deleted file mode 100644 index dfdd91b..0000000 --- a/db/migrate/20140304021042_create_server_settings.rb +++ /dev/null @@ -1,8 +0,0 @@ -class CreateServerSettings < ActiveRecord::Migration - def change - create_table :server_settings do |t| - - t.timestamps - end - end -end diff --git a/db/migrate/20140304021044_create_users.rb b/db/migrate/20140304021044_create_users.rb deleted file mode 100644 index f0986d4..0000000 --- a/db/migrate/20140304021044_create_users.rb +++ /dev/null @@ -1,11 +0,0 @@ -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/20140304021046_create_user_team_pairs.rb b/db/migrate/20140304021046_create_user_team_pairs.rb deleted file mode 100644 index 2c492ac..0000000 --- a/db/migrate/20140304021046_create_user_team_pairs.rb +++ /dev/null @@ -1,10 +0,0 @@ -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/20140304021048_create_team_match_pairs.rb b/db/migrate/20140304021048_create_team_match_pairs.rb deleted file mode 100644 index 8fac07e..0000000 --- a/db/migrate/20140304021048_create_team_match_pairs.rb +++ /dev/null @@ -1,10 +0,0 @@ -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/20140304021101_create_tournament_options.rb b/db/migrate/20140304021101_create_tournament_options.rb deleted file mode 100644 index d2df22e..0000000 --- a/db/migrate/20140304021101_create_tournament_options.rb +++ /dev/null @@ -1,8 +0,0 @@ -class CreateTournamentOptions < ActiveRecord::Migration - def change - create_table :tournament_options do |t| - - t.timestamps - end - end -end diff --git a/db/migrate/20140304021112_create_servers.rb b/db/migrate/20140304021112_create_servers.rb new file mode 100644 index 0000000..f33241a --- /dev/null +++ b/db/migrate/20140304021112_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/20140304021114_create_tournaments.rb b/db/migrate/20140304021114_create_tournaments.rb new file mode 100644 index 0000000..36fcf7e --- /dev/null +++ b/db/migrate/20140304021114_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/20140304021116_create_matches.rb b/db/migrate/20140304021116_create_matches.rb new file mode 100644 index 0000000..325863d --- /dev/null +++ b/db/migrate/20140304021116_create_matches.rb @@ -0,0 +1,10 @@ +class CreateMatches < ActiveRecord::Migration + def change + create_table :matches do |t| + t.references :tournament, index: true + t.string :name + + t.timestamps + end + end +end diff --git a/db/migrate/20140304021119_create_teams.rb b/db/migrate/20140304021119_create_teams.rb new file mode 100644 index 0000000..dd8397d --- /dev/null +++ b/db/migrate/20140304021119_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/20140304021121_create_alerts.rb b/db/migrate/20140304021121_create_alerts.rb new file mode 100644 index 0000000..68a8e10 --- /dev/null +++ b/db/migrate/20140304021121_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/20140304021123_create_pms.rb b/db/migrate/20140304021123_create_pms.rb new file mode 100644 index 0000000..93bb5c6 --- /dev/null +++ b/db/migrate/20140304021123_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/20140304021126_create_games.rb b/db/migrate/20140304021126_create_games.rb new file mode 100644 index 0000000..59d4ef0 --- /dev/null +++ b/db/migrate/20140304021126_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/20140304021128_create_game_attributes.rb b/db/migrate/20140304021128_create_game_attributes.rb new file mode 100644 index 0000000..b63f134 --- /dev/null +++ b/db/migrate/20140304021128_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/20140304021130_create_server_settings.rb b/db/migrate/20140304021130_create_server_settings.rb new file mode 100644 index 0000000..dfdd91b --- /dev/null +++ b/db/migrate/20140304021130_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/20140304021133_create_users.rb b/db/migrate/20140304021133_create_users.rb new file mode 100644 index 0000000..f0986d4 --- /dev/null +++ b/db/migrate/20140304021133_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/20140304021135_create_user_team_pairs.rb b/db/migrate/20140304021135_create_user_team_pairs.rb new file mode 100644 index 0000000..2c492ac --- /dev/null +++ b/db/migrate/20140304021135_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/20140304021137_create_team_match_pairs.rb b/db/migrate/20140304021137_create_team_match_pairs.rb new file mode 100644 index 0000000..8fac07e --- /dev/null +++ b/db/migrate/20140304021137_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/20140304021150_create_tournament_options.rb b/db/migrate/20140304021150_create_tournament_options.rb new file mode 100644 index 0000000..d2df22e --- /dev/null +++ b/db/migrate/20140304021150_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 index a2c1dc9..cfd889c 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 20140304021101) do +ActiveRecord::Schema.define(version: 20140304021150) do create_table "alerts", force: true do |t| t.integer "author_id" diff --git a/generate.sh b/generate.sh index 7f0467c..4d70de1 100755 --- a/generate.sh +++ b/generate.sh @@ -14,7 +14,7 @@ NOTEST='--skip-test-unit' set -x bundle exec rails generate scaffold server --force $NOTEST -bundle exec rails generate scaffold tournament game:references --force $NOTEST +bundle exec rails generate scaffold tournament game:references $NOTEST bundle exec rails generate scaffold match tournament:references name:string --force $NOTEST bundle exec rails generate scaffold team $NOTEST bundle exec rails generate scaffold alert author:references message:text $NOTEST -- cgit v1.1-4-g5e80 From 21f151629004dbcd28b4576f256ad213aee1bdb2 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Mon, 3 Mar 2014 18:41:50 -0500 Subject: app/models/user.rb: indent --- app/models/user.rb | 247 +++++++++++++++++++++++------------------------------ 1 file changed, 105 insertions(+), 142 deletions(-) diff --git a/app/models/user.rb b/app/models/user.rb index 55a7da0..a4fafa0 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -1,158 +1,121 @@ class User < ActiveRecord::Base -before_save { self.email = email.downcase } -before_save { self.user_name = user_name.downcase } - -=begin - -Rails looks for the create_remember_token and runs the method -before anything else. - -This method cannot be called by a user since it is denoted -as private. - -=end - -before_create :create_remember_token - -=begin - -VAILD_EMAIL is the regex used to valid a user given email. - -A break down of the regex is listed below. - -/ -------------> Start of the regex -\A ------------> match start of a string -[\w+\-.]+ -----> at least one owrd character, plus, hyphen, or - dot -@ -------------> literal ampersand -[a-z\d\-.]+ ---> at least one letter, digit, hyphen, or dot -(?:\.[a-z]+) --> ensures that the error of example@foo..com - does not occur -\z ------------> match end of a string -/ -------------> end of the regex -i -------------> case sensative - -=end - + before_save { self.email = email.downcase } + before_save { self.user_name = user_name.downcase } + + ## + # Rails looks for the create_remember_token and runs the method + # before anything else. + # + # This method cannot be called by a user since it is denoted + # as private. + before_create :create_remember_token + + ## + # VAILD_EMAIL is the regex used to valid a user given email. + # + # A break down of the regex is listed below. + # + # / -------------> Start of the regex + # \A ------------> match start of a string + # [\w+\-.]+ -----> at least one owrd character, plus, hyphen, + # or dot + # @ -------------> literal ampersand + # [a-z\d\-.]+ ---> at least one letter, digit, hyphen, or dot + # (?:\.[a-z]+) --> ensures that the error of example@foo..com + # does not occur + # \z ------------> match end of a string + # / -------------> end of the regex + # i -------------> case insensative VALID_EMAIL_REG = /\A[\w+\-.]+@[a-z\d\-.]+(?:\.[a-z]+)\z/i -=begin - -VALID_USER_NAME checks to make sure a user's user_name -is in the proper format. - -=end - + ## + # VALID_USER_NAME checks to make sure a user's user_name + # is in the proper format. VALID_USER_NAME_REG = /[a-zA-Z0-9\-]/ -=begin - -The following lines put a user accout through a series of -validations in order to make sure all of their information -is in the proper format. - -validates :symbol_to_be_valided - -presence: determines whether or not a symbol is filled or not -length: ensures there is a length limit on the symbol -format: checks the format of given information to ensure - validity - -=end - - validates :name, presence: true, length: { maximum: 50 } - validates :email, presence: true, format: {with: - VALID_EMAIL_REG}, - uniqueness: { case_sensitive: false } - validates :user_name, presence: true, length:{maximum: 50}, - format: {with: VALID_USER_NAME_REG }, - uniqueness: {case_sensitive: false } - -=begin - -Instead of adding password and password_confirmation -attributes, requiring the presence of a password, -requirin that pw and pw_com match, and add an authenticate -method to compare an encrypted password to the -password_digest to authenticate users, I can just add -has_secure_password which does all of this for me. - -=end - + ## + # The following lines put a user accout through a series of + # validations in order to make sure all of their information + # is in the proper format. + # + # validates :symbol_to_be_valided + # + # - presence: determines whether or not a symbol is filled or not + # - length: ensures there is a length limit on the symbol + # - format: checks the format of given information to ensure + # validity + validates(:name, presence: true, length: { maximum: 50 }) + validates(:email, presence: true, format: {with: + VALID_EMAIL_REG}, + uniqueness: { case_sensitive: false }) + validates(:user_name, presence: true, length:{maximum: 50}, + format: {with: VALID_USER_NAME_REG }, + uniqueness: {case_sensitive: false }) + + ## + # Instead of adding password and password_confirmation + # attributes, requiring the presence of a password, + # requirin that pw and pw_com match, and add an authenticate + # method to compare an encrypted password to the + # password_digest to authenticate users, I can just add + # has_secure_password which does all of this for me. has_secure_password validates :password, length: { minimum: 6 } -=begin - - Create a random remember token for the user. This will be - changed every time the user creates a new session. - - By changing the cookie every new session, any hijacked sessions - (where the attacker steals a cookie to sign in as a certain - user) will expire the next time the user signs back in. - - The random string is of length 16 composed of A-Z, a-z, 0-9 - This is the browser's cookie value. - -=end - - def User.new_remember_token - SecureRandom.urlsafe_base64 - end - -=begin - - Encrypt the remember token. - This is the encrypted version of the cookie stored on - the database. - - The reasoning for storing a hashed token is so that even if - the database is compromised, the atacker won't be able to use - the remember tokens to sign in. - -=end - - def User.hash(token) - Digest::SHA1.hexdigest(token.to_s) - end + ## + # Create a random remember token for the user. This will be + # changed every time the user creates a new session. + # + # By changing the cookie every new session, any hijacked sessions + # (where the attacker steals a cookie to sign in as a certain + # user) will expire the next time the user signs back in. + # + # The random string is of length 16 composed of A-Z, a-z, 0-9 + # This is the browser's cookie value. + def User.new_remember_token + SecureRandom.urlsafe_base64 + end + + ## + # Encrypt the remember token. + # This is the encrypted version of the cookie stored on + # the database. + # + # The reasoning for storing a hashed token is so that even if + # the database is compromised, the atacker won't be able to use + # the remember tokens to sign in. + def User.hash(token) + Digest::SHA1.hexdigest(token.to_s) + end + + ## + # SHA-1 (Secure Hash Algorithm) is a US engineered hash + # function that produces a 20 byte hash value which typically + # forms a hexadecimal number 40 digits long. + # The reason I am not using the Bcrypt algorithm is because + # SHA-1 is much faster and I will be calling this on + # every page a user accesses. + # + # https://en.wikipedia.org/wiki/SHA-1 -=begin - -SHA-1 (Secure Hash Algorithm) is a US engineered hash -function that produces a 20 byte hash value which typically -forms a hexadecimal number 40 digits long. -The reason I am not using the Bcrypt algorithm is because -SHA-1 is much faster and I will be calling this on -every page a user accesses. - -https://en.wikipedia.org/wiki/SHA-1 - -=end # Everything under private is hidden so you cannot call. private -=begin - - Create_remember_token in order to ensure a user always has - a remember token. - -=end - def create_remember_token - self.remember_token = User.hash(User.new_remember_token) - end - -=begin - -In order to ensure that someone did not accidently submit -two accounts rapidly (which would throw off the validates -for user_name and email), I added an index to the Users -email and user_name in the database to ensure uniqueness -This also gives and index to the user_name and email -so finding a user SHOULD be easier for the database. - -=end - + ## + # Create_remember_token in order to ensure a user always has + # a remember token. + def create_remember_token + self.remember_token = User.hash(User.new_remember_token) + end + + ## + # In order to ensure that someone did not accidently submit + # two accounts rapidly (which would throw off the validates + # for user_name and email), I added an index to the Users + # email and user_name in the database to ensure uniqueness + # This also gives and index to the user_name and email + # so finding a user SHOULD be easier for the database. end -- cgit v1.1-4-g5e80 From 8f67dafea481f8223983df4dae3a62c92bb5068f Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Mon, 3 Mar 2014 19:54:47 -0500 Subject: users_controller: indent --- app/controllers/users_controller.rb | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 6436e4e..d5aa675 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -1,26 +1,25 @@ class UsersController < ApplicationController - def new @user = User.new end - def create - @user = User.new(user_params) - if @user.save - sign_in @user - redirect_to root_path - else - render 'new' - end - end + def create + @user = User.new(user_params) + if @user.save + sign_in @user + redirect_to root_path + else + render 'new' + end + end def show @user = User.find(param[:id]) end private - - def user_params - params.require(:user).permit(:name, :email, :user_name, :password, :password_confirmation) - end + + def user_params + params.require(:user).permit(:name, :email, :user_name, :password, :password_confirmation) + end end -- cgit v1.1-4-g5e80 From d8ce62fa89705ff9d93d28c3ce626ce9268a01af Mon Sep 17 00:00:00 2001 From: Tomer Kimia Date: Mon, 3 Mar 2014 20:46:18 -0500 Subject: signed in people see a link to make a new tournament --- app/views/static/homepage.html.erb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/views/static/homepage.html.erb b/app/views/static/homepage.html.erb index 5887d5f..8b96e11 100644 --- a/app/views/static/homepage.html.erb +++ b/app/views/static/homepage.html.erb @@ -7,8 +7,11 @@ <% if !signed_in? %> <%= link_to 'Log In', "/signin", :class => "btn btn-warning btn-lg", :role => "button" %> <%= link_to 'Sign Up', "/signup", :class => "btn btn-warning btn-lg", :role => "button" %> + <% else %> + <%= link_to 'Start a Tournament', new_tournament_path, :class => "btn btn-warning btn-lg", :role => "button" %> <% end %> <%= link_to 'See Ongoing Tournaments', tournaments_path, :class => "btn btn-warning btn-lg", :role => "button" %> +

-- cgit v1.1-4-g5e80 From d5f15d40e0c0168bb430ebae39371590266d0eb5 Mon Sep 17 00:00:00 2001 From: Tomer Kimia Date: Mon, 3 Mar 2014 21:02:13 -0500 Subject: links no longer look like shit --- app/assets/stylesheets/scaffolds.css.scss | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/app/assets/stylesheets/scaffolds.css.scss b/app/assets/stylesheets/scaffolds.css.scss index 8279f4f..dc22c99 100644 --- a/app/assets/stylesheets/scaffolds.css.scss +++ b/app/assets/stylesheets/scaffolds.css.scss @@ -28,8 +28,9 @@ a { color: #666; } &:hover { - color: #fff; - background-color: #000; + color: #000; + font-weight:bold; + text-decoration: none; } } @@ -84,6 +85,16 @@ hr { margin: 18px 0; } +.navbar-brand { + a{ + &:hover { + color: #FFF; + font-weight: normal; + text-decoration: none; + } + } +} + #footer{ text-align: center; } -- cgit v1.1-4-g5e80 From 114b7d13be2dbba1ce3bf3c344396c587e464e50 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Mon, 3 Mar 2014 21:48:32 -0500 Subject: fiddle with generate.sh --- generate.sh | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/generate.sh b/generate.sh index 4d70de1..c678448 100755 --- a/generate.sh +++ b/generate.sh @@ -10,7 +10,7 @@ # To Clear the Generated Files: # git clean -df # -NOTEST='--skip-test-unit' +#NOTEST='--skip-test-unit' set -x bundle exec rails generate scaffold server --force $NOTEST @@ -20,18 +20,17 @@ bundle exec rails generate scaffold team $NOTEST bundle exec rails generate scaffold alert author:references message:text $NOTEST bundle exec rails generate scaffold pm author:references recipient:references message:text $NOTEST bundle exec rails generate scaffold game name:text players_per_team:integer teams_per_match:integer set_rounds:integer randomized_teams:integer --force $NOTEST +bundle exec rails generate scaffold user name:string email:string user_name:string $NOTEST bundle exec rails generate model game_attribute game:references key:text type:integer $NOTEST bundle exec rails generate model server_settings $NOTEST -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 bundle exec rails generate controller search $NOTEST bundle exec rails generate controller main $NOTEST bundle exec rails generate controller static $NOTEST -bundle exec rails generate controller users $NOTEST -bundle exec rails generate controller Sessions +bundle exec rails generate controller sessions #added some stuff to the database -- cgit v1.1-4-g5e80 From 661dbaf902d770dfbefa9ba1d9e4c28fc7abf891 Mon Sep 17 00:00:00 2001 From: Tomer Kimia Date: Mon, 3 Mar 2014 21:49:38 -0500 Subject: small things --- app/assets/stylesheets/scaffolds.css.scss | 1 - app/controllers/sessions_controller.rb | 17 ++++++++++------- app/views/sessions/new.html.erb | 4 +++- app/views/users/index.html.erb | 4 +++- 4 files changed, 16 insertions(+), 10 deletions(-) diff --git a/app/assets/stylesheets/scaffolds.css.scss b/app/assets/stylesheets/scaffolds.css.scss index dc22c99..f4c3040 100644 --- a/app/assets/stylesheets/scaffolds.css.scss +++ b/app/assets/stylesheets/scaffolds.css.scss @@ -29,7 +29,6 @@ a { } &:hover { color: #000; - font-weight:bold; text-decoration: none; } } diff --git a/app/controllers/sessions_controller.rb b/app/controllers/sessions_controller.rb index 68cb949..3417332 100644 --- a/app/controllers/sessions_controller.rb +++ b/app/controllers/sessions_controller.rb @@ -1,22 +1,25 @@ class SessionsController < ApplicationController def new + if @user.nil? + @user = User.new + end end # find the user and create a new session def create - user = User.find_by(email: params[:session][:email].downcase) - if user && user.authenticate(params[:session][:password]) - sign_in user + @user = User.find_by(email: params[:session][:email].downcase) + if @user && @user.authenticate(params[:session][:password]) + sign_in @user redirect_to root_path else - render 'new' - end + redirect_to signin_path + end end def destroy - sign_out - redirect_to root_path + sign_out + redirect_to root_path end end diff --git a/app/views/sessions/new.html.erb b/app/views/sessions/new.html.erb index f942cf6..2e7a0d3 100644 --- a/app/views/sessions/new.html.erb +++ b/app/views/sessions/new.html.erb @@ -1,5 +1,7 @@

Sign in

- +<% if @fail %> +

Email and password combination not found

+<% end %>
<%= form_for(:session, url: sessions_path) do |f| %> diff --git a/app/views/users/index.html.erb b/app/views/users/index.html.erb index c128661..d92da4d 100644 --- a/app/views/users/index.html.erb +++ b/app/views/users/index.html.erb @@ -3,6 +3,7 @@ + @@ -14,7 +15,8 @@ <% @users.each do |user| %> - + + -- cgit v1.1-4-g5e80 From ec9b2d4f40bd6a878aeca3ca32ba2aafe3836da5 Mon Sep 17 00:00:00 2001 From: Tomer Kimia Date: Mon, 3 Mar 2014 21:51:33 -0500 Subject: routes fixed signout --- config/routes.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/routes.rb b/config/routes.rb index c78cc7a..4e53990 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -5,7 +5,7 @@ Leaguer::Application.routes.draw do match '/signup', to: 'users#new', via: 'get' match '/signin', to: 'sessions#new', via: 'get' - match '/signout', to: 'sessions#destroy', via: 'delete' + match '/signout', to: 'sessions#destroy', via: 'get' resources :users -- cgit v1.1-4-g5e80 From f825d7e30ff6393b66a5abcc05a33f72d7d6712b Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Mon, 3 Mar 2014 22:17:00 -0500 Subject: touch up the Gemfile, comment out alternative testing frameworks --- Gemfile | 21 ++++++++++----------- Gemfile.lock | 36 ------------------------------------ 2 files changed, 10 insertions(+), 47 deletions(-) diff --git a/Gemfile b/Gemfile index cb3d6f6..fbf6232 100644 --- a/Gemfile +++ b/Gemfile @@ -1,24 +1,23 @@ +#!/usr/bin/ruby -h # not executable, but as a hint to text editors + source 'https://rubygems.org' # Bundle edge Rails instead: gem 'rails', github: 'rails/rails' gem 'rails', '4.0.2' - # bcrypt is used for password digesting gem 'bcrypt-ruby', '3.1.2' group :development, :test do - -# Use sqlite3 as the database for Active Record + # Use sqlite3 as the database for Active Record gem 'sqlite3' - gem 'rspec-rails', '2.13.1' -end - -group :test do - gem 'selenium-webdriver', '2.35.1' - gem 'capybara', '2.1.0' end +# group :test do +# gem 'rspec-rails', '2.13.1' +# gem 'selenium-webdriver', '2.35.1' +# gem 'capybara', '2.1.0' +# end # Use SCSS for stylesheets gem 'sass-rails', '~> 4.0.0' @@ -43,8 +42,8 @@ gem 'turbolinks' gem 'jbuilder', '~> 1.2' group :doc do - # bundle exec rake doc:rails generates the API under doc/api. - gem 'sdoc', require: false + # bundle exec rake doc:rails generates the API under doc/api. + gem 'sdoc', require: false end diff --git a/Gemfile.lock b/Gemfile.lock index 9dd0199..7899a93 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -31,14 +31,6 @@ GEM bootstrap-sass (3.1.1.0) sass (~> 3.2) builder (3.1.4) - capybara (2.1.0) - mime-types (>= 1.16) - nokogiri (>= 1.3.3) - rack (>= 1.0.0) - rack-test (>= 0.5.4) - xpath (~> 2.0) - childprocess (0.5.1) - ffi (~> 1.0, >= 1.0.11) coffee-rails (4.0.1) coffee-script (>= 2.2.0) railties (>= 4.0.0, < 5.0) @@ -46,10 +38,8 @@ GEM coffee-script-source execjs coffee-script-source (1.7.0) - diff-lcs (1.2.5) erubis (2.7.0) execjs (2.0.2) - ffi (1.9.3) hike (1.2.3) i18n (0.6.9) jbuilder (1.5.3) @@ -64,11 +54,8 @@ GEM mime-types (~> 1.16) treetop (~> 1.4.8) mime-types (1.25.1) - mini_portile (0.5.2) minitest (4.7.5) multi_json (1.8.4) - nokogiri (1.6.1) - mini_portile (~> 0.5.0) polyglot (0.3.4) rack (1.5.2) rack-test (0.6.2) @@ -90,18 +77,6 @@ GEM rdoc (4.1.1) json (~> 1.4) ref (1.0.5) - rspec-core (2.13.1) - rspec-expectations (2.13.0) - diff-lcs (>= 1.1.3, < 2.0) - rspec-mocks (2.13.1) - rspec-rails (2.13.1) - actionpack (>= 3.0) - activesupport (>= 3.0) - railties (>= 3.0) - rspec-core (~> 2.13.0) - rspec-expectations (~> 2.13.0) - rspec-mocks (~> 2.13.0) - rubyzip (0.9.9) sass (3.2.14) sass-rails (4.0.1) railties (>= 4.0.0, < 5.0) @@ -110,11 +85,6 @@ GEM sdoc (0.4.0) json (~> 1.8) rdoc (~> 4.0, < 5.0) - selenium-webdriver (2.35.1) - childprocess (>= 0.2.5) - multi_json (~> 1.0) - rubyzip (< 1.0.0) - websocket (~> 1.0.4) sprockets (2.11.0) hike (~> 1.2) multi_json (~> 1.0) @@ -141,9 +111,6 @@ GEM uglifier (2.4.0) execjs (>= 0.3.0) json (>= 1.8.0) - websocket (1.0.7) - xpath (2.0.0) - nokogiri (~> 1.3) PLATFORMS ruby @@ -151,15 +118,12 @@ PLATFORMS DEPENDENCIES bcrypt-ruby (= 3.1.2) bootstrap-sass - capybara (= 2.1.0) coffee-rails (~> 4.0.0) jbuilder (~> 1.2) jquery-rails rails (= 4.0.2) - rspec-rails (= 2.13.1) sass-rails (~> 4.0.0) sdoc - selenium-webdriver (= 2.35.1) sqlite3 therubyracer turbolinks -- cgit v1.1-4-g5e80 From 423d0e5a440d8d66407522bc842ef273196173bc Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Mon, 3 Mar 2014 22:20:02 -0500 Subject: run ./generate.sh --- app/assets/stylesheets/sessions.css.scss | 2 +- app/controllers/users_controller.rb | 72 ++++++++++ app/views/users/_form.html.erb | 29 ++++ app/views/users/edit.html.erb | 6 + app/views/users/index.html.erb | 31 ++++ app/views/users/index.json.jbuilder | 4 + app/views/users/new.html.erb | 5 + app/views/users/show.html.erb | 19 +++ app/views/users/show.json.jbuilder | 1 + config/routes.rb | 2 + db/migrate/20140304021249_create_servers.rb | 8 -- db/migrate/20140304021251_create_tournaments.rb | 9 -- db/migrate/20140304021254_create_matches.rb | 10 -- db/migrate/20140304021256_create_teams.rb | 8 -- db/migrate/20140304021258_create_alerts.rb | 10 -- db/migrate/20140304021301_create_pms.rb | 11 -- db/migrate/20140304021303_create_games.rb | 13 -- .../20140304021306_create_game_attributes.rb | 11 -- .../20140304021308_create_server_settings.rb | 8 -- db/migrate/20140304021310_create_users.rb | 11 -- .../20140304021312_create_user_team_pairs.rb | 10 -- .../20140304021314_create_team_match_pairs.rb | 10 -- .../20140304021327_create_tournament_options.rb | 8 -- db/migrate/20140304031800_create_servers.rb | 8 ++ db/migrate/20140304031802_create_tournaments.rb | 9 ++ db/migrate/20140304031804_create_matches.rb | 10 ++ db/migrate/20140304031806_create_teams.rb | 8 ++ db/migrate/20140304031808_create_alerts.rb | 10 ++ db/migrate/20140304031810_create_pms.rb | 11 ++ db/migrate/20140304031813_create_games.rb | 13 ++ db/migrate/20140304031815_create_users.rb | 11 ++ .../20140304031817_create_game_attributes.rb | 11 ++ .../20140304031819_create_server_settings.rb | 8 ++ .../20140304031821_create_user_team_pairs.rb | 10 ++ .../20140304031823_create_team_match_pairs.rb | 10 ++ .../20140304031834_create_tournament_options.rb | 8 ++ db/schema.rb | 2 +- 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 | 20 --- spec/views/matches/index.html.erb_spec.rb | 23 --- spec/views/matches/new.html.erb_spec.rb | 20 --- spec/views/matches/show.html.erb_spec.rb | 17 --- 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 -- test/controllers/.keep | 0 test/controllers/alerts_controller_test.rb | 49 +++++++ test/controllers/games_controller_test.rb | 49 +++++++ test/controllers/main_controller_test.rb | 7 + test/controllers/matches_controller_test.rb | 49 +++++++ test/controllers/pms_controller_test.rb | 49 +++++++ test/controllers/search_controller_test.rb | 7 + test/controllers/servers_controller_test.rb | 49 +++++++ test/controllers/sessions_controller_test.rb | 7 + test/controllers/static_controller_test.rb | 7 + test/controllers/teams_controller_test.rb | 49 +++++++ test/controllers/tournaments_controller_test.rb | 49 +++++++ test/controllers/users_controller_test.rb | 49 +++++++ test/fixtures/.keep | 0 test/fixtures/alerts.yml | 9 ++ test/fixtures/game_attributes.yml | 11 ++ test/fixtures/games.yml | 15 ++ test/fixtures/matches.yml | 9 ++ test/fixtures/pms.yml | 11 ++ test/fixtures/server_settings.yml | 11 ++ test/fixtures/servers.yml | 11 ++ test/fixtures/team_match_pairs.yml | 9 ++ test/fixtures/teams.yml | 11 ++ test/fixtures/tournament_options.yml | 11 ++ test/fixtures/tournaments.yml | 7 + test/fixtures/user_team_pairs.yml | 9 ++ test/fixtures/users.yml | 11 ++ test/helpers/.keep | 0 test/helpers/alerts_helper_test.rb | 4 + test/helpers/games_helper_test.rb | 4 + test/helpers/main_helper_test.rb | 4 + test/helpers/matches_helper_test.rb | 4 + test/helpers/pms_helper_test.rb | 4 + test/helpers/search_helper_test.rb | 4 + test/helpers/servers_helper_test.rb | 4 + test/helpers/sessions_helper_test.rb | 4 + test/helpers/static_helper_test.rb | 4 + test/helpers/teams_helper_test.rb | 4 + test/helpers/tournaments_helper_test.rb | 4 + test/helpers/users_helper_test.rb | 4 + test/integration/.keep | 0 test/mailers/.keep | 0 test/models/.keep | 0 test/models/alert_test.rb | 7 + test/models/game_attribute_test.rb | 7 + test/models/game_test.rb | 7 + test/models/match_test.rb | 7 + test/models/pm_test.rb | 7 + test/models/server_settings_test.rb | 7 + test/models/server_test.rb | 7 + test/models/team_match_pair_test.rb | 7 + test/models/team_test.rb | 7 + test/models/tournament_option_test.rb | 7 + test/models/tournament_test.rb | 7 + test/models/user_team_pair_test.rb | 7 + test/models/user_test.rb | 7 + test/test_helper.rb | 15 ++ 173 files changed, 1007 insertions(+), 2382 deletions(-) create mode 100644 app/views/users/_form.html.erb create mode 100644 app/views/users/edit.html.erb create mode 100644 app/views/users/index.html.erb create mode 100644 app/views/users/index.json.jbuilder create mode 100644 app/views/users/new.html.erb create mode 100644 app/views/users/show.html.erb create mode 100644 app/views/users/show.json.jbuilder delete mode 100644 db/migrate/20140304021249_create_servers.rb delete mode 100644 db/migrate/20140304021251_create_tournaments.rb delete mode 100644 db/migrate/20140304021254_create_matches.rb delete mode 100644 db/migrate/20140304021256_create_teams.rb delete mode 100644 db/migrate/20140304021258_create_alerts.rb delete mode 100644 db/migrate/20140304021301_create_pms.rb delete mode 100644 db/migrate/20140304021303_create_games.rb delete mode 100644 db/migrate/20140304021306_create_game_attributes.rb delete mode 100644 db/migrate/20140304021308_create_server_settings.rb delete mode 100644 db/migrate/20140304021310_create_users.rb delete mode 100644 db/migrate/20140304021312_create_user_team_pairs.rb delete mode 100644 db/migrate/20140304021314_create_team_match_pairs.rb delete mode 100644 db/migrate/20140304021327_create_tournament_options.rb create mode 100644 db/migrate/20140304031800_create_servers.rb create mode 100644 db/migrate/20140304031802_create_tournaments.rb create mode 100644 db/migrate/20140304031804_create_matches.rb create mode 100644 db/migrate/20140304031806_create_teams.rb create mode 100644 db/migrate/20140304031808_create_alerts.rb create mode 100644 db/migrate/20140304031810_create_pms.rb create mode 100644 db/migrate/20140304031813_create_games.rb create mode 100644 db/migrate/20140304031815_create_users.rb create mode 100644 db/migrate/20140304031817_create_game_attributes.rb create mode 100644 db/migrate/20140304031819_create_server_settings.rb create mode 100644 db/migrate/20140304031821_create_user_team_pairs.rb create mode 100644 db/migrate/20140304031823_create_team_match_pairs.rb create mode 100644 db/migrate/20140304031834_create_tournament_options.rb delete mode 100644 spec/controllers/alerts_controller_spec.rb delete mode 100644 spec/controllers/games_controller_spec.rb delete mode 100644 spec/controllers/main_controller_spec.rb delete mode 100644 spec/controllers/matches_controller_spec.rb delete mode 100644 spec/controllers/pms_controller_spec.rb delete mode 100644 spec/controllers/search_controller_spec.rb delete mode 100644 spec/controllers/servers_controller_spec.rb delete mode 100644 spec/controllers/sessions_controller_spec.rb delete mode 100644 spec/controllers/static_controller_spec.rb delete mode 100644 spec/controllers/teams_controller_spec.rb delete mode 100644 spec/controllers/tournaments_controller_spec.rb delete mode 100644 spec/controllers/users_controller_spec.rb delete mode 100644 spec/helpers/alerts_helper_spec.rb delete mode 100644 spec/helpers/games_helper_spec.rb delete mode 100644 spec/helpers/main_helper_spec.rb delete mode 100644 spec/helpers/matches_helper_spec.rb delete mode 100644 spec/helpers/pms_helper_spec.rb delete mode 100644 spec/helpers/search_helper_spec.rb delete mode 100644 spec/helpers/servers_helper_spec.rb delete mode 100644 spec/helpers/sessions_helper_spec.rb delete mode 100644 spec/helpers/static_helper_spec.rb delete mode 100644 spec/helpers/teams_helper_spec.rb delete mode 100644 spec/helpers/tournaments_helper_spec.rb delete mode 100644 spec/helpers/users_helper_spec.rb delete mode 100644 spec/models/alert_spec.rb delete mode 100644 spec/models/game_attribute_spec.rb delete mode 100644 spec/models/game_spec.rb delete mode 100644 spec/models/match_spec.rb delete mode 100644 spec/models/pm_spec.rb delete mode 100644 spec/models/server_settings_spec.rb delete mode 100644 spec/models/server_spec.rb delete mode 100644 spec/models/team_match_pair_spec.rb delete mode 100644 spec/models/team_spec.rb delete mode 100644 spec/models/tournament_option_spec.rb delete mode 100644 spec/models/tournament_spec.rb delete mode 100644 spec/models/user_spec.rb delete mode 100644 spec/models/user_team_pair_spec.rb delete mode 100644 spec/requests/alerts_spec.rb delete mode 100644 spec/requests/games_spec.rb delete mode 100644 spec/requests/matches_spec.rb delete mode 100644 spec/requests/pms_spec.rb delete mode 100644 spec/requests/servers_spec.rb delete mode 100644 spec/requests/teams_spec.rb delete mode 100644 spec/requests/tournaments_spec.rb delete mode 100644 spec/routing/alerts_routing_spec.rb delete mode 100644 spec/routing/games_routing_spec.rb delete mode 100644 spec/routing/matches_routing_spec.rb delete mode 100644 spec/routing/pms_routing_spec.rb delete mode 100644 spec/routing/servers_routing_spec.rb delete mode 100644 spec/routing/teams_routing_spec.rb delete mode 100644 spec/routing/tournaments_routing_spec.rb delete mode 100644 spec/views/alerts/edit.html.erb_spec.rb delete mode 100644 spec/views/alerts/index.html.erb_spec.rb delete mode 100644 spec/views/alerts/new.html.erb_spec.rb delete mode 100644 spec/views/alerts/show.html.erb_spec.rb delete mode 100644 spec/views/games/edit.html.erb_spec.rb delete mode 100644 spec/views/games/index.html.erb_spec.rb delete mode 100644 spec/views/games/new.html.erb_spec.rb delete mode 100644 spec/views/games/show.html.erb_spec.rb delete mode 100644 spec/views/matches/edit.html.erb_spec.rb delete mode 100644 spec/views/matches/index.html.erb_spec.rb delete mode 100644 spec/views/matches/new.html.erb_spec.rb delete mode 100644 spec/views/matches/show.html.erb_spec.rb delete mode 100644 spec/views/pms/edit.html.erb_spec.rb delete mode 100644 spec/views/pms/index.html.erb_spec.rb delete mode 100644 spec/views/pms/new.html.erb_spec.rb delete mode 100644 spec/views/pms/show.html.erb_spec.rb delete mode 100644 spec/views/servers/edit.html.erb_spec.rb delete mode 100644 spec/views/servers/index.html.erb_spec.rb delete mode 100644 spec/views/servers/new.html.erb_spec.rb delete mode 100644 spec/views/servers/show.html.erb_spec.rb delete mode 100644 spec/views/teams/edit.html.erb_spec.rb delete mode 100644 spec/views/teams/index.html.erb_spec.rb delete mode 100644 spec/views/teams/new.html.erb_spec.rb delete mode 100644 spec/views/teams/show.html.erb_spec.rb delete mode 100644 spec/views/tournaments/edit.html.erb_spec.rb delete mode 100644 spec/views/tournaments/index.html.erb_spec.rb delete mode 100644 spec/views/tournaments/new.html.erb_spec.rb delete mode 100644 spec/views/tournaments/show.html.erb_spec.rb create mode 100644 test/controllers/.keep create mode 100644 test/controllers/alerts_controller_test.rb create mode 100644 test/controllers/games_controller_test.rb create mode 100644 test/controllers/main_controller_test.rb create mode 100644 test/controllers/matches_controller_test.rb create mode 100644 test/controllers/pms_controller_test.rb create mode 100644 test/controllers/search_controller_test.rb create mode 100644 test/controllers/servers_controller_test.rb create mode 100644 test/controllers/sessions_controller_test.rb create mode 100644 test/controllers/static_controller_test.rb create mode 100644 test/controllers/teams_controller_test.rb create mode 100644 test/controllers/tournaments_controller_test.rb create mode 100644 test/controllers/users_controller_test.rb create mode 100644 test/fixtures/.keep create mode 100644 test/fixtures/alerts.yml create mode 100644 test/fixtures/game_attributes.yml create mode 100644 test/fixtures/games.yml create mode 100644 test/fixtures/matches.yml create mode 100644 test/fixtures/pms.yml create mode 100644 test/fixtures/server_settings.yml create mode 100644 test/fixtures/servers.yml create mode 100644 test/fixtures/team_match_pairs.yml create mode 100644 test/fixtures/teams.yml create mode 100644 test/fixtures/tournament_options.yml create mode 100644 test/fixtures/tournaments.yml create mode 100644 test/fixtures/user_team_pairs.yml create mode 100644 test/fixtures/users.yml create mode 100644 test/helpers/.keep create mode 100644 test/helpers/alerts_helper_test.rb create mode 100644 test/helpers/games_helper_test.rb create mode 100644 test/helpers/main_helper_test.rb create mode 100644 test/helpers/matches_helper_test.rb create mode 100644 test/helpers/pms_helper_test.rb create mode 100644 test/helpers/search_helper_test.rb create mode 100644 test/helpers/servers_helper_test.rb create mode 100644 test/helpers/sessions_helper_test.rb create mode 100644 test/helpers/static_helper_test.rb create mode 100644 test/helpers/teams_helper_test.rb create mode 100644 test/helpers/tournaments_helper_test.rb create mode 100644 test/helpers/users_helper_test.rb create mode 100644 test/integration/.keep create mode 100644 test/mailers/.keep create mode 100644 test/models/.keep create mode 100644 test/models/alert_test.rb create mode 100644 test/models/game_attribute_test.rb create mode 100644 test/models/game_test.rb create mode 100644 test/models/match_test.rb create mode 100644 test/models/pm_test.rb create mode 100644 test/models/server_settings_test.rb create mode 100644 test/models/server_test.rb create mode 100644 test/models/team_match_pair_test.rb create mode 100644 test/models/team_test.rb create mode 100644 test/models/tournament_option_test.rb create mode 100644 test/models/tournament_test.rb create mode 100644 test/models/user_team_pair_test.rb create mode 100644 test/models/user_test.rb create mode 100644 test/test_helper.rb diff --git a/app/assets/stylesheets/sessions.css.scss b/app/assets/stylesheets/sessions.css.scss index ccb1ed2..7bef9cf 100644 --- a/app/assets/stylesheets/sessions.css.scss +++ b/app/assets/stylesheets/sessions.css.scss @@ -1,3 +1,3 @@ -// Place all the styles related to the Sessions controller here. +// 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/controllers/users_controller.rb b/app/controllers/users_controller.rb index 3e74dea..b18efed 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -1,2 +1,74 @@ class UsersController < ApplicationController + before_action :set_user, only: [:show, :edit, :update, :destroy] + + # GET /users + # GET /users.json + def index + @users = User.all + end + + # GET /users/1 + # GET /users/1.json + def show + end + + # GET /users/new + def new + @user = User.new + end + + # GET /users/1/edit + def edit + end + + # POST /users + # POST /users.json + def create + @user = User.new(user_params) + + respond_to do |format| + if @user.save + format.html { redirect_to @user, notice: 'User was successfully created.' } + format.json { render action: 'show', status: :created, location: @user } + else + format.html { render action: 'new' } + format.json { render json: @user.errors, status: :unprocessable_entity } + end + end + end + + # PATCH/PUT /users/1 + # PATCH/PUT /users/1.json + def update + respond_to do |format| + if @user.update(user_params) + format.html { redirect_to @user, notice: 'User was successfully updated.' } + format.json { head :no_content } + else + format.html { render action: 'edit' } + format.json { render json: @user.errors, status: :unprocessable_entity } + end + end + end + + # DELETE /users/1 + # DELETE /users/1.json + def destroy + @user.destroy + respond_to do |format| + format.html { redirect_to users_url } + format.json { head :no_content } + end + end + + private + # Use callbacks to share common setup or constraints between actions. + def set_user + @user = User.find(params[:id]) + end + + # Never trust parameters from the scary internet, only allow the white list through. + def user_params + params.require(:user).permit(:name, :email, :user_name) + end end diff --git a/app/views/users/_form.html.erb b/app/views/users/_form.html.erb new file mode 100644 index 0000000..4d28738 --- /dev/null +++ b/app/views/users/_form.html.erb @@ -0,0 +1,29 @@ +<%= form_for(@user) do |f| %> + <% if @user.errors.any? %> +
+

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

+ +
    + <% @user.errors.full_messages.each do |msg| %> +
  • <%= msg %>
  • + <% end %> +
+
+ <% end %> + +
+ <%= f.label :name %>
+ <%= f.text_field :name %> +
+
+ <%= f.label :email %>
+ <%= f.text_field :email %> +
+
+ <%= f.label :user_name %>
+ <%= f.text_field :user_name %> +
+
+ <%= f.submit %> +
+<% end %> diff --git a/app/views/users/edit.html.erb b/app/views/users/edit.html.erb new file mode 100644 index 0000000..99bd4cc --- /dev/null +++ b/app/views/users/edit.html.erb @@ -0,0 +1,6 @@ +

Editing user

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

Listing users

+ +
Username Name Pw hash
<%= link_to("#{user.name}", user, nil) %><%= link_to("#{user.user_name}", user, nil) %><%= user.name %> ******* <%= link_to 'Edit', edit_user_path(user) %> <%= link_to 'Destroy', user, method: :delete, data: { confirm: 'Are you sure?' } %>
+ + + + + + + + + + + + + <% @users.each do |user| %> + + + + + + + + + <% end %> + +
NameEmailUser name
<%= user.name %><%= user.email %><%= user.user_name %><%= link_to 'Show', user %><%= link_to 'Edit', edit_user_path(user) %><%= link_to 'Destroy', user, method: :delete, data: { confirm: 'Are you sure?' } %>
+ +
+ +<%= link_to 'New User', new_user_path %> diff --git a/app/views/users/index.json.jbuilder b/app/views/users/index.json.jbuilder new file mode 100644 index 0000000..42d8b72 --- /dev/null +++ b/app/views/users/index.json.jbuilder @@ -0,0 +1,4 @@ +json.array!(@users) do |user| + json.extract! user, :id, :name, :email, :user_name + json.url user_url(user, format: :json) +end diff --git a/app/views/users/new.html.erb b/app/views/users/new.html.erb new file mode 100644 index 0000000..efc0404 --- /dev/null +++ b/app/views/users/new.html.erb @@ -0,0 +1,5 @@ +

New user

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

<%= notice %>

+ +

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

+ +

+ Email: + <%= @user.email %> +

+ +

+ User name: + <%= @user.user_name %> +

+ +<%= link_to 'Edit', edit_user_path(@user) %> | +<%= link_to 'Back', users_path %> diff --git a/app/views/users/show.json.jbuilder b/app/views/users/show.json.jbuilder new file mode 100644 index 0000000..4919af3 --- /dev/null +++ b/app/views/users/show.json.jbuilder @@ -0,0 +1 @@ +json.extract! @user, :id, :name, :email, :user_name, :created_at, :updated_at diff --git a/config/routes.rb b/config/routes.rb index 149c321..3bad42d 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -1,4 +1,6 @@ Leaguer::Application.routes.draw do + resources :users + resources :games resources :pms diff --git a/db/migrate/20140304021249_create_servers.rb b/db/migrate/20140304021249_create_servers.rb deleted file mode 100644 index f33241a..0000000 --- a/db/migrate/20140304021249_create_servers.rb +++ /dev/null @@ -1,8 +0,0 @@ -class CreateServers < ActiveRecord::Migration - def change - create_table :servers do |t| - - t.timestamps - end - end -end diff --git a/db/migrate/20140304021251_create_tournaments.rb b/db/migrate/20140304021251_create_tournaments.rb deleted file mode 100644 index 36fcf7e..0000000 --- a/db/migrate/20140304021251_create_tournaments.rb +++ /dev/null @@ -1,9 +0,0 @@ -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/20140304021254_create_matches.rb b/db/migrate/20140304021254_create_matches.rb deleted file mode 100644 index 325863d..0000000 --- a/db/migrate/20140304021254_create_matches.rb +++ /dev/null @@ -1,10 +0,0 @@ -class CreateMatches < ActiveRecord::Migration - def change - create_table :matches do |t| - t.references :tournament, index: true - t.string :name - - t.timestamps - end - end -end diff --git a/db/migrate/20140304021256_create_teams.rb b/db/migrate/20140304021256_create_teams.rb deleted file mode 100644 index dd8397d..0000000 --- a/db/migrate/20140304021256_create_teams.rb +++ /dev/null @@ -1,8 +0,0 @@ -class CreateTeams < ActiveRecord::Migration - def change - create_table :teams do |t| - - t.timestamps - end - end -end diff --git a/db/migrate/20140304021258_create_alerts.rb b/db/migrate/20140304021258_create_alerts.rb deleted file mode 100644 index 68a8e10..0000000 --- a/db/migrate/20140304021258_create_alerts.rb +++ /dev/null @@ -1,10 +0,0 @@ -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/20140304021301_create_pms.rb b/db/migrate/20140304021301_create_pms.rb deleted file mode 100644 index 93bb5c6..0000000 --- a/db/migrate/20140304021301_create_pms.rb +++ /dev/null @@ -1,11 +0,0 @@ -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/20140304021303_create_games.rb b/db/migrate/20140304021303_create_games.rb deleted file mode 100644 index 59d4ef0..0000000 --- a/db/migrate/20140304021303_create_games.rb +++ /dev/null @@ -1,13 +0,0 @@ -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/20140304021306_create_game_attributes.rb b/db/migrate/20140304021306_create_game_attributes.rb deleted file mode 100644 index b63f134..0000000 --- a/db/migrate/20140304021306_create_game_attributes.rb +++ /dev/null @@ -1,11 +0,0 @@ -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/20140304021308_create_server_settings.rb b/db/migrate/20140304021308_create_server_settings.rb deleted file mode 100644 index dfdd91b..0000000 --- a/db/migrate/20140304021308_create_server_settings.rb +++ /dev/null @@ -1,8 +0,0 @@ -class CreateServerSettings < ActiveRecord::Migration - def change - create_table :server_settings do |t| - - t.timestamps - end - end -end diff --git a/db/migrate/20140304021310_create_users.rb b/db/migrate/20140304021310_create_users.rb deleted file mode 100644 index f0986d4..0000000 --- a/db/migrate/20140304021310_create_users.rb +++ /dev/null @@ -1,11 +0,0 @@ -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/20140304021312_create_user_team_pairs.rb b/db/migrate/20140304021312_create_user_team_pairs.rb deleted file mode 100644 index 2c492ac..0000000 --- a/db/migrate/20140304021312_create_user_team_pairs.rb +++ /dev/null @@ -1,10 +0,0 @@ -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/20140304021314_create_team_match_pairs.rb b/db/migrate/20140304021314_create_team_match_pairs.rb deleted file mode 100644 index 8fac07e..0000000 --- a/db/migrate/20140304021314_create_team_match_pairs.rb +++ /dev/null @@ -1,10 +0,0 @@ -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/20140304021327_create_tournament_options.rb b/db/migrate/20140304021327_create_tournament_options.rb deleted file mode 100644 index d2df22e..0000000 --- a/db/migrate/20140304021327_create_tournament_options.rb +++ /dev/null @@ -1,8 +0,0 @@ -class CreateTournamentOptions < ActiveRecord::Migration - def change - create_table :tournament_options do |t| - - t.timestamps - end - end -end diff --git a/db/migrate/20140304031800_create_servers.rb b/db/migrate/20140304031800_create_servers.rb new file mode 100644 index 0000000..f33241a --- /dev/null +++ b/db/migrate/20140304031800_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/20140304031802_create_tournaments.rb b/db/migrate/20140304031802_create_tournaments.rb new file mode 100644 index 0000000..36fcf7e --- /dev/null +++ b/db/migrate/20140304031802_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/20140304031804_create_matches.rb b/db/migrate/20140304031804_create_matches.rb new file mode 100644 index 0000000..325863d --- /dev/null +++ b/db/migrate/20140304031804_create_matches.rb @@ -0,0 +1,10 @@ +class CreateMatches < ActiveRecord::Migration + def change + create_table :matches do |t| + t.references :tournament, index: true + t.string :name + + t.timestamps + end + end +end diff --git a/db/migrate/20140304031806_create_teams.rb b/db/migrate/20140304031806_create_teams.rb new file mode 100644 index 0000000..dd8397d --- /dev/null +++ b/db/migrate/20140304031806_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/20140304031808_create_alerts.rb b/db/migrate/20140304031808_create_alerts.rb new file mode 100644 index 0000000..68a8e10 --- /dev/null +++ b/db/migrate/20140304031808_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/20140304031810_create_pms.rb b/db/migrate/20140304031810_create_pms.rb new file mode 100644 index 0000000..93bb5c6 --- /dev/null +++ b/db/migrate/20140304031810_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/20140304031813_create_games.rb b/db/migrate/20140304031813_create_games.rb new file mode 100644 index 0000000..59d4ef0 --- /dev/null +++ b/db/migrate/20140304031813_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/20140304031815_create_users.rb b/db/migrate/20140304031815_create_users.rb new file mode 100644 index 0000000..f0986d4 --- /dev/null +++ b/db/migrate/20140304031815_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/20140304031817_create_game_attributes.rb b/db/migrate/20140304031817_create_game_attributes.rb new file mode 100644 index 0000000..b63f134 --- /dev/null +++ b/db/migrate/20140304031817_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/20140304031819_create_server_settings.rb b/db/migrate/20140304031819_create_server_settings.rb new file mode 100644 index 0000000..dfdd91b --- /dev/null +++ b/db/migrate/20140304031819_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/20140304031821_create_user_team_pairs.rb b/db/migrate/20140304031821_create_user_team_pairs.rb new file mode 100644 index 0000000..2c492ac --- /dev/null +++ b/db/migrate/20140304031821_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/20140304031823_create_team_match_pairs.rb b/db/migrate/20140304031823_create_team_match_pairs.rb new file mode 100644 index 0000000..8fac07e --- /dev/null +++ b/db/migrate/20140304031823_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/20140304031834_create_tournament_options.rb b/db/migrate/20140304031834_create_tournament_options.rb new file mode 100644 index 0000000..d2df22e --- /dev/null +++ b/db/migrate/20140304031834_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 index e40d70c..a9bd57b 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 20140304021327) do +ActiveRecord::Schema.define(version: 20140304031834) do create_table "alerts", force: true do |t| t.integer "author_id" diff --git a/spec/controllers/alerts_controller_spec.rb b/spec/controllers/alerts_controller_spec.rb deleted file mode 100644 index 82b031b..0000000 --- a/spec/controllers/alerts_controller_spec.rb +++ /dev/null @@ -1,160 +0,0 @@ -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 deleted file mode 100644 index ab8b6b2..0000000 --- a/spec/controllers/games_controller_spec.rb +++ /dev/null @@ -1,160 +0,0 @@ -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 deleted file mode 100644 index 247e21d..0000000 --- a/spec/controllers/main_controller_spec.rb +++ /dev/null @@ -1,5 +0,0 @@ -require 'spec_helper' - -describe MainController do - -end diff --git a/spec/controllers/matches_controller_spec.rb b/spec/controllers/matches_controller_spec.rb deleted file mode 100644 index 1f7adf8..0000000 --- a/spec/controllers/matches_controller_spec.rb +++ /dev/null @@ -1,160 +0,0 @@ -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 deleted file mode 100644 index f0822db..0000000 --- a/spec/controllers/pms_controller_spec.rb +++ /dev/null @@ -1,160 +0,0 @@ -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 deleted file mode 100644 index 73248fb..0000000 --- a/spec/controllers/search_controller_spec.rb +++ /dev/null @@ -1,5 +0,0 @@ -require 'spec_helper' - -describe SearchController do - -end diff --git a/spec/controllers/servers_controller_spec.rb b/spec/controllers/servers_controller_spec.rb deleted file mode 100644 index c6f4fa6..0000000 --- a/spec/controllers/servers_controller_spec.rb +++ /dev/null @@ -1,160 +0,0 @@ -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 deleted file mode 100644 index 702c559..0000000 --- a/spec/controllers/sessions_controller_spec.rb +++ /dev/null @@ -1,5 +0,0 @@ -require 'spec_helper' - -describe SessionsController do - -end diff --git a/spec/controllers/static_controller_spec.rb b/spec/controllers/static_controller_spec.rb deleted file mode 100644 index a3db7c0..0000000 --- a/spec/controllers/static_controller_spec.rb +++ /dev/null @@ -1,5 +0,0 @@ -require 'spec_helper' - -describe StaticController do - -end diff --git a/spec/controllers/teams_controller_spec.rb b/spec/controllers/teams_controller_spec.rb deleted file mode 100644 index 9c74d89..0000000 --- a/spec/controllers/teams_controller_spec.rb +++ /dev/null @@ -1,160 +0,0 @@ -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 deleted file mode 100644 index f7b6e19..0000000 --- a/spec/controllers/tournaments_controller_spec.rb +++ /dev/null @@ -1,160 +0,0 @@ -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 deleted file mode 100644 index 142455c..0000000 --- a/spec/controllers/users_controller_spec.rb +++ /dev/null @@ -1,5 +0,0 @@ -require 'spec_helper' - -describe UsersController do - -end diff --git a/spec/helpers/alerts_helper_spec.rb b/spec/helpers/alerts_helper_spec.rb deleted file mode 100644 index 812e415..0000000 --- a/spec/helpers/alerts_helper_spec.rb +++ /dev/null @@ -1,15 +0,0 @@ -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 deleted file mode 100644 index 72addeb..0000000 --- a/spec/helpers/games_helper_spec.rb +++ /dev/null @@ -1,15 +0,0 @@ -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 deleted file mode 100644 index 9d316c5..0000000 --- a/spec/helpers/main_helper_spec.rb +++ /dev/null @@ -1,15 +0,0 @@ -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 deleted file mode 100644 index 271cd00..0000000 --- a/spec/helpers/matches_helper_spec.rb +++ /dev/null @@ -1,15 +0,0 @@ -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 deleted file mode 100644 index 5ebf709..0000000 --- a/spec/helpers/pms_helper_spec.rb +++ /dev/null @@ -1,15 +0,0 @@ -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 deleted file mode 100644 index fabfe99..0000000 --- a/spec/helpers/search_helper_spec.rb +++ /dev/null @@ -1,15 +0,0 @@ -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 deleted file mode 100644 index 487d1e4..0000000 --- a/spec/helpers/servers_helper_spec.rb +++ /dev/null @@ -1,15 +0,0 @@ -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 deleted file mode 100644 index c14cfa5..0000000 --- a/spec/helpers/sessions_helper_spec.rb +++ /dev/null @@ -1,15 +0,0 @@ -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 deleted file mode 100644 index 6a1bf5c..0000000 --- a/spec/helpers/static_helper_spec.rb +++ /dev/null @@ -1,15 +0,0 @@ -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 deleted file mode 100644 index 9572616..0000000 --- a/spec/helpers/teams_helper_spec.rb +++ /dev/null @@ -1,15 +0,0 @@ -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 deleted file mode 100644 index c7eb224..0000000 --- a/spec/helpers/tournaments_helper_spec.rb +++ /dev/null @@ -1,15 +0,0 @@ -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 deleted file mode 100644 index e65fff9..0000000 --- a/spec/helpers/users_helper_spec.rb +++ /dev/null @@ -1,15 +0,0 @@ -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 deleted file mode 100644 index d7fa4af..0000000 --- a/spec/models/alert_spec.rb +++ /dev/null @@ -1,5 +0,0 @@ -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 deleted file mode 100644 index 200e59b..0000000 --- a/spec/models/game_attribute_spec.rb +++ /dev/null @@ -1,5 +0,0 @@ -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 deleted file mode 100644 index 8c56446..0000000 --- a/spec/models/game_spec.rb +++ /dev/null @@ -1,5 +0,0 @@ -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 deleted file mode 100644 index 86931c9..0000000 --- a/spec/models/match_spec.rb +++ /dev/null @@ -1,5 +0,0 @@ -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 deleted file mode 100644 index d56845b..0000000 --- a/spec/models/pm_spec.rb +++ /dev/null @@ -1,5 +0,0 @@ -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 deleted file mode 100644 index d579746..0000000 --- a/spec/models/server_settings_spec.rb +++ /dev/null @@ -1,5 +0,0 @@ -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 deleted file mode 100644 index 646344a..0000000 --- a/spec/models/server_spec.rb +++ /dev/null @@ -1,5 +0,0 @@ -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 deleted file mode 100644 index 676c563..0000000 --- a/spec/models/team_match_pair_spec.rb +++ /dev/null @@ -1,5 +0,0 @@ -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 deleted file mode 100644 index 666a904..0000000 --- a/spec/models/team_spec.rb +++ /dev/null @@ -1,5 +0,0 @@ -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 deleted file mode 100644 index 501b316..0000000 --- a/spec/models/tournament_option_spec.rb +++ /dev/null @@ -1,5 +0,0 @@ -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 deleted file mode 100644 index 56c919d..0000000 --- a/spec/models/tournament_spec.rb +++ /dev/null @@ -1,5 +0,0 @@ -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 deleted file mode 100644 index 44032b4..0000000 --- a/spec/models/user_spec.rb +++ /dev/null @@ -1,5 +0,0 @@ -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 deleted file mode 100644 index 9947368..0000000 --- a/spec/models/user_team_pair_spec.rb +++ /dev/null @@ -1,5 +0,0 @@ -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 deleted file mode 100644 index 03c332a..0000000 --- a/spec/requests/alerts_spec.rb +++ /dev/null @@ -1,11 +0,0 @@ -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 deleted file mode 100644 index 1a84608..0000000 --- a/spec/requests/games_spec.rb +++ /dev/null @@ -1,11 +0,0 @@ -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 deleted file mode 100644 index 250f746..0000000 --- a/spec/requests/matches_spec.rb +++ /dev/null @@ -1,11 +0,0 @@ -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 deleted file mode 100644 index 1862b87..0000000 --- a/spec/requests/pms_spec.rb +++ /dev/null @@ -1,11 +0,0 @@ -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 deleted file mode 100644 index 2a1562e..0000000 --- a/spec/requests/servers_spec.rb +++ /dev/null @@ -1,11 +0,0 @@ -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 deleted file mode 100644 index f0caf7a..0000000 --- a/spec/requests/teams_spec.rb +++ /dev/null @@ -1,11 +0,0 @@ -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 deleted file mode 100644 index 09b4b55..0000000 --- a/spec/requests/tournaments_spec.rb +++ /dev/null @@ -1,11 +0,0 @@ -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 deleted file mode 100644 index 9485907..0000000 --- a/spec/routing/alerts_routing_spec.rb +++ /dev/null @@ -1,35 +0,0 @@ -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 deleted file mode 100644 index 3b3ec0c..0000000 --- a/spec/routing/games_routing_spec.rb +++ /dev/null @@ -1,35 +0,0 @@ -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 deleted file mode 100644 index a9f8254..0000000 --- a/spec/routing/matches_routing_spec.rb +++ /dev/null @@ -1,35 +0,0 @@ -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 deleted file mode 100644 index 839b0a9..0000000 --- a/spec/routing/pms_routing_spec.rb +++ /dev/null @@ -1,35 +0,0 @@ -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 deleted file mode 100644 index e514d15..0000000 --- a/spec/routing/servers_routing_spec.rb +++ /dev/null @@ -1,35 +0,0 @@ -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 deleted file mode 100644 index 818fa7b..0000000 --- a/spec/routing/teams_routing_spec.rb +++ /dev/null @@ -1,35 +0,0 @@ -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 deleted file mode 100644 index e4a229c..0000000 --- a/spec/routing/tournaments_routing_spec.rb +++ /dev/null @@ -1,35 +0,0 @@ -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 deleted file mode 100644 index d837f26..0000000 --- a/spec/views/alerts/edit.html.erb_spec.rb +++ /dev/null @@ -1,20 +0,0 @@ -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 deleted file mode 100644 index a5b4f3c..0000000 --- a/spec/views/alerts/index.html.erb_spec.rb +++ /dev/null @@ -1,23 +0,0 @@ -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 deleted file mode 100644 index e38cbd3..0000000 --- a/spec/views/alerts/new.html.erb_spec.rb +++ /dev/null @@ -1,20 +0,0 @@ -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 deleted file mode 100644 index 267c9f1..0000000 --- a/spec/views/alerts/show.html.erb_spec.rb +++ /dev/null @@ -1,17 +0,0 @@ -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 deleted file mode 100644 index d568c90..0000000 --- a/spec/views/games/edit.html.erb_spec.rb +++ /dev/null @@ -1,26 +0,0 @@ -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 deleted file mode 100644 index 3107393..0000000 --- a/spec/views/games/index.html.erb_spec.rb +++ /dev/null @@ -1,32 +0,0 @@ -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 deleted file mode 100644 index ebe6113..0000000 --- a/spec/views/games/new.html.erb_spec.rb +++ /dev/null @@ -1,26 +0,0 @@ -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 deleted file mode 100644 index fb75ad6..0000000 --- a/spec/views/games/show.html.erb_spec.rb +++ /dev/null @@ -1,23 +0,0 @@ -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 deleted file mode 100644 index fca468f..0000000 --- a/spec/views/matches/edit.html.erb_spec.rb +++ /dev/null @@ -1,20 +0,0 @@ -require 'spec_helper' - -describe "matches/edit" do - before(:each) do - @match = assign(:match, stub_model(Match, - :tournament => nil, - :name => "MyString" - )) - 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]" - assert_select "input#match_name[name=?]", "match[name]" - end - end -end diff --git a/spec/views/matches/index.html.erb_spec.rb b/spec/views/matches/index.html.erb_spec.rb deleted file mode 100644 index d3be1b5..0000000 --- a/spec/views/matches/index.html.erb_spec.rb +++ /dev/null @@ -1,23 +0,0 @@ -require 'spec_helper' - -describe "matches/index" do - before(:each) do - assign(:matches, [ - stub_model(Match, - :tournament => nil, - :name => "Name" - ), - stub_model(Match, - :tournament => nil, - :name => "Name" - ) - ]) - 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 - assert_select "tr>td", :text => "Name".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 deleted file mode 100644 index 4423d2c..0000000 --- a/spec/views/matches/new.html.erb_spec.rb +++ /dev/null @@ -1,20 +0,0 @@ -require 'spec_helper' - -describe "matches/new" do - before(:each) do - assign(:match, stub_model(Match, - :tournament => nil, - :name => "MyString" - ).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]" - assert_select "input#match_name[name=?]", "match[name]" - end - end -end diff --git a/spec/views/matches/show.html.erb_spec.rb b/spec/views/matches/show.html.erb_spec.rb deleted file mode 100644 index 642119d..0000000 --- a/spec/views/matches/show.html.erb_spec.rb +++ /dev/null @@ -1,17 +0,0 @@ -require 'spec_helper' - -describe "matches/show" do - before(:each) do - @match = assign(:match, stub_model(Match, - :tournament => nil, - :name => "Name" - )) - 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(/Name/) - end -end diff --git a/spec/views/pms/edit.html.erb_spec.rb b/spec/views/pms/edit.html.erb_spec.rb deleted file mode 100644 index 5ec0de5..0000000 --- a/spec/views/pms/edit.html.erb_spec.rb +++ /dev/null @@ -1,22 +0,0 @@ -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 deleted file mode 100644 index a3bc733..0000000 --- a/spec/views/pms/index.html.erb_spec.rb +++ /dev/null @@ -1,26 +0,0 @@ -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 deleted file mode 100644 index 342af96..0000000 --- a/spec/views/pms/new.html.erb_spec.rb +++ /dev/null @@ -1,22 +0,0 @@ -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 deleted file mode 100644 index 5802887..0000000 --- a/spec/views/pms/show.html.erb_spec.rb +++ /dev/null @@ -1,19 +0,0 @@ -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 deleted file mode 100644 index 870126c..0000000 --- a/spec/views/servers/edit.html.erb_spec.rb +++ /dev/null @@ -1,15 +0,0 @@ -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 deleted file mode 100644 index 9af4a19..0000000 --- a/spec/views/servers/index.html.erb_spec.rb +++ /dev/null @@ -1,15 +0,0 @@ -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 deleted file mode 100644 index bfc69c5..0000000 --- a/spec/views/servers/new.html.erb_spec.rb +++ /dev/null @@ -1,15 +0,0 @@ -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 deleted file mode 100644 index 3762389..0000000 --- a/spec/views/servers/show.html.erb_spec.rb +++ /dev/null @@ -1,12 +0,0 @@ -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 deleted file mode 100644 index 1153b6d..0000000 --- a/spec/views/teams/edit.html.erb_spec.rb +++ /dev/null @@ -1,15 +0,0 @@ -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 deleted file mode 100644 index e894f36..0000000 --- a/spec/views/teams/index.html.erb_spec.rb +++ /dev/null @@ -1,15 +0,0 @@ -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 deleted file mode 100644 index 6a05475..0000000 --- a/spec/views/teams/new.html.erb_spec.rb +++ /dev/null @@ -1,15 +0,0 @@ -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 deleted file mode 100644 index 1d8ebd5..0000000 --- a/spec/views/teams/show.html.erb_spec.rb +++ /dev/null @@ -1,12 +0,0 @@ -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 deleted file mode 100644 index db7cbb5..0000000 --- a/spec/views/tournaments/edit.html.erb_spec.rb +++ /dev/null @@ -1,18 +0,0 @@ -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 deleted file mode 100644 index bf36e06..0000000 --- a/spec/views/tournaments/index.html.erb_spec.rb +++ /dev/null @@ -1,20 +0,0 @@ -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 deleted file mode 100644 index 49785a4..0000000 --- a/spec/views/tournaments/new.html.erb_spec.rb +++ /dev/null @@ -1,18 +0,0 @@ -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 deleted file mode 100644 index abb1879..0000000 --- a/spec/views/tournaments/show.html.erb_spec.rb +++ /dev/null @@ -1,15 +0,0 @@ -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 diff --git a/test/controllers/.keep b/test/controllers/.keep new file mode 100644 index 0000000..e69de29 diff --git a/test/controllers/alerts_controller_test.rb b/test/controllers/alerts_controller_test.rb new file mode 100644 index 0000000..4a5d911 --- /dev/null +++ b/test/controllers/alerts_controller_test.rb @@ -0,0 +1,49 @@ +require 'test_helper' + +class AlertsControllerTest < ActionController::TestCase + setup do + @alert = alerts(:one) + end + + test "should get index" do + get :index + assert_response :success + assert_not_nil assigns(:alerts) + end + + test "should get new" do + get :new + assert_response :success + end + + test "should create alert" do + assert_difference('Alert.count') do + post :create, alert: { author_id: @alert.author_id, message: @alert.message } + end + + assert_redirected_to alert_path(assigns(:alert)) + end + + test "should show alert" do + get :show, id: @alert + assert_response :success + end + + test "should get edit" do + get :edit, id: @alert + assert_response :success + end + + test "should update alert" do + patch :update, id: @alert, alert: { author_id: @alert.author_id, message: @alert.message } + assert_redirected_to alert_path(assigns(:alert)) + end + + test "should destroy alert" do + assert_difference('Alert.count', -1) do + delete :destroy, id: @alert + end + + assert_redirected_to alerts_path + end +end diff --git a/test/controllers/games_controller_test.rb b/test/controllers/games_controller_test.rb new file mode 100644 index 0000000..95c3145 --- /dev/null +++ b/test/controllers/games_controller_test.rb @@ -0,0 +1,49 @@ +require 'test_helper' + +class GamesControllerTest < ActionController::TestCase + setup do + @game = games(:one) + end + + test "should get index" do + get :index + assert_response :success + assert_not_nil assigns(:games) + end + + test "should get new" do + get :new + assert_response :success + end + + test "should create game" do + assert_difference('Game.count') do + post :create, game: { name: @game.name, players_per_team: @game.players_per_team, randomized_teams: @game.randomized_teams, set_rounds: @game.set_rounds, teams_per_match: @game.teams_per_match } + end + + assert_redirected_to game_path(assigns(:game)) + end + + test "should show game" do + get :show, id: @game + assert_response :success + end + + test "should get edit" do + get :edit, id: @game + assert_response :success + end + + test "should update game" do + patch :update, id: @game, game: { name: @game.name, players_per_team: @game.players_per_team, randomized_teams: @game.randomized_teams, set_rounds: @game.set_rounds, teams_per_match: @game.teams_per_match } + assert_redirected_to game_path(assigns(:game)) + end + + test "should destroy game" do + assert_difference('Game.count', -1) do + delete :destroy, id: @game + end + + assert_redirected_to games_path + end +end diff --git a/test/controllers/main_controller_test.rb b/test/controllers/main_controller_test.rb new file mode 100644 index 0000000..b7ec6bf --- /dev/null +++ b/test/controllers/main_controller_test.rb @@ -0,0 +1,7 @@ +require 'test_helper' + +class MainControllerTest < ActionController::TestCase + # test "the truth" do + # assert true + # end +end diff --git a/test/controllers/matches_controller_test.rb b/test/controllers/matches_controller_test.rb new file mode 100644 index 0000000..50675d8 --- /dev/null +++ b/test/controllers/matches_controller_test.rb @@ -0,0 +1,49 @@ +require 'test_helper' + +class MatchesControllerTest < ActionController::TestCase + setup do + @match = matches(:one) + end + + test "should get index" do + get :index + assert_response :success + assert_not_nil assigns(:matches) + end + + test "should get new" do + get :new + assert_response :success + end + + test "should create match" do + assert_difference('Match.count') do + post :create, match: { name: @match.name, tournament_id: @match.tournament_id } + end + + assert_redirected_to match_path(assigns(:match)) + end + + test "should show match" do + get :show, id: @match + assert_response :success + end + + test "should get edit" do + get :edit, id: @match + assert_response :success + end + + test "should update match" do + patch :update, id: @match, match: { name: @match.name, tournament_id: @match.tournament_id } + assert_redirected_to match_path(assigns(:match)) + end + + test "should destroy match" do + assert_difference('Match.count', -1) do + delete :destroy, id: @match + end + + assert_redirected_to matches_path + end +end diff --git a/test/controllers/pms_controller_test.rb b/test/controllers/pms_controller_test.rb new file mode 100644 index 0000000..18b2449 --- /dev/null +++ b/test/controllers/pms_controller_test.rb @@ -0,0 +1,49 @@ +require 'test_helper' + +class PmsControllerTest < ActionController::TestCase + setup do + @pm = pms(:one) + end + + test "should get index" do + get :index + assert_response :success + assert_not_nil assigns(:pms) + end + + test "should get new" do + get :new + assert_response :success + end + + test "should create pm" do + assert_difference('Pm.count') do + post :create, pm: { author_id: @pm.author_id, message: @pm.message, recipient_id: @pm.recipient_id } + end + + assert_redirected_to pm_path(assigns(:pm)) + end + + test "should show pm" do + get :show, id: @pm + assert_response :success + end + + test "should get edit" do + get :edit, id: @pm + assert_response :success + end + + test "should update pm" do + patch :update, id: @pm, pm: { author_id: @pm.author_id, message: @pm.message, recipient_id: @pm.recipient_id } + assert_redirected_to pm_path(assigns(:pm)) + end + + test "should destroy pm" do + assert_difference('Pm.count', -1) do + delete :destroy, id: @pm + end + + assert_redirected_to pms_path + end +end diff --git a/test/controllers/search_controller_test.rb b/test/controllers/search_controller_test.rb new file mode 100644 index 0000000..bfbf22d --- /dev/null +++ b/test/controllers/search_controller_test.rb @@ -0,0 +1,7 @@ +require 'test_helper' + +class SearchControllerTest < ActionController::TestCase + # test "the truth" do + # assert true + # end +end diff --git a/test/controllers/servers_controller_test.rb b/test/controllers/servers_controller_test.rb new file mode 100644 index 0000000..5891bb0 --- /dev/null +++ b/test/controllers/servers_controller_test.rb @@ -0,0 +1,49 @@ +require 'test_helper' + +class ServersControllerTest < ActionController::TestCase + setup do + @server = servers(:one) + end + + test "should get index" do + get :index + assert_response :success + assert_not_nil assigns(:servers) + end + + test "should get new" do + get :new + assert_response :success + end + + test "should create server" do + assert_difference('Server.count') do + post :create, server: { } + end + + assert_redirected_to server_path(assigns(:server)) + end + + test "should show server" do + get :show, id: @server + assert_response :success + end + + test "should get edit" do + get :edit, id: @server + assert_response :success + end + + test "should update server" do + patch :update, id: @server, server: { } + assert_redirected_to server_path(assigns(:server)) + end + + test "should destroy server" do + assert_difference('Server.count', -1) do + delete :destroy, id: @server + end + + assert_redirected_to servers_path + end +end diff --git a/test/controllers/sessions_controller_test.rb b/test/controllers/sessions_controller_test.rb new file mode 100644 index 0000000..d30ebc3 --- /dev/null +++ b/test/controllers/sessions_controller_test.rb @@ -0,0 +1,7 @@ +require 'test_helper' + +class SessionsControllerTest < ActionController::TestCase + # test "the truth" do + # assert true + # end +end diff --git a/test/controllers/static_controller_test.rb b/test/controllers/static_controller_test.rb new file mode 100644 index 0000000..e62ae2a --- /dev/null +++ b/test/controllers/static_controller_test.rb @@ -0,0 +1,7 @@ +require 'test_helper' + +class StaticControllerTest < ActionController::TestCase + # test "the truth" do + # assert true + # end +end diff --git a/test/controllers/teams_controller_test.rb b/test/controllers/teams_controller_test.rb new file mode 100644 index 0000000..8bf60be --- /dev/null +++ b/test/controllers/teams_controller_test.rb @@ -0,0 +1,49 @@ +require 'test_helper' + +class TeamsControllerTest < ActionController::TestCase + setup do + @team = teams(:one) + end + + test "should get index" do + get :index + assert_response :success + assert_not_nil assigns(:teams) + end + + test "should get new" do + get :new + assert_response :success + end + + test "should create team" do + assert_difference('Team.count') do + post :create, team: { } + end + + assert_redirected_to team_path(assigns(:team)) + end + + test "should show team" do + get :show, id: @team + assert_response :success + end + + test "should get edit" do + get :edit, id: @team + assert_response :success + end + + test "should update team" do + patch :update, id: @team, team: { } + assert_redirected_to team_path(assigns(:team)) + end + + test "should destroy team" do + assert_difference('Team.count', -1) do + delete :destroy, id: @team + end + + assert_redirected_to teams_path + end +end diff --git a/test/controllers/tournaments_controller_test.rb b/test/controllers/tournaments_controller_test.rb new file mode 100644 index 0000000..bdbbfac --- /dev/null +++ b/test/controllers/tournaments_controller_test.rb @@ -0,0 +1,49 @@ +require 'test_helper' + +class TournamentsControllerTest < ActionController::TestCase + setup do + @tournament = tournaments(:one) + end + + test "should get index" do + get :index + assert_response :success + assert_not_nil assigns(:tournaments) + end + + test "should get new" do + get :new + assert_response :success + end + + test "should create tournament" do + assert_difference('Tournament.count') do + post :create, tournament: { game_id: @tournament.game_id } + end + + assert_redirected_to tournament_path(assigns(:tournament)) + end + + test "should show tournament" do + get :show, id: @tournament + assert_response :success + end + + test "should get edit" do + get :edit, id: @tournament + assert_response :success + end + + test "should update tournament" do + patch :update, id: @tournament, tournament: { game_id: @tournament.game_id } + assert_redirected_to tournament_path(assigns(:tournament)) + end + + test "should destroy tournament" do + assert_difference('Tournament.count', -1) do + delete :destroy, id: @tournament + end + + assert_redirected_to tournaments_path + end +end diff --git a/test/controllers/users_controller_test.rb b/test/controllers/users_controller_test.rb new file mode 100644 index 0000000..79a5700 --- /dev/null +++ b/test/controllers/users_controller_test.rb @@ -0,0 +1,49 @@ +require 'test_helper' + +class UsersControllerTest < ActionController::TestCase + setup do + @user = users(:one) + end + + test "should get index" do + get :index + assert_response :success + assert_not_nil assigns(:users) + end + + test "should get new" do + get :new + assert_response :success + end + + test "should create user" do + assert_difference('User.count') do + post :create, user: { email: @user.email, name: @user.name, user_name: @user.user_name } + end + + assert_redirected_to user_path(assigns(:user)) + end + + test "should show user" do + get :show, id: @user + assert_response :success + end + + test "should get edit" do + get :edit, id: @user + assert_response :success + end + + test "should update user" do + patch :update, id: @user, user: { email: @user.email, name: @user.name, user_name: @user.user_name } + assert_redirected_to user_path(assigns(:user)) + end + + test "should destroy user" do + assert_difference('User.count', -1) do + delete :destroy, id: @user + end + + assert_redirected_to users_path + end +end diff --git a/test/fixtures/.keep b/test/fixtures/.keep new file mode 100644 index 0000000..e69de29 diff --git a/test/fixtures/alerts.yml b/test/fixtures/alerts.yml new file mode 100644 index 0000000..52959af --- /dev/null +++ b/test/fixtures/alerts.yml @@ -0,0 +1,9 @@ +# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html + +one: + author_id: + message: MyText + +two: + author_id: + message: MyText diff --git a/test/fixtures/game_attributes.yml b/test/fixtures/game_attributes.yml new file mode 100644 index 0000000..eff7212 --- /dev/null +++ b/test/fixtures/game_attributes.yml @@ -0,0 +1,11 @@ +# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html + +one: + game_id: + key: MyText + type: 1 + +two: + game_id: + key: MyText + type: 1 diff --git a/test/fixtures/games.yml b/test/fixtures/games.yml new file mode 100644 index 0000000..3068527 --- /dev/null +++ b/test/fixtures/games.yml @@ -0,0 +1,15 @@ +# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html + +one: + name: MyText + players_per_team: 1 + teams_per_match: 1 + set_rounds: 1 + randomized_teams: 1 + +two: + name: MyText + players_per_team: 1 + teams_per_match: 1 + set_rounds: 1 + randomized_teams: 1 diff --git a/test/fixtures/matches.yml b/test/fixtures/matches.yml new file mode 100644 index 0000000..089fc65 --- /dev/null +++ b/test/fixtures/matches.yml @@ -0,0 +1,9 @@ +# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html + +one: + tournament_id: + name: MyString + +two: + tournament_id: + name: MyString diff --git a/test/fixtures/pms.yml b/test/fixtures/pms.yml new file mode 100644 index 0000000..f77e727 --- /dev/null +++ b/test/fixtures/pms.yml @@ -0,0 +1,11 @@ +# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html + +one: + author_id: + recipient_id: + message: MyText + +two: + author_id: + recipient_id: + message: MyText diff --git a/test/fixtures/server_settings.yml b/test/fixtures/server_settings.yml new file mode 100644 index 0000000..937a0c0 --- /dev/null +++ b/test/fixtures/server_settings.yml @@ -0,0 +1,11 @@ +# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html + +# This model initially had no columns defined. If you add columns to the +# model remove the '{}' from the fixture names and add the columns immediately +# below each fixture, per the syntax in the comments below +# +one: {} +# column: value +# +two: {} +# column: value diff --git a/test/fixtures/servers.yml b/test/fixtures/servers.yml new file mode 100644 index 0000000..937a0c0 --- /dev/null +++ b/test/fixtures/servers.yml @@ -0,0 +1,11 @@ +# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html + +# This model initially had no columns defined. If you add columns to the +# model remove the '{}' from the fixture names and add the columns immediately +# below each fixture, per the syntax in the comments below +# +one: {} +# column: value +# +two: {} +# column: value diff --git a/test/fixtures/team_match_pairs.yml b/test/fixtures/team_match_pairs.yml new file mode 100644 index 0000000..5f9cf2f --- /dev/null +++ b/test/fixtures/team_match_pairs.yml @@ -0,0 +1,9 @@ +# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html + +one: + team_id: + match_id: + +two: + team_id: + match_id: diff --git a/test/fixtures/teams.yml b/test/fixtures/teams.yml new file mode 100644 index 0000000..937a0c0 --- /dev/null +++ b/test/fixtures/teams.yml @@ -0,0 +1,11 @@ +# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html + +# This model initially had no columns defined. If you add columns to the +# model remove the '{}' from the fixture names and add the columns immediately +# below each fixture, per the syntax in the comments below +# +one: {} +# column: value +# +two: {} +# column: value diff --git a/test/fixtures/tournament_options.yml b/test/fixtures/tournament_options.yml new file mode 100644 index 0000000..937a0c0 --- /dev/null +++ b/test/fixtures/tournament_options.yml @@ -0,0 +1,11 @@ +# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html + +# This model initially had no columns defined. If you add columns to the +# model remove the '{}' from the fixture names and add the columns immediately +# below each fixture, per the syntax in the comments below +# +one: {} +# column: value +# +two: {} +# column: value diff --git a/test/fixtures/tournaments.yml b/test/fixtures/tournaments.yml new file mode 100644 index 0000000..4cba7ca --- /dev/null +++ b/test/fixtures/tournaments.yml @@ -0,0 +1,7 @@ +# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html + +one: + game_id: + +two: + game_id: diff --git a/test/fixtures/user_team_pairs.yml b/test/fixtures/user_team_pairs.yml new file mode 100644 index 0000000..a76036f --- /dev/null +++ b/test/fixtures/user_team_pairs.yml @@ -0,0 +1,9 @@ +# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html + +one: + user_id: + team_id: + +two: + user_id: + team_id: diff --git a/test/fixtures/users.yml b/test/fixtures/users.yml new file mode 100644 index 0000000..ea3e874 --- /dev/null +++ b/test/fixtures/users.yml @@ -0,0 +1,11 @@ +# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html + +one: + name: MyString + email: MyString + user_name: MyString + +two: + name: MyString + email: MyString + user_name: MyString diff --git a/test/helpers/.keep b/test/helpers/.keep new file mode 100644 index 0000000..e69de29 diff --git a/test/helpers/alerts_helper_test.rb b/test/helpers/alerts_helper_test.rb new file mode 100644 index 0000000..1d9079d --- /dev/null +++ b/test/helpers/alerts_helper_test.rb @@ -0,0 +1,4 @@ +require 'test_helper' + +class AlertsHelperTest < ActionView::TestCase +end diff --git a/test/helpers/games_helper_test.rb b/test/helpers/games_helper_test.rb new file mode 100644 index 0000000..449a85c --- /dev/null +++ b/test/helpers/games_helper_test.rb @@ -0,0 +1,4 @@ +require 'test_helper' + +class GamesHelperTest < ActionView::TestCase +end diff --git a/test/helpers/main_helper_test.rb b/test/helpers/main_helper_test.rb new file mode 100644 index 0000000..22da3c4 --- /dev/null +++ b/test/helpers/main_helper_test.rb @@ -0,0 +1,4 @@ +require 'test_helper' + +class MainHelperTest < ActionView::TestCase +end diff --git a/test/helpers/matches_helper_test.rb b/test/helpers/matches_helper_test.rb new file mode 100644 index 0000000..4cc472f --- /dev/null +++ b/test/helpers/matches_helper_test.rb @@ -0,0 +1,4 @@ +require 'test_helper' + +class MatchesHelperTest < ActionView::TestCase +end diff --git a/test/helpers/pms_helper_test.rb b/test/helpers/pms_helper_test.rb new file mode 100644 index 0000000..af80f10 --- /dev/null +++ b/test/helpers/pms_helper_test.rb @@ -0,0 +1,4 @@ +require 'test_helper' + +class PmsHelperTest < ActionView::TestCase +end diff --git a/test/helpers/search_helper_test.rb b/test/helpers/search_helper_test.rb new file mode 100644 index 0000000..3034163 --- /dev/null +++ b/test/helpers/search_helper_test.rb @@ -0,0 +1,4 @@ +require 'test_helper' + +class SearchHelperTest < ActionView::TestCase +end diff --git a/test/helpers/servers_helper_test.rb b/test/helpers/servers_helper_test.rb new file mode 100644 index 0000000..8fddf34 --- /dev/null +++ b/test/helpers/servers_helper_test.rb @@ -0,0 +1,4 @@ +require 'test_helper' + +class ServersHelperTest < ActionView::TestCase +end diff --git a/test/helpers/sessions_helper_test.rb b/test/helpers/sessions_helper_test.rb new file mode 100644 index 0000000..7d44e09 --- /dev/null +++ b/test/helpers/sessions_helper_test.rb @@ -0,0 +1,4 @@ +require 'test_helper' + +class SessionsHelperTest < ActionView::TestCase +end diff --git a/test/helpers/static_helper_test.rb b/test/helpers/static_helper_test.rb new file mode 100644 index 0000000..3b96f2b --- /dev/null +++ b/test/helpers/static_helper_test.rb @@ -0,0 +1,4 @@ +require 'test_helper' + +class StaticHelperTest < ActionView::TestCase +end diff --git a/test/helpers/teams_helper_test.rb b/test/helpers/teams_helper_test.rb new file mode 100644 index 0000000..b736483 --- /dev/null +++ b/test/helpers/teams_helper_test.rb @@ -0,0 +1,4 @@ +require 'test_helper' + +class TeamsHelperTest < ActionView::TestCase +end diff --git a/test/helpers/tournaments_helper_test.rb b/test/helpers/tournaments_helper_test.rb new file mode 100644 index 0000000..1cf5269 --- /dev/null +++ b/test/helpers/tournaments_helper_test.rb @@ -0,0 +1,4 @@ +require 'test_helper' + +class TournamentsHelperTest < ActionView::TestCase +end diff --git a/test/helpers/users_helper_test.rb b/test/helpers/users_helper_test.rb new file mode 100644 index 0000000..96af37a --- /dev/null +++ b/test/helpers/users_helper_test.rb @@ -0,0 +1,4 @@ +require 'test_helper' + +class UsersHelperTest < ActionView::TestCase +end diff --git a/test/integration/.keep b/test/integration/.keep new file mode 100644 index 0000000..e69de29 diff --git a/test/mailers/.keep b/test/mailers/.keep new file mode 100644 index 0000000..e69de29 diff --git a/test/models/.keep b/test/models/.keep new file mode 100644 index 0000000..e69de29 diff --git a/test/models/alert_test.rb b/test/models/alert_test.rb new file mode 100644 index 0000000..b59c65e --- /dev/null +++ b/test/models/alert_test.rb @@ -0,0 +1,7 @@ +require 'test_helper' + +class AlertTest < ActiveSupport::TestCase + # test "the truth" do + # assert true + # end +end diff --git a/test/models/game_attribute_test.rb b/test/models/game_attribute_test.rb new file mode 100644 index 0000000..13c6e65 --- /dev/null +++ b/test/models/game_attribute_test.rb @@ -0,0 +1,7 @@ +require 'test_helper' + +class GameAttributeTest < ActiveSupport::TestCase + # test "the truth" do + # assert true + # end +end diff --git a/test/models/game_test.rb b/test/models/game_test.rb new file mode 100644 index 0000000..2cab36e --- /dev/null +++ b/test/models/game_test.rb @@ -0,0 +1,7 @@ +require 'test_helper' + +class GameTest < ActiveSupport::TestCase + # test "the truth" do + # assert true + # end +end diff --git a/test/models/match_test.rb b/test/models/match_test.rb new file mode 100644 index 0000000..14436b1 --- /dev/null +++ b/test/models/match_test.rb @@ -0,0 +1,7 @@ +require 'test_helper' + +class MatchTest < ActiveSupport::TestCase + # test "the truth" do + # assert true + # end +end diff --git a/test/models/pm_test.rb b/test/models/pm_test.rb new file mode 100644 index 0000000..e7f6b8f --- /dev/null +++ b/test/models/pm_test.rb @@ -0,0 +1,7 @@ +require 'test_helper' + +class PmTest < ActiveSupport::TestCase + # test "the truth" do + # assert true + # end +end diff --git a/test/models/server_settings_test.rb b/test/models/server_settings_test.rb new file mode 100644 index 0000000..470b316 --- /dev/null +++ b/test/models/server_settings_test.rb @@ -0,0 +1,7 @@ +require 'test_helper' + +class ServerSettingsTest < ActiveSupport::TestCase + # test "the truth" do + # assert true + # end +end diff --git a/test/models/server_test.rb b/test/models/server_test.rb new file mode 100644 index 0000000..125ffc9 --- /dev/null +++ b/test/models/server_test.rb @@ -0,0 +1,7 @@ +require 'test_helper' + +class ServerTest < ActiveSupport::TestCase + # test "the truth" do + # assert true + # end +end diff --git a/test/models/team_match_pair_test.rb b/test/models/team_match_pair_test.rb new file mode 100644 index 0000000..c250b3c --- /dev/null +++ b/test/models/team_match_pair_test.rb @@ -0,0 +1,7 @@ +require 'test_helper' + +class TeamMatchPairTest < ActiveSupport::TestCase + # test "the truth" do + # assert true + # end +end diff --git a/test/models/team_test.rb b/test/models/team_test.rb new file mode 100644 index 0000000..8b101cb --- /dev/null +++ b/test/models/team_test.rb @@ -0,0 +1,7 @@ +require 'test_helper' + +class TeamTest < ActiveSupport::TestCase + # test "the truth" do + # assert true + # end +end diff --git a/test/models/tournament_option_test.rb b/test/models/tournament_option_test.rb new file mode 100644 index 0000000..8fa9628 --- /dev/null +++ b/test/models/tournament_option_test.rb @@ -0,0 +1,7 @@ +require 'test_helper' + +class TournamentOptionTest < ActiveSupport::TestCase + # test "the truth" do + # assert true + # end +end diff --git a/test/models/tournament_test.rb b/test/models/tournament_test.rb new file mode 100644 index 0000000..24a7e5f --- /dev/null +++ b/test/models/tournament_test.rb @@ -0,0 +1,7 @@ +require 'test_helper' + +class TournamentTest < ActiveSupport::TestCase + # test "the truth" do + # assert true + # end +end diff --git a/test/models/user_team_pair_test.rb b/test/models/user_team_pair_test.rb new file mode 100644 index 0000000..55f5c58 --- /dev/null +++ b/test/models/user_team_pair_test.rb @@ -0,0 +1,7 @@ +require 'test_helper' + +class UserTeamPairTest < ActiveSupport::TestCase + # test "the truth" do + # assert true + # end +end diff --git a/test/models/user_test.rb b/test/models/user_test.rb new file mode 100644 index 0000000..82f61e0 --- /dev/null +++ b/test/models/user_test.rb @@ -0,0 +1,7 @@ +require 'test_helper' + +class UserTest < ActiveSupport::TestCase + # test "the truth" do + # assert true + # end +end diff --git a/test/test_helper.rb b/test/test_helper.rb new file mode 100644 index 0000000..bc7e05d --- /dev/null +++ b/test/test_helper.rb @@ -0,0 +1,15 @@ +ENV["RAILS_ENV"] ||= "test" +require File.expand_path('../../config/environment', __FILE__) +require 'rails/test_help' + +class ActiveSupport::TestCase + ActiveRecord::Migration.check_pending! + + # Setup all fixtures in test/fixtures/*.yml for all tests in alphabetical order. + # + # Note: You'll currently still have to declare fixtures explicitly in integration tests + # -- they do not yet inherit this setting + fixtures :all + + # Add more helper methods to be used by all tests here... +end -- cgit v1.1-4-g5e80 From 3c9da1eee130d49f998016f8bad91f97f8bdf100 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Mon, 3 Mar 2014 22:30:54 -0500 Subject: touch up Gemfile, comment out alternative testing frameworks --- Gemfile | 21 ++++++++++----------- Gemfile.lock | 36 ------------------------------------ 2 files changed, 10 insertions(+), 47 deletions(-) diff --git a/Gemfile b/Gemfile index cb3d6f6..fbf6232 100644 --- a/Gemfile +++ b/Gemfile @@ -1,24 +1,23 @@ +#!/usr/bin/ruby -h # not executable, but as a hint to text editors + source 'https://rubygems.org' # Bundle edge Rails instead: gem 'rails', github: 'rails/rails' gem 'rails', '4.0.2' - # bcrypt is used for password digesting gem 'bcrypt-ruby', '3.1.2' group :development, :test do - -# Use sqlite3 as the database for Active Record + # Use sqlite3 as the database for Active Record gem 'sqlite3' - gem 'rspec-rails', '2.13.1' -end - -group :test do - gem 'selenium-webdriver', '2.35.1' - gem 'capybara', '2.1.0' end +# group :test do +# gem 'rspec-rails', '2.13.1' +# gem 'selenium-webdriver', '2.35.1' +# gem 'capybara', '2.1.0' +# end # Use SCSS for stylesheets gem 'sass-rails', '~> 4.0.0' @@ -43,8 +42,8 @@ gem 'turbolinks' gem 'jbuilder', '~> 1.2' group :doc do - # bundle exec rake doc:rails generates the API under doc/api. - gem 'sdoc', require: false + # bundle exec rake doc:rails generates the API under doc/api. + gem 'sdoc', require: false end diff --git a/Gemfile.lock b/Gemfile.lock index 9dd0199..7899a93 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -31,14 +31,6 @@ GEM bootstrap-sass (3.1.1.0) sass (~> 3.2) builder (3.1.4) - capybara (2.1.0) - mime-types (>= 1.16) - nokogiri (>= 1.3.3) - rack (>= 1.0.0) - rack-test (>= 0.5.4) - xpath (~> 2.0) - childprocess (0.5.1) - ffi (~> 1.0, >= 1.0.11) coffee-rails (4.0.1) coffee-script (>= 2.2.0) railties (>= 4.0.0, < 5.0) @@ -46,10 +38,8 @@ GEM coffee-script-source execjs coffee-script-source (1.7.0) - diff-lcs (1.2.5) erubis (2.7.0) execjs (2.0.2) - ffi (1.9.3) hike (1.2.3) i18n (0.6.9) jbuilder (1.5.3) @@ -64,11 +54,8 @@ GEM mime-types (~> 1.16) treetop (~> 1.4.8) mime-types (1.25.1) - mini_portile (0.5.2) minitest (4.7.5) multi_json (1.8.4) - nokogiri (1.6.1) - mini_portile (~> 0.5.0) polyglot (0.3.4) rack (1.5.2) rack-test (0.6.2) @@ -90,18 +77,6 @@ GEM rdoc (4.1.1) json (~> 1.4) ref (1.0.5) - rspec-core (2.13.1) - rspec-expectations (2.13.0) - diff-lcs (>= 1.1.3, < 2.0) - rspec-mocks (2.13.1) - rspec-rails (2.13.1) - actionpack (>= 3.0) - activesupport (>= 3.0) - railties (>= 3.0) - rspec-core (~> 2.13.0) - rspec-expectations (~> 2.13.0) - rspec-mocks (~> 2.13.0) - rubyzip (0.9.9) sass (3.2.14) sass-rails (4.0.1) railties (>= 4.0.0, < 5.0) @@ -110,11 +85,6 @@ GEM sdoc (0.4.0) json (~> 1.8) rdoc (~> 4.0, < 5.0) - selenium-webdriver (2.35.1) - childprocess (>= 0.2.5) - multi_json (~> 1.0) - rubyzip (< 1.0.0) - websocket (~> 1.0.4) sprockets (2.11.0) hike (~> 1.2) multi_json (~> 1.0) @@ -141,9 +111,6 @@ GEM uglifier (2.4.0) execjs (>= 0.3.0) json (>= 1.8.0) - websocket (1.0.7) - xpath (2.0.0) - nokogiri (~> 1.3) PLATFORMS ruby @@ -151,15 +118,12 @@ PLATFORMS DEPENDENCIES bcrypt-ruby (= 3.1.2) bootstrap-sass - capybara (= 2.1.0) coffee-rails (~> 4.0.0) jbuilder (~> 1.2) jquery-rails rails (= 4.0.2) - rspec-rails (= 2.13.1) sass-rails (~> 4.0.0) sdoc - selenium-webdriver (= 2.35.1) sqlite3 therubyracer turbolinks -- cgit v1.1-4-g5e80 From 223a60e2f014b76ad3482bf9cc7e3500d59e403a Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Mon, 3 Mar 2014 23:21:30 -0500 Subject: Have generate.sh to tricky git stuff, run it also, stick in a couple of missing 'bundle exec's --- db/migrate/20140304031800_create_servers.rb | 8 -------- db/migrate/20140304031802_create_tournaments.rb | 9 --------- db/migrate/20140304031804_create_matches.rb | 10 ---------- db/migrate/20140304031806_create_teams.rb | 8 -------- db/migrate/20140304031808_create_alerts.rb | 10 ---------- db/migrate/20140304031810_create_pms.rb | 11 ----------- db/migrate/20140304031813_create_games.rb | 13 ------------- db/migrate/20140304031815_create_users.rb | 11 ----------- db/migrate/20140304031817_create_game_attributes.rb | 11 ----------- db/migrate/20140304031819_create_server_settings.rb | 8 -------- db/migrate/20140304031821_create_user_team_pairs.rb | 10 ---------- db/migrate/20140304031823_create_team_match_pairs.rb | 10 ---------- db/migrate/20140304031834_create_tournament_options.rb | 8 -------- db/migrate/20140304041637_create_servers.rb | 8 ++++++++ db/migrate/20140304041639_create_tournaments.rb | 9 +++++++++ db/migrate/20140304041641_create_matches.rb | 10 ++++++++++ db/migrate/20140304041643_create_teams.rb | 8 ++++++++ db/migrate/20140304041646_create_alerts.rb | 10 ++++++++++ db/migrate/20140304041648_create_pms.rb | 11 +++++++++++ db/migrate/20140304041650_create_games.rb | 13 +++++++++++++ db/migrate/20140304041652_create_users.rb | 11 +++++++++++ db/migrate/20140304041655_create_game_attributes.rb | 11 +++++++++++ db/migrate/20140304041657_create_server_settings.rb | 8 ++++++++ db/migrate/20140304041659_create_user_team_pairs.rb | 10 ++++++++++ db/migrate/20140304041701_create_team_match_pairs.rb | 10 ++++++++++ db/migrate/20140304041711_add_index_to_user_email.rb | 4 ++++ db/migrate/20140304041714_add_index_to_user_name.rb | 4 ++++ .../20140304041716_add_password_digest_to_users.rb | 4 ++++ .../20140304041718_add_remember_token_to_users.rb | 4 ++++ db/migrate/20140304041720_create_tournament_options.rb | 8 ++++++++ db/schema.rb | 2 +- generate.sh | 17 +++++++++++------ 32 files changed, 155 insertions(+), 134 deletions(-) delete mode 100644 db/migrate/20140304031800_create_servers.rb delete mode 100644 db/migrate/20140304031802_create_tournaments.rb delete mode 100644 db/migrate/20140304031804_create_matches.rb delete mode 100644 db/migrate/20140304031806_create_teams.rb delete mode 100644 db/migrate/20140304031808_create_alerts.rb delete mode 100644 db/migrate/20140304031810_create_pms.rb delete mode 100644 db/migrate/20140304031813_create_games.rb delete mode 100644 db/migrate/20140304031815_create_users.rb delete mode 100644 db/migrate/20140304031817_create_game_attributes.rb delete mode 100644 db/migrate/20140304031819_create_server_settings.rb delete mode 100644 db/migrate/20140304031821_create_user_team_pairs.rb delete mode 100644 db/migrate/20140304031823_create_team_match_pairs.rb delete mode 100644 db/migrate/20140304031834_create_tournament_options.rb create mode 100644 db/migrate/20140304041637_create_servers.rb create mode 100644 db/migrate/20140304041639_create_tournaments.rb create mode 100644 db/migrate/20140304041641_create_matches.rb create mode 100644 db/migrate/20140304041643_create_teams.rb create mode 100644 db/migrate/20140304041646_create_alerts.rb create mode 100644 db/migrate/20140304041648_create_pms.rb create mode 100644 db/migrate/20140304041650_create_games.rb create mode 100644 db/migrate/20140304041652_create_users.rb create mode 100644 db/migrate/20140304041655_create_game_attributes.rb create mode 100644 db/migrate/20140304041657_create_server_settings.rb create mode 100644 db/migrate/20140304041659_create_user_team_pairs.rb create mode 100644 db/migrate/20140304041701_create_team_match_pairs.rb create mode 100644 db/migrate/20140304041711_add_index_to_user_email.rb create mode 100644 db/migrate/20140304041714_add_index_to_user_name.rb create mode 100644 db/migrate/20140304041716_add_password_digest_to_users.rb create mode 100644 db/migrate/20140304041718_add_remember_token_to_users.rb create mode 100644 db/migrate/20140304041720_create_tournament_options.rb diff --git a/db/migrate/20140304031800_create_servers.rb b/db/migrate/20140304031800_create_servers.rb deleted file mode 100644 index f33241a..0000000 --- a/db/migrate/20140304031800_create_servers.rb +++ /dev/null @@ -1,8 +0,0 @@ -class CreateServers < ActiveRecord::Migration - def change - create_table :servers do |t| - - t.timestamps - end - end -end diff --git a/db/migrate/20140304031802_create_tournaments.rb b/db/migrate/20140304031802_create_tournaments.rb deleted file mode 100644 index 36fcf7e..0000000 --- a/db/migrate/20140304031802_create_tournaments.rb +++ /dev/null @@ -1,9 +0,0 @@ -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/20140304031804_create_matches.rb b/db/migrate/20140304031804_create_matches.rb deleted file mode 100644 index 325863d..0000000 --- a/db/migrate/20140304031804_create_matches.rb +++ /dev/null @@ -1,10 +0,0 @@ -class CreateMatches < ActiveRecord::Migration - def change - create_table :matches do |t| - t.references :tournament, index: true - t.string :name - - t.timestamps - end - end -end diff --git a/db/migrate/20140304031806_create_teams.rb b/db/migrate/20140304031806_create_teams.rb deleted file mode 100644 index dd8397d..0000000 --- a/db/migrate/20140304031806_create_teams.rb +++ /dev/null @@ -1,8 +0,0 @@ -class CreateTeams < ActiveRecord::Migration - def change - create_table :teams do |t| - - t.timestamps - end - end -end diff --git a/db/migrate/20140304031808_create_alerts.rb b/db/migrate/20140304031808_create_alerts.rb deleted file mode 100644 index 68a8e10..0000000 --- a/db/migrate/20140304031808_create_alerts.rb +++ /dev/null @@ -1,10 +0,0 @@ -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/20140304031810_create_pms.rb b/db/migrate/20140304031810_create_pms.rb deleted file mode 100644 index 93bb5c6..0000000 --- a/db/migrate/20140304031810_create_pms.rb +++ /dev/null @@ -1,11 +0,0 @@ -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/20140304031813_create_games.rb b/db/migrate/20140304031813_create_games.rb deleted file mode 100644 index 59d4ef0..0000000 --- a/db/migrate/20140304031813_create_games.rb +++ /dev/null @@ -1,13 +0,0 @@ -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/20140304031815_create_users.rb b/db/migrate/20140304031815_create_users.rb deleted file mode 100644 index f0986d4..0000000 --- a/db/migrate/20140304031815_create_users.rb +++ /dev/null @@ -1,11 +0,0 @@ -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/20140304031817_create_game_attributes.rb b/db/migrate/20140304031817_create_game_attributes.rb deleted file mode 100644 index b63f134..0000000 --- a/db/migrate/20140304031817_create_game_attributes.rb +++ /dev/null @@ -1,11 +0,0 @@ -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/20140304031819_create_server_settings.rb b/db/migrate/20140304031819_create_server_settings.rb deleted file mode 100644 index dfdd91b..0000000 --- a/db/migrate/20140304031819_create_server_settings.rb +++ /dev/null @@ -1,8 +0,0 @@ -class CreateServerSettings < ActiveRecord::Migration - def change - create_table :server_settings do |t| - - t.timestamps - end - end -end diff --git a/db/migrate/20140304031821_create_user_team_pairs.rb b/db/migrate/20140304031821_create_user_team_pairs.rb deleted file mode 100644 index 2c492ac..0000000 --- a/db/migrate/20140304031821_create_user_team_pairs.rb +++ /dev/null @@ -1,10 +0,0 @@ -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/20140304031823_create_team_match_pairs.rb b/db/migrate/20140304031823_create_team_match_pairs.rb deleted file mode 100644 index 8fac07e..0000000 --- a/db/migrate/20140304031823_create_team_match_pairs.rb +++ /dev/null @@ -1,10 +0,0 @@ -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/20140304031834_create_tournament_options.rb b/db/migrate/20140304031834_create_tournament_options.rb deleted file mode 100644 index d2df22e..0000000 --- a/db/migrate/20140304031834_create_tournament_options.rb +++ /dev/null @@ -1,8 +0,0 @@ -class CreateTournamentOptions < ActiveRecord::Migration - def change - create_table :tournament_options do |t| - - t.timestamps - end - end -end diff --git a/db/migrate/20140304041637_create_servers.rb b/db/migrate/20140304041637_create_servers.rb new file mode 100644 index 0000000..f33241a --- /dev/null +++ b/db/migrate/20140304041637_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/20140304041639_create_tournaments.rb b/db/migrate/20140304041639_create_tournaments.rb new file mode 100644 index 0000000..36fcf7e --- /dev/null +++ b/db/migrate/20140304041639_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/20140304041641_create_matches.rb b/db/migrate/20140304041641_create_matches.rb new file mode 100644 index 0000000..325863d --- /dev/null +++ b/db/migrate/20140304041641_create_matches.rb @@ -0,0 +1,10 @@ +class CreateMatches < ActiveRecord::Migration + def change + create_table :matches do |t| + t.references :tournament, index: true + t.string :name + + t.timestamps + end + end +end diff --git a/db/migrate/20140304041643_create_teams.rb b/db/migrate/20140304041643_create_teams.rb new file mode 100644 index 0000000..dd8397d --- /dev/null +++ b/db/migrate/20140304041643_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/20140304041646_create_alerts.rb b/db/migrate/20140304041646_create_alerts.rb new file mode 100644 index 0000000..68a8e10 --- /dev/null +++ b/db/migrate/20140304041646_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/20140304041648_create_pms.rb b/db/migrate/20140304041648_create_pms.rb new file mode 100644 index 0000000..93bb5c6 --- /dev/null +++ b/db/migrate/20140304041648_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/20140304041650_create_games.rb b/db/migrate/20140304041650_create_games.rb new file mode 100644 index 0000000..59d4ef0 --- /dev/null +++ b/db/migrate/20140304041650_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/20140304041652_create_users.rb b/db/migrate/20140304041652_create_users.rb new file mode 100644 index 0000000..f0986d4 --- /dev/null +++ b/db/migrate/20140304041652_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/20140304041655_create_game_attributes.rb b/db/migrate/20140304041655_create_game_attributes.rb new file mode 100644 index 0000000..b63f134 --- /dev/null +++ b/db/migrate/20140304041655_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/20140304041657_create_server_settings.rb b/db/migrate/20140304041657_create_server_settings.rb new file mode 100644 index 0000000..dfdd91b --- /dev/null +++ b/db/migrate/20140304041657_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/20140304041659_create_user_team_pairs.rb b/db/migrate/20140304041659_create_user_team_pairs.rb new file mode 100644 index 0000000..2c492ac --- /dev/null +++ b/db/migrate/20140304041659_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/20140304041701_create_team_match_pairs.rb b/db/migrate/20140304041701_create_team_match_pairs.rb new file mode 100644 index 0000000..8fac07e --- /dev/null +++ b/db/migrate/20140304041701_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/20140304041711_add_index_to_user_email.rb b/db/migrate/20140304041711_add_index_to_user_email.rb new file mode 100644 index 0000000..1bc4c56 --- /dev/null +++ b/db/migrate/20140304041711_add_index_to_user_email.rb @@ -0,0 +1,4 @@ +class AddIndexToUserEmail < ActiveRecord::Migration + def change + end +end diff --git a/db/migrate/20140304041714_add_index_to_user_name.rb b/db/migrate/20140304041714_add_index_to_user_name.rb new file mode 100644 index 0000000..a77567b --- /dev/null +++ b/db/migrate/20140304041714_add_index_to_user_name.rb @@ -0,0 +1,4 @@ +class AddIndexToUserName < ActiveRecord::Migration + def change + end +end diff --git a/db/migrate/20140304041716_add_password_digest_to_users.rb b/db/migrate/20140304041716_add_password_digest_to_users.rb new file mode 100644 index 0000000..0070da7 --- /dev/null +++ b/db/migrate/20140304041716_add_password_digest_to_users.rb @@ -0,0 +1,4 @@ +class AddPasswordDigestToUsers < ActiveRecord::Migration + def change + end +end diff --git a/db/migrate/20140304041718_add_remember_token_to_users.rb b/db/migrate/20140304041718_add_remember_token_to_users.rb new file mode 100644 index 0000000..74c254f --- /dev/null +++ b/db/migrate/20140304041718_add_remember_token_to_users.rb @@ -0,0 +1,4 @@ +class AddRememberTokenToUsers < ActiveRecord::Migration + def change + end +end diff --git a/db/migrate/20140304041720_create_tournament_options.rb b/db/migrate/20140304041720_create_tournament_options.rb new file mode 100644 index 0000000..d2df22e --- /dev/null +++ b/db/migrate/20140304041720_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 index a9bd57b..eb44d71 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 20140304031834) do +ActiveRecord::Schema.define(version: 20140304041720) do create_table "alerts", force: true do |t| t.integer "author_id" diff --git a/generate.sh b/generate.sh index c678448..bf980f3 100755 --- a/generate.sh +++ b/generate.sh @@ -1,4 +1,5 @@ #!/bin/bash +set -x # The generate.sh bash file is used to generate all of the necessary .rb files to run the website # @@ -12,7 +13,9 @@ # #NOTEST='--skip-test-unit' -set -x +git rm -rf app test config/routes.rb db/migrate +git checkout clean-start -- app test config/routes.rb + bundle exec rails generate scaffold server --force $NOTEST bundle exec rails generate scaffold tournament game:references $NOTEST bundle exec rails generate scaffold match tournament:references name:string --force $NOTEST @@ -34,15 +37,17 @@ bundle exec rails generate controller sessions #added some stuff to the database -rails generate migration add_index_to_user_email -rails generate migration add_index_to_user_name -rails generate migration add_password_digest_to_users -rails generate migration add_remember_token_to_users +bundle exec rails generate migration add_index_to_user_email +bundle exec rails generate migration add_index_to_user_name +bundle exec rails generate migration add_password_digest_to_users +bundle exec rails generate migration add_remember_token_to_users #for the tournament controller to generate options bundle exec rails generate model tournament_option $NOTEST +#bundle exec rails generate scaffold + +git add app test config/routes.rb db/migrate db/schema.rb bundle exec rake db:drop RAILS_ENV=development bundle exec rake db:migrate RAILS_ENV=development bundle exec rake db:seed -#bundle exec rails generate scaffold -- cgit v1.1-4-g5e80 From 11e4de6fd8235b1877b1725d53a98f017130c768 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Mon, 3 Mar 2014 23:38:57 -0500 Subject: fix index-adding migrations (I think), and fix `git add`ing schema.rb --- db/migrate/20140304041637_create_servers.rb | 8 -------- db/migrate/20140304041639_create_tournaments.rb | 9 --------- db/migrate/20140304041641_create_matches.rb | 10 ---------- db/migrate/20140304041643_create_teams.rb | 8 -------- db/migrate/20140304041646_create_alerts.rb | 10 ---------- db/migrate/20140304041648_create_pms.rb | 11 ----------- db/migrate/20140304041650_create_games.rb | 13 ------------- db/migrate/20140304041652_create_users.rb | 11 ----------- db/migrate/20140304041655_create_game_attributes.rb | 11 ----------- db/migrate/20140304041657_create_server_settings.rb | 8 -------- db/migrate/20140304041659_create_user_team_pairs.rb | 10 ---------- db/migrate/20140304041701_create_team_match_pairs.rb | 10 ---------- db/migrate/20140304041711_add_index_to_user_email.rb | 4 ---- db/migrate/20140304041714_add_index_to_user_name.rb | 4 ---- db/migrate/20140304041716_add_password_digest_to_users.rb | 4 ---- db/migrate/20140304041718_add_remember_token_to_users.rb | 4 ---- db/migrate/20140304041720_create_tournament_options.rb | 8 -------- db/migrate/20140304043618_create_servers.rb | 8 ++++++++ db/migrate/20140304043620_create_tournaments.rb | 9 +++++++++ db/migrate/20140304043622_create_matches.rb | 10 ++++++++++ db/migrate/20140304043624_create_teams.rb | 8 ++++++++ db/migrate/20140304043626_create_alerts.rb | 10 ++++++++++ db/migrate/20140304043629_create_pms.rb | 11 +++++++++++ db/migrate/20140304043631_create_games.rb | 13 +++++++++++++ db/migrate/20140304043633_create_users.rb | 11 +++++++++++ db/migrate/20140304043635_create_game_attributes.rb | 11 +++++++++++ db/migrate/20140304043637_create_server_settings.rb | 8 ++++++++ db/migrate/20140304043639_create_user_team_pairs.rb | 10 ++++++++++ db/migrate/20140304043642_create_team_match_pairs.rb | 10 ++++++++++ db/migrate/20140304043652_add_index_to_users_email.rb | 4 ++++ db/migrate/20140304043654_add_index_to_users_user_name.rb | 4 ++++ db/migrate/20140304043656_add_password_digest_to_users.rb | 4 ++++ db/migrate/20140304043658_add_remember_token_to_users.rb | 4 ++++ db/migrate/20140304043700_create_tournament_options.rb | 8 ++++++++ db/schema.rb | 2 +- generate.sh | 8 ++++---- 36 files changed, 148 insertions(+), 148 deletions(-) delete mode 100644 db/migrate/20140304041637_create_servers.rb delete mode 100644 db/migrate/20140304041639_create_tournaments.rb delete mode 100644 db/migrate/20140304041641_create_matches.rb delete mode 100644 db/migrate/20140304041643_create_teams.rb delete mode 100644 db/migrate/20140304041646_create_alerts.rb delete mode 100644 db/migrate/20140304041648_create_pms.rb delete mode 100644 db/migrate/20140304041650_create_games.rb delete mode 100644 db/migrate/20140304041652_create_users.rb delete mode 100644 db/migrate/20140304041655_create_game_attributes.rb delete mode 100644 db/migrate/20140304041657_create_server_settings.rb delete mode 100644 db/migrate/20140304041659_create_user_team_pairs.rb delete mode 100644 db/migrate/20140304041701_create_team_match_pairs.rb delete mode 100644 db/migrate/20140304041711_add_index_to_user_email.rb delete mode 100644 db/migrate/20140304041714_add_index_to_user_name.rb delete mode 100644 db/migrate/20140304041716_add_password_digest_to_users.rb delete mode 100644 db/migrate/20140304041718_add_remember_token_to_users.rb delete mode 100644 db/migrate/20140304041720_create_tournament_options.rb create mode 100644 db/migrate/20140304043618_create_servers.rb create mode 100644 db/migrate/20140304043620_create_tournaments.rb create mode 100644 db/migrate/20140304043622_create_matches.rb create mode 100644 db/migrate/20140304043624_create_teams.rb create mode 100644 db/migrate/20140304043626_create_alerts.rb create mode 100644 db/migrate/20140304043629_create_pms.rb create mode 100644 db/migrate/20140304043631_create_games.rb create mode 100644 db/migrate/20140304043633_create_users.rb create mode 100644 db/migrate/20140304043635_create_game_attributes.rb create mode 100644 db/migrate/20140304043637_create_server_settings.rb create mode 100644 db/migrate/20140304043639_create_user_team_pairs.rb create mode 100644 db/migrate/20140304043642_create_team_match_pairs.rb create mode 100644 db/migrate/20140304043652_add_index_to_users_email.rb create mode 100644 db/migrate/20140304043654_add_index_to_users_user_name.rb create mode 100644 db/migrate/20140304043656_add_password_digest_to_users.rb create mode 100644 db/migrate/20140304043658_add_remember_token_to_users.rb create mode 100644 db/migrate/20140304043700_create_tournament_options.rb diff --git a/db/migrate/20140304041637_create_servers.rb b/db/migrate/20140304041637_create_servers.rb deleted file mode 100644 index f33241a..0000000 --- a/db/migrate/20140304041637_create_servers.rb +++ /dev/null @@ -1,8 +0,0 @@ -class CreateServers < ActiveRecord::Migration - def change - create_table :servers do |t| - - t.timestamps - end - end -end diff --git a/db/migrate/20140304041639_create_tournaments.rb b/db/migrate/20140304041639_create_tournaments.rb deleted file mode 100644 index 36fcf7e..0000000 --- a/db/migrate/20140304041639_create_tournaments.rb +++ /dev/null @@ -1,9 +0,0 @@ -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/20140304041641_create_matches.rb b/db/migrate/20140304041641_create_matches.rb deleted file mode 100644 index 325863d..0000000 --- a/db/migrate/20140304041641_create_matches.rb +++ /dev/null @@ -1,10 +0,0 @@ -class CreateMatches < ActiveRecord::Migration - def change - create_table :matches do |t| - t.references :tournament, index: true - t.string :name - - t.timestamps - end - end -end diff --git a/db/migrate/20140304041643_create_teams.rb b/db/migrate/20140304041643_create_teams.rb deleted file mode 100644 index dd8397d..0000000 --- a/db/migrate/20140304041643_create_teams.rb +++ /dev/null @@ -1,8 +0,0 @@ -class CreateTeams < ActiveRecord::Migration - def change - create_table :teams do |t| - - t.timestamps - end - end -end diff --git a/db/migrate/20140304041646_create_alerts.rb b/db/migrate/20140304041646_create_alerts.rb deleted file mode 100644 index 68a8e10..0000000 --- a/db/migrate/20140304041646_create_alerts.rb +++ /dev/null @@ -1,10 +0,0 @@ -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/20140304041648_create_pms.rb b/db/migrate/20140304041648_create_pms.rb deleted file mode 100644 index 93bb5c6..0000000 --- a/db/migrate/20140304041648_create_pms.rb +++ /dev/null @@ -1,11 +0,0 @@ -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/20140304041650_create_games.rb b/db/migrate/20140304041650_create_games.rb deleted file mode 100644 index 59d4ef0..0000000 --- a/db/migrate/20140304041650_create_games.rb +++ /dev/null @@ -1,13 +0,0 @@ -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/20140304041652_create_users.rb b/db/migrate/20140304041652_create_users.rb deleted file mode 100644 index f0986d4..0000000 --- a/db/migrate/20140304041652_create_users.rb +++ /dev/null @@ -1,11 +0,0 @@ -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/20140304041655_create_game_attributes.rb b/db/migrate/20140304041655_create_game_attributes.rb deleted file mode 100644 index b63f134..0000000 --- a/db/migrate/20140304041655_create_game_attributes.rb +++ /dev/null @@ -1,11 +0,0 @@ -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/20140304041657_create_server_settings.rb b/db/migrate/20140304041657_create_server_settings.rb deleted file mode 100644 index dfdd91b..0000000 --- a/db/migrate/20140304041657_create_server_settings.rb +++ /dev/null @@ -1,8 +0,0 @@ -class CreateServerSettings < ActiveRecord::Migration - def change - create_table :server_settings do |t| - - t.timestamps - end - end -end diff --git a/db/migrate/20140304041659_create_user_team_pairs.rb b/db/migrate/20140304041659_create_user_team_pairs.rb deleted file mode 100644 index 2c492ac..0000000 --- a/db/migrate/20140304041659_create_user_team_pairs.rb +++ /dev/null @@ -1,10 +0,0 @@ -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/20140304041701_create_team_match_pairs.rb b/db/migrate/20140304041701_create_team_match_pairs.rb deleted file mode 100644 index 8fac07e..0000000 --- a/db/migrate/20140304041701_create_team_match_pairs.rb +++ /dev/null @@ -1,10 +0,0 @@ -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/20140304041711_add_index_to_user_email.rb b/db/migrate/20140304041711_add_index_to_user_email.rb deleted file mode 100644 index 1bc4c56..0000000 --- a/db/migrate/20140304041711_add_index_to_user_email.rb +++ /dev/null @@ -1,4 +0,0 @@ -class AddIndexToUserEmail < ActiveRecord::Migration - def change - end -end diff --git a/db/migrate/20140304041714_add_index_to_user_name.rb b/db/migrate/20140304041714_add_index_to_user_name.rb deleted file mode 100644 index a77567b..0000000 --- a/db/migrate/20140304041714_add_index_to_user_name.rb +++ /dev/null @@ -1,4 +0,0 @@ -class AddIndexToUserName < ActiveRecord::Migration - def change - end -end diff --git a/db/migrate/20140304041716_add_password_digest_to_users.rb b/db/migrate/20140304041716_add_password_digest_to_users.rb deleted file mode 100644 index 0070da7..0000000 --- a/db/migrate/20140304041716_add_password_digest_to_users.rb +++ /dev/null @@ -1,4 +0,0 @@ -class AddPasswordDigestToUsers < ActiveRecord::Migration - def change - end -end diff --git a/db/migrate/20140304041718_add_remember_token_to_users.rb b/db/migrate/20140304041718_add_remember_token_to_users.rb deleted file mode 100644 index 74c254f..0000000 --- a/db/migrate/20140304041718_add_remember_token_to_users.rb +++ /dev/null @@ -1,4 +0,0 @@ -class AddRememberTokenToUsers < ActiveRecord::Migration - def change - end -end diff --git a/db/migrate/20140304041720_create_tournament_options.rb b/db/migrate/20140304041720_create_tournament_options.rb deleted file mode 100644 index d2df22e..0000000 --- a/db/migrate/20140304041720_create_tournament_options.rb +++ /dev/null @@ -1,8 +0,0 @@ -class CreateTournamentOptions < ActiveRecord::Migration - def change - create_table :tournament_options do |t| - - t.timestamps - end - end -end diff --git a/db/migrate/20140304043618_create_servers.rb b/db/migrate/20140304043618_create_servers.rb new file mode 100644 index 0000000..f33241a --- /dev/null +++ b/db/migrate/20140304043618_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/20140304043620_create_tournaments.rb b/db/migrate/20140304043620_create_tournaments.rb new file mode 100644 index 0000000..36fcf7e --- /dev/null +++ b/db/migrate/20140304043620_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/20140304043622_create_matches.rb b/db/migrate/20140304043622_create_matches.rb new file mode 100644 index 0000000..325863d --- /dev/null +++ b/db/migrate/20140304043622_create_matches.rb @@ -0,0 +1,10 @@ +class CreateMatches < ActiveRecord::Migration + def change + create_table :matches do |t| + t.references :tournament, index: true + t.string :name + + t.timestamps + end + end +end diff --git a/db/migrate/20140304043624_create_teams.rb b/db/migrate/20140304043624_create_teams.rb new file mode 100644 index 0000000..dd8397d --- /dev/null +++ b/db/migrate/20140304043624_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/20140304043626_create_alerts.rb b/db/migrate/20140304043626_create_alerts.rb new file mode 100644 index 0000000..68a8e10 --- /dev/null +++ b/db/migrate/20140304043626_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/20140304043629_create_pms.rb b/db/migrate/20140304043629_create_pms.rb new file mode 100644 index 0000000..93bb5c6 --- /dev/null +++ b/db/migrate/20140304043629_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/20140304043631_create_games.rb b/db/migrate/20140304043631_create_games.rb new file mode 100644 index 0000000..59d4ef0 --- /dev/null +++ b/db/migrate/20140304043631_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/20140304043633_create_users.rb b/db/migrate/20140304043633_create_users.rb new file mode 100644 index 0000000..f0986d4 --- /dev/null +++ b/db/migrate/20140304043633_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/20140304043635_create_game_attributes.rb b/db/migrate/20140304043635_create_game_attributes.rb new file mode 100644 index 0000000..b63f134 --- /dev/null +++ b/db/migrate/20140304043635_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/20140304043637_create_server_settings.rb b/db/migrate/20140304043637_create_server_settings.rb new file mode 100644 index 0000000..dfdd91b --- /dev/null +++ b/db/migrate/20140304043637_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/20140304043639_create_user_team_pairs.rb b/db/migrate/20140304043639_create_user_team_pairs.rb new file mode 100644 index 0000000..2c492ac --- /dev/null +++ b/db/migrate/20140304043639_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/20140304043642_create_team_match_pairs.rb b/db/migrate/20140304043642_create_team_match_pairs.rb new file mode 100644 index 0000000..8fac07e --- /dev/null +++ b/db/migrate/20140304043642_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/20140304043652_add_index_to_users_email.rb b/db/migrate/20140304043652_add_index_to_users_email.rb new file mode 100644 index 0000000..b5f8a1a --- /dev/null +++ b/db/migrate/20140304043652_add_index_to_users_email.rb @@ -0,0 +1,4 @@ +class AddIndexToUsersEmail < ActiveRecord::Migration + def change + end +end diff --git a/db/migrate/20140304043654_add_index_to_users_user_name.rb b/db/migrate/20140304043654_add_index_to_users_user_name.rb new file mode 100644 index 0000000..724cca5 --- /dev/null +++ b/db/migrate/20140304043654_add_index_to_users_user_name.rb @@ -0,0 +1,4 @@ +class AddIndexToUsersUserName < ActiveRecord::Migration + def change + end +end diff --git a/db/migrate/20140304043656_add_password_digest_to_users.rb b/db/migrate/20140304043656_add_password_digest_to_users.rb new file mode 100644 index 0000000..0070da7 --- /dev/null +++ b/db/migrate/20140304043656_add_password_digest_to_users.rb @@ -0,0 +1,4 @@ +class AddPasswordDigestToUsers < ActiveRecord::Migration + def change + end +end diff --git a/db/migrate/20140304043658_add_remember_token_to_users.rb b/db/migrate/20140304043658_add_remember_token_to_users.rb new file mode 100644 index 0000000..74c254f --- /dev/null +++ b/db/migrate/20140304043658_add_remember_token_to_users.rb @@ -0,0 +1,4 @@ +class AddRememberTokenToUsers < ActiveRecord::Migration + def change + end +end diff --git a/db/migrate/20140304043700_create_tournament_options.rb b/db/migrate/20140304043700_create_tournament_options.rb new file mode 100644 index 0000000..d2df22e --- /dev/null +++ b/db/migrate/20140304043700_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 index eb44d71..1f844f5 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 20140304041720) do +ActiveRecord::Schema.define(version: 20140304043700) do create_table "alerts", force: true do |t| t.integer "author_id" diff --git a/generate.sh b/generate.sh index bf980f3..f0db78e 100755 --- a/generate.sh +++ b/generate.sh @@ -37,8 +37,8 @@ bundle exec rails generate controller sessions #added some stuff to the database -bundle exec rails generate migration add_index_to_user_email -bundle exec rails generate migration add_index_to_user_name +bundle exec rails generate migration add_index_to_users_email +bundle exec rails generate migration add_index_to_users_user_name bundle exec rails generate migration add_password_digest_to_users bundle exec rails generate migration add_remember_token_to_users @@ -46,8 +46,8 @@ bundle exec rails generate migration add_remember_token_to_users bundle exec rails generate model tournament_option $NOTEST #bundle exec rails generate scaffold -git add app test config/routes.rb db/migrate db/schema.rb - bundle exec rake db:drop RAILS_ENV=development bundle exec rake db:migrate RAILS_ENV=development bundle exec rake db:seed + +git add app test config/routes.rb db/migrate db/schema.rb -- cgit v1.1-4-g5e80 From 42cf035f9023e773a20d2b14a984ba0a5fef9c60 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Tue, 4 Mar 2014 10:15:26 -0500 Subject: don't run generate in start.sh, ignore nohup.out --- .gitignore | 3 ++- start.sh | 1 - 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 9e29fc1..0e07518 100644 --- a/.gitignore +++ b/.gitignore @@ -17,7 +17,8 @@ # The above is from Rails. The following is from Luke. /vendor/bundle -# As noted aboce, you probably want to add the following to your global git config. +nohup.out +# As noted above, you probably want to add the following to your global git config. .~lock.* *~ *# diff --git a/start.sh b/start.sh index 6c0d594..cb9cdda 100755 --- a/start.sh +++ b/start.sh @@ -1,5 +1,4 @@ #!/bin/bash -generate.sh nohup bundle exec rails server & -- cgit v1.1-4-g5e80 From 1d90f33bf07f9610d358c6c9c56754784b050541 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Tue, 4 Mar 2014 10:57:54 -0500 Subject: simplify the sessions routing --- app/controllers/sessions_controller.rb | 25 ++++++++++++++----------- app/views/layouts/application.html.erb | 17 +++++++++-------- app/views/sessions/new.html.erb | 2 +- app/views/static/homepage.html.erb | 4 ++-- app/views/users/new.html.erb | 2 +- config/routes.rb | 8 ++------ 6 files changed, 29 insertions(+), 29 deletions(-) diff --git a/app/controllers/sessions_controller.rb b/app/controllers/sessions_controller.rb index 3417332..fa5d024 100644 --- a/app/controllers/sessions_controller.rb +++ b/app/controllers/sessions_controller.rb @@ -1,25 +1,28 @@ class SessionsController < ApplicationController + # GET /sessions/new def new if @user.nil? @user = User.new end end - # find the user and create a new session - def create - @user = User.find_by(email: params[:session][:email].downcase) - if @user && @user.authenticate(params[:session][:password]) + # POST /sessions + def create + # find the user... + @user = User.find_by(email: params[:session][:email].downcase) + # ... and create a new session + if @user && @user.authenticate(params[:session][:password]) sign_in @user - redirect_to root_path - else - redirect_to signin_path + redirect_to root_path + else + redirect_to new_session_path + end end - end + # DELETE /sessions/current def destroy - sign_out - redirect_to root_path + sign_out + redirect_to root_path end - end diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index b36c0c5..f12c778 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -19,14 +19,15 @@ <%= submit_tag("Go", {:class => "btn btn-warning"}) %> <% end %>

- <% if signed_in? %> -
  • <%= current_user.user_name.upcase %>
  • - <% end %> -
  • - <%= if signed_in? do %> - <%= link_to "Sign out", signout_path, method: "delete" %> - <% end; end %> -
  • +
      + <% if signed_in? %> +
    • <%= current_user.user_name.upcase %>
    • +
    • <%= link_to "Sign out", session_path("current"), method: "delete" %>
    • + <% else %> +
    • <%= link_to "Log in", new_session_path %>
    • +
    • <%= link_to "Sign up", new_user_path %>
    • + <% end %> +
    diff --git a/app/views/sessions/new.html.erb b/app/views/sessions/new.html.erb index 2e7a0d3..a820b2f 100644 --- a/app/views/sessions/new.html.erb +++ b/app/views/sessions/new.html.erb @@ -15,6 +15,6 @@ <%= f.submit "Sign in", class: "btn btn-large btn-primary" %> <% end %> -

    New user? <%= link_to "Sign up now!", signup_path %>

    +

    New user? <%= link_to "Sign up now!", new_user_path %>

    diff --git a/app/views/static/homepage.html.erb b/app/views/static/homepage.html.erb index 8b96e11..3ca8176 100644 --- a/app/views/static/homepage.html.erb +++ b/app/views/static/homepage.html.erb @@ -5,8 +5,8 @@

    This is a tournment management system designed to be used for any team sport. Our peer review system ensures that the best players move on to the next round! Try creating a new tournament and having people sign up for it.

    <% if !signed_in? %> - <%= link_to 'Log In', "/signin", :class => "btn btn-warning btn-lg", :role => "button" %> - <%= link_to 'Sign Up', "/signup", :class => "btn btn-warning btn-lg", :role => "button" %> + <%= link_to 'Log In', new_session_path, :class => "btn btn-warning btn-lg", :role => "button" %> + <%= link_to 'Sign Up', new_user_path, :class => "btn btn-warning btn-lg", :role => "button" %> <% else %> <%= link_to 'Start a Tournament', new_tournament_path, :class => "btn btn-warning btn-lg", :role => "button" %> <% end %> diff --git a/app/views/users/new.html.erb b/app/views/users/new.html.erb index aa71f00..f0ce746 100644 --- a/app/views/users/new.html.erb +++ b/app/views/users/new.html.erb @@ -56,5 +56,5 @@

    -<%= link_to 'Already Have an Account? Log in', "signin", :class => "btn btn-warning btn-lg" %> +<%= link_to 'Already Have an Account? Log in', new_session_path, :class => "btn btn-warning btn-lg" %> diff --git a/config/routes.rb b/config/routes.rb index d3f6654..022ce42 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -1,11 +1,7 @@ Leaguer::Application.routes.draw do - #creates sessions as a resource but limits it to these actions - resources :sessions, only: [:new, :create, :destroy] - - match '/signup', to: 'users#new', via: 'get' - match '/signin', to: 'sessions#new', via: 'get' - match '/signout', to: 'sessions#destroy', via: 'get' + #creates sessions as a resource but limits it to these actions + resources :sessions, only: [:new, :create, :destroy] resources :users -- cgit v1.1-4-g5e80 From 42c241f0d533e243a01560d28e8cd7e3b90a6165 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Tue, 4 Mar 2014 11:38:21 -0500 Subject: indent application.html.erb --- app/views/layouts/application.html.erb | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index f12c778..0362062 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -10,14 +10,12 @@ - -
    -<%= yield %>
    + +
    <%= yield %>
    +
    -

    Tomer Kimia Andrew Murrell Luke Shumaker Nathaniel Foy Davis Webb Guntas Grewal

    -

    The Leaguer System © <%= Time.now.year %>

    - <%= debug(params) if Rails.env.development? %> +

    Leaguer is copyright © 2014, Tomer Kimia, Andrew Murrell, Luke Shumaker, Nathaniel Foy, Davis Webb, and Guntas Grewal

    + +<%= debug(params) if Rails.env.development? %> -- cgit v1.1-4-g5e80 From 47db24fe712877d919256c431d0c5fcbbd431a45 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Tue, 4 Mar 2014 11:50:33 -0500 Subject: make notifications be shown an all pages --- app/views/alerts/show.html.erb | 2 -- app/views/games/show.html.erb | 2 -- app/views/layouts/application.html.erb | 2 ++ app/views/matches/show.html.erb | 2 -- app/views/pms/show.html.erb | 2 -- app/views/servers/show.html.erb | 2 -- app/views/teams/show.html.erb | 2 -- app/views/tournaments/show.html.erb | 2 -- app/views/users/show.html.erb | 2 -- 9 files changed, 2 insertions(+), 16 deletions(-) diff --git a/app/views/alerts/show.html.erb b/app/views/alerts/show.html.erb index eeab7f7..5dda2c9 100644 --- a/app/views/alerts/show.html.erb +++ b/app/views/alerts/show.html.erb @@ -1,5 +1,3 @@ -

    <%= notice %>

    -

    Author: <%= @alert.author %> diff --git a/app/views/games/show.html.erb b/app/views/games/show.html.erb index 7986016..88bf91c 100644 --- a/app/views/games/show.html.erb +++ b/app/views/games/show.html.erb @@ -1,5 +1,3 @@ -

    <%= notice %>

    -

    Name: <%= @game.name %> diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index 0362062..4651efc 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -29,6 +29,8 @@ +<% if notice %>

    <%= notice %>

    <% end %> +
    <%= yield %>

    diff --git a/app/views/matches/show.html.erb b/app/views/matches/show.html.erb index 0b02ae7..9c9cbb4 100644 --- a/app/views/matches/show.html.erb +++ b/app/views/matches/show.html.erb @@ -1,5 +1,3 @@ -

    <%= notice %>

    -

    Tournament: <%= @match.tournament %> diff --git a/app/views/pms/show.html.erb b/app/views/pms/show.html.erb index 5ee483f..2a03716 100644 --- a/app/views/pms/show.html.erb +++ b/app/views/pms/show.html.erb @@ -1,5 +1,3 @@ -

    <%= notice %>

    -

    Author: <%= @pm.author %> diff --git a/app/views/servers/show.html.erb b/app/views/servers/show.html.erb index 039cd8f..67f7647 100644 --- a/app/views/servers/show.html.erb +++ b/app/views/servers/show.html.erb @@ -1,4 +1,2 @@ -

    <%= notice %>

    - <%= link_to 'Edit', edit_server_path(@server) %> | <%= link_to 'Back', servers_path %> diff --git a/app/views/teams/show.html.erb b/app/views/teams/show.html.erb index 5b18d33..ab49d65 100644 --- a/app/views/teams/show.html.erb +++ b/app/views/teams/show.html.erb @@ -1,4 +1,2 @@ -

    <%= notice %>

    - <%= link_to 'Edit', edit_team_path(@team) %> | <%= link_to 'Back', teams_path %> diff --git a/app/views/tournaments/show.html.erb b/app/views/tournaments/show.html.erb index 30df788..0d9dd10 100644 --- a/app/views/tournaments/show.html.erb +++ b/app/views/tournaments/show.html.erb @@ -1,5 +1,3 @@ -

    <%= notice %>

    -

    Game: <%= @tournament.game %> diff --git a/app/views/users/show.html.erb b/app/views/users/show.html.erb index 9455a3c..d8cc82b 100644 --- a/app/views/users/show.html.erb +++ b/app/views/users/show.html.erb @@ -1,5 +1,3 @@ -

    <%= notice %>

    -

    Name: <%= @user.name %> -- cgit v1.1-4-g5e80 From 1cc839ab908ea1227e32f183609e86cedb3248fb Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Tue, 4 Mar 2014 11:52:10 -0500 Subject: fix typos in comments --- app/models/user.rb | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/app/models/user.rb b/app/models/user.rb index a4fafa0..23caf84 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -12,13 +12,13 @@ class User < ActiveRecord::Base before_create :create_remember_token ## - # VAILD_EMAIL is the regex used to valid a user given email. + # VAILD_EMAIL is the regex used to validate a user given email. # # A break down of the regex is listed below. # # / -------------> Start of the regex # \A ------------> match start of a string - # [\w+\-.]+ -----> at least one owrd character, plus, hyphen, + # [\w+\-.]+ -----> at least one word character, plus, hyphen, # or dot # @ -------------> literal ampersand # [a-z\d\-.]+ ---> at least one letter, digit, hyphen, or dot @@ -26,7 +26,7 @@ class User < ActiveRecord::Base # does not occur # \z ------------> match end of a string # / -------------> end of the regex - # i -------------> case insensative + # i -------------> case insensitive VALID_EMAIL_REG = /\A[\w+\-.]+@[a-z\d\-.]+(?:\.[a-z]+)\z/i ## @@ -35,11 +35,11 @@ class User < ActiveRecord::Base VALID_USER_NAME_REG = /[a-zA-Z0-9\-]/ ## - # The following lines put a user accout through a series of + # The following lines put a user account through a series of # validations in order to make sure all of their information # is in the proper format. # - # validates :symbol_to_be_valided + # validates :symbol_to_be_validated # # - presence: determines whether or not a symbol is filled or not # - length: ensures there is a length limit on the symbol @@ -56,7 +56,7 @@ class User < ActiveRecord::Base ## # Instead of adding password and password_confirmation # attributes, requiring the presence of a password, - # requirin that pw and pw_com match, and add an authenticate + # requiring that pw and pw_com match, and add an authenticate # method to compare an encrypted password to the # password_digest to authenticate users, I can just add # has_secure_password which does all of this for me. @@ -84,7 +84,7 @@ class User < ActiveRecord::Base # the database. # # The reasoning for storing a hashed token is so that even if - # the database is compromised, the atacker won't be able to use + # the database is compromised, the attacker won't be able to use # the remember tokens to sign in. def User.hash(token) Digest::SHA1.hexdigest(token.to_s) @@ -112,7 +112,7 @@ class User < ActiveRecord::Base end ## - # In order to ensure that someone did not accidently submit + # In order to ensure that someone did not accidentally submit # two accounts rapidly (which would throw off the validates # for user_name and email), I added an index to the Users # email and user_name in the database to ensure uniqueness -- cgit v1.1-4-g5e80 From da95cb4f0f48731c2713c61f17b522b048647fd1 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Tue, 4 Mar 2014 12:02:15 -0500 Subject: Use the navbar header to demonstrate using SCSS @extend --- app/assets/stylesheets/custom.css.scss | 5 +++++ app/views/layouts/application.html.erb | 6 ++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/app/assets/stylesheets/custom.css.scss b/app/assets/stylesheets/custom.css.scss index cbd46a7..25cac21 100644 --- a/app/assets/stylesheets/custom.css.scss +++ b/app/assets/stylesheets/custom.css.scss @@ -1 +1,6 @@ @import "bootstrap"; + +header > nav { + @extend .navbar; + @extend .navbar-inverse; +} diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index 4651efc..d817484 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -8,8 +8,7 @@ <%= yield :head %> -

    + <% if notice %>

    <%= notice %>

    <% end %> -- cgit v1.1-4-g5e80