Changesets can be listed by changeset number.
The Git repository is here.
- Revision:
- 173
- Log:
Updated to latest release of Beast according to the "getting started with
Beast" guide at:http://beast.caboo.se/forums/1/topics/381
This check-in includes frozen Edge Rails and has the beginnings of
configuration for the ROOL site included.
- Author:
- rool
- Date:
- Fri Mar 02 15:59:12 +0000 2007
- Size:
- 2744 Bytes
1 | require File.dirname(__FILE__) + '/../test_helper' |
2 | require 'monitorships_controller' |
3 | |
4 | # Re-raise errors caught by the controller. |
5 | class MonitorshipsController; def rescue_action(e) raise e end; end |
6 | |
7 | class MonitorshipsControllerTest < Test::Unit::TestCase |
8 | all_fixtures |
9 | def setup |
10 | @controller = MonitorshipsController.new |
11 | @request = ActionController::TestRequest.new |
12 | @response = ActionController::TestResponse.new |
13 | end |
14 | |
15 | def test_should_require_login |
16 | xhr :post, :create, :forum_id => forums(:rails).id, :topic_id => topics(:pdi).id, :id => users(:aaron).id |
17 | assert_response :success |
18 | end |
19 | |
20 | def test_should_add_monitorship |
21 | login_as :joe |
22 | assert_difference Monitorship, :count do |
23 | xhr :post, :create, :forum_id => forums(:rails).id, :topic_id => topics(:pdi).id, :id => users(:joe).id |
24 | assert_response :success |
25 | end |
26 | |
27 | assert topics(:pdi).monitors(true).include?(users(:joe)) |
28 | end |
29 | |
30 | def test_should_activate_monitorship |
31 | login_as :sam |
32 | assert_difference Monitorship, :count, 0 do |
33 | xhr :post, :create, :forum_id => forums(:rails).id, :topic_id => topics(:pdi).id, :id => users(:sam).id |
34 | assert_response :success |
35 | end |
36 | end |
37 | |
38 | def test_should_not_duplicate_monitorship |
39 | login_as :aaron |
40 | assert_difference Monitorship, :count, 0 do |
41 | xhr :post, :create, :forum_id => forums(:rails).id, :topic_id => topics(:pdi).id, :id => users(:aaron).id |
42 | assert_response :success |
43 | end |
44 | end |
45 | |
46 | def test_should_deactivate_monitorship |
47 | login_as :aaron |
48 | assert_difference Monitorship, :count, 0 do |
49 | xhr :delete, :destroy, :forum_id => forums(:rails).id, :topic_id => topics(:pdi).id, :id => users(:aaron).id |
50 | assert_response :success |
51 | end |
52 | |
53 | assert !topics(:pdi).monitors(true).include?(users(:aaron)) |
54 | end |
55 | |
56 | def test_should_require_login_with_html |
57 | post :create, :forum_id => forums(:rails).id, :topic_id => topics(:pdi).id, :id => users(:aaron).id |
58 | assert_redirected_to login_path |
59 | end |
60 | |
61 | def test_should_add_monitorship_with_html |
62 | login_as :joe |
63 | assert_difference Monitorship, :count do |
64 | post :create, :forum_id => forums(:rails).id, :topic_id => topics(:pdi).id, :id => users(:joe).id |
65 | assert_redirected_to topic_path(forums(:rails), topics(:pdi)) |
66 | end |
67 | |
68 | assert topics(:pdi).monitors(true).include?(users(:joe)) |
69 | end |
70 | |
71 | def test_should_deactivate_monitorship_with_html |
72 | login_as :aaron |
73 | assert_difference Monitorship, :count, 0 do |
74 | delete :destroy, :forum_id => forums(:rails).id, :topic_id => topics(:pdi).id, :id => users(:aaron).id |
75 | assert_redirected_to topic_path(forums(:rails), topics(:pdi)) |
76 | end |
77 | |
78 | assert !topics(:pdi).monitors(true).include?(users(:aaron)) |
79 | end |
80 | end |