summaryrefslogtreecommitdiff
path: root/test/controllers/brackets_controller_test.rb
diff options
context:
space:
mode:
authortkimia <tkimia@purdue.edu>2014-04-10 17:43:47 -0400
committertkimia <tkimia@purdue.edu>2014-04-10 17:43:47 -0400
commitefa8017199d496a84ed7385a35cfde9e4cd32b1a (patch)
treea39cf49a4adca19d92584906f04724c67370fe52 /test/controllers/brackets_controller_test.rb
parenteab572fdecdaf3cf7464d189f0b1de1d1c3b2c46 (diff)
parentb09b504fad01988004745363332375697135800a (diff)
Merge branch 'clean2'
Conflicts: app/assets/stylesheets/matches.css.scss app/assets/stylesheets/tournaments.css.scss app/controllers/alerts_controller.rb app/controllers/games_controller.rb app/controllers/matches_controller.rb app/controllers/pms_controller.rb app/controllers/servers_controller.rb app/controllers/sessions_controller.rb app/controllers/teams_controller.rb app/controllers/tournaments_controller.rb app/controllers/users_controller.rb app/helpers/sessions_helper.rb app/models/alert.rb app/models/game.rb app/models/match.rb app/models/server.rb app/models/session.rb app/models/team.rb app/models/tournament.rb app/models/user.rb app/views/alerts/show.html.erb app/views/games/index.html.erb app/views/games/show.html.erb app/views/matches/_form.html.erb app/views/matches/index.html.erb app/views/matches/index.json.jbuilder app/views/matches/new.html.erb app/views/matches/show.html.erb app/views/matches/show.json.jbuilder app/views/pms/show.html.erb app/views/servers/_form.html.erb app/views/servers/edit.html.erb app/views/servers/show.html.erb app/views/sessions/new.html.erb app/views/tournaments/index.html.erb app/views/tournaments/new.html.erb app/views/tournaments/show.html.erb app/views/users/_form.html.erb app/views/users/edit.html.erb app/views/users/index.html.erb app/views/users/new.html.erb app/views/users/show.html.erb config/routes.rb db/migrate/20140406195921_create_simple_captcha_data.rb db/migrate/20140406235927_create_delayed_jobs.rb db/migrate/20140406235933_create_servers.rb db/migrate/20140406235940_create_matches.rb db/migrate/20140406235946_create_teams.rb db/migrate/20140406235952_create_alerts.rb db/migrate/20140406235958_create_pms.rb db/migrate/20140407000005_create_tournaments.rb db/migrate/20140407000011_create_games.rb db/migrate/20140407000017_create_users.rb db/migrate/20140407000024_create_sessions.rb db/migrate/20140407000030_create_server_settings.rb db/migrate/20140407000036_create_game_settings.rb db/migrate/20140407000042_create_tournament_preferences.rb db/migrate/20140407000048_create_scores.rb db/migrate/20140407000054_create_remote_usernames.rb db/migrate/20140407000100_create_tournament_players_join_table.rb db/migrate/20140407000106_create_tournament_hosts_join_table.rb db/migrate/20140407000112_create_team_user_join_table.rb db/migrate/20140407000118_create_match_team_join_table.rb db/migrate/20140407000143_add_hidden_attrs_to_user.rb db/migrate/20140407041416_create_simple_captcha_data.rb db/migrate/20140407081419_create_delayed_jobs.rb db/migrate/20140407081422_create_servers.rb db/migrate/20140407081425_create_matches.rb db/migrate/20140407081427_create_teams.rb db/migrate/20140407081430_create_alerts.rb db/migrate/20140407081434_create_pms.rb db/migrate/20140407081437_create_tournaments.rb db/migrate/20140407081440_create_games.rb db/migrate/20140407081443_create_users.rb db/migrate/20140407081446_create_sessions.rb db/migrate/20140407081449_create_server_settings.rb db/migrate/20140407081452_create_game_settings.rb db/migrate/20140407081454_create_tournament_preferences.rb db/migrate/20140407081458_create_scores.rb db/migrate/20140407081501_create_remote_usernames.rb db/migrate/20140407081503_create_tournament_players_join_table.rb db/migrate/20140407081506_create_tournament_hosts_join_table.rb db/migrate/20140407081509_create_team_user_join_table.rb db/migrate/20140407081512_create_match_team_join_table.rb db/migrate/20140407081524_add_hidden_attrs_to_user.rb db/migrate/20140410170710_create_simple_captcha_data.rb db/migrate/20140410210717_create_delayed_jobs.rb db/migrate/20140410210723_create_servers.rb db/migrate/20140410210730_create_matches.rb db/migrate/20140410210736_create_teams.rb db/migrate/20140410210743_create_alerts.rb db/migrate/20140410210750_create_pms.rb db/migrate/20140410210756_create_tournaments.rb db/migrate/20140410210803_create_games.rb db/migrate/20140410210809_create_users.rb db/migrate/20140410210816_create_sessions.rb db/migrate/20140410211152_create_server_settings.rb db/migrate/20140410211158_create_game_settings.rb db/migrate/20140410211205_create_tournament_preferences.rb db/migrate/20140410211211_create_scores.rb db/migrate/20140410211217_create_remote_usernames.rb db/migrate/20140410211229_create_tournament_players_join_table.rb db/migrate/20140410211236_create_tournament_hosts_join_table.rb db/migrate/20140410211242_create_team_user_join_table.rb db/migrate/20140410211248_create_match_team_join_table.rb db/migrate/20140410211313_add_hidden_attrs_to_user.rb db/schema.rb test/controllers/matches_controller_test.rb test/fixtures/matches.yml
Diffstat (limited to 'test/controllers/brackets_controller_test.rb')
-rw-r--r--test/controllers/brackets_controller_test.rb49
1 files changed, 49 insertions, 0 deletions
diff --git a/test/controllers/brackets_controller_test.rb b/test/controllers/brackets_controller_test.rb
new file mode 100644
index 0000000..3f45a64
--- /dev/null
+++ b/test/controllers/brackets_controller_test.rb
@@ -0,0 +1,49 @@
+require 'test_helper'
+
+class BracketsControllerTest < ActionController::TestCase
+ setup do
+ @bracket = brackets(:one)
+ end
+
+ test "should get index" do
+ get :index
+ assert_response :success
+ assert_not_nil assigns(:brackets)
+ end
+
+ test "should get new" do
+ get :new
+ assert_response :success
+ end
+
+ test "should create bracket" do
+ assert_difference('Bracket.count') do
+ post :create, bracket: { name: @bracket.name, tournament_id: @bracket.tournament_id, user_id: @bracket.user_id }
+ end
+
+ assert_redirected_to bracket_path(assigns(:bracket))
+ end
+
+ test "should show bracket" do
+ get :show, id: @bracket
+ assert_response :success
+ end
+
+ test "should get edit" do
+ get :edit, id: @bracket
+ assert_response :success
+ end
+
+ test "should update bracket" do
+ patch :update, id: @bracket, bracket: { name: @bracket.name, tournament_id: @bracket.tournament_id, user_id: @bracket.user_id }
+ assert_redirected_to bracket_path(assigns(:bracket))
+ end
+
+ test "should destroy bracket" do
+ assert_difference('Bracket.count', -1) do
+ delete :destroy, id: @bracket
+ end
+
+ assert_redirected_to brackets_path
+ end
+end