diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/controllers/alerts_controller_test.rb | 49 | ||||
-rw-r--r-- | test/controllers/main_controller_test.rb | 7 | ||||
-rw-r--r-- | test/controllers/matches_controller_test.rb | 4 | ||||
-rw-r--r-- | test/controllers/pms_controller_test.rb | 49 | ||||
-rw-r--r-- | test/controllers/search_controller_test.rb | 7 | ||||
-rw-r--r-- | test/controllers/users_controller_test.rb | 4 | ||||
-rw-r--r-- | test/fixtures/alerts.yml | 9 | ||||
-rw-r--r-- | test/fixtures/matches.yml | 14 | ||||
-rw-r--r-- | test/fixtures/pms.yml | 11 | ||||
-rw-r--r-- | test/fixtures/server_settings.yml | 11 | ||||
-rw-r--r-- | test/fixtures/team_match_pairs.yml | 9 | ||||
-rw-r--r-- | test/fixtures/user_team_pairs.yml | 9 | ||||
-rw-r--r-- | test/fixtures/users.yml | 18 | ||||
-rw-r--r-- | test/helpers/alerts_helper_test.rb | 4 | ||||
-rw-r--r-- | test/helpers/main_helper_test.rb | 4 | ||||
-rw-r--r-- | test/helpers/pms_helper_test.rb | 4 | ||||
-rw-r--r-- | test/helpers/search_helper_test.rb | 4 | ||||
-rw-r--r-- | test/models/alert_test.rb | 7 | ||||
-rw-r--r-- | test/models/pm_test.rb | 7 | ||||
-rw-r--r-- | test/models/server_settings_test.rb | 7 | ||||
-rw-r--r-- | test/models/team_match_pair_test.rb | 7 | ||||
-rw-r--r-- | test/models/user_team_pair_test.rb | 7 |
22 files changed, 230 insertions, 22 deletions
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 |