Changesets can be listed by changeset number.
The Git repository is here.
- Revision:
- 171
- Log:
Initial import of Beast 0.9 from downloaded Tarball. Beast is a Ruby
On Rails based forum application. The original tarball came from the
following location:http://s3.amazonaws.com/beast-forum/beast-0.9.tar.gz
The forum post which announced this version's availability was at:
http://beast.caboo.se/forums/1/topics/446
- Author:
- rool
- Date:
- Fri Mar 02 15:51:55 +0000 2007
- Size:
- 2242 Bytes
1 | require File.dirname(__FILE__) + '/../test_helper' |
2 | require 'forums_controller' |
3 | |
4 | # Re-raise errors caught by the controller. |
5 | class ForumsController; def rescue_action(e) raise e end; end |
6 | |
7 | class ForumsControllerTest < Test::Unit::TestCase |
8 | all_fixtures |
9 | |
10 | def setup |
11 | @controller = ForumsController.new |
12 | @request = ActionController::TestRequest.new |
13 | @response = ActionController::TestResponse.new |
14 | end |
15 | |
16 | def test_remember_me_logs_into_home |
17 | @request.cookies['login_token'] = CGI::Cookie.new('login_token', [users(:sam).id.to_s, users(:sam).login_key].join(';')) |
18 | get :index |
19 | assert_equal users(:sam).id, session[:user_id] |
20 | end |
21 | |
22 | def test_remember_me_logs_in_when_login_required |
23 | users(:aaron).login_key="8305f94ab2b92f99137abbc235ee28e5" |
24 | users(:aaron).login_key_expires_at=Time.now.utc+1.week |
25 | users(:aaron).save! |
26 | @request.cookies['login_token'] = CGI::Cookie.new('login_token', [users(:aaron).id.to_s, users(:aaron).login_key].join(';')) |
27 | get :edit, :id => users(:aaron).id |
28 | assert_equal users(:aaron).id, session[:user_id] |
29 | end |
30 | |
31 | |
32 | def test_should_get_index |
33 | get :index |
34 | assert_response :success |
35 | assert assigns(:forums) |
36 | end |
37 | |
38 | def test_should_get_new |
39 | login_as :aaron |
40 | get :new |
41 | assert_response :success |
42 | end |
43 | |
44 | def test_should_require_admin |
45 | login_as :sam |
46 | get :new |
47 | assert_redirected_to login_path |
48 | end |
49 | |
50 | def test_should_create_forum |
51 | login_as :aaron |
52 | assert_difference Forum, :count do |
53 | post :create, :forum => { :name => 'yeah' } |
54 | end |
55 | |
56 | assert_redirected_to forums_path |
57 | end |
58 | |
59 | def test_should_show_forum |
60 | get :show, :id => 1 |
61 | assert_response :success |
62 | assert assigns(:topics) |
63 | # sticky should be first |
64 | assert_equal(topics(:sticky), assigns(:topics).first) |
65 | end |
66 | |
67 | def test_should_get_edit |
68 | login_as :aaron |
69 | get :edit, :id => 1 |
70 | assert_response :success |
71 | end |
72 | |
73 | def test_should_update_forum |
74 | login_as :aaron |
75 | put :update, :id => 1, :forum => { } |
76 | assert_redirected_to forums_path |
77 | end |
78 | |
79 | def test_should_destroy_forum |
80 | login_as :aaron |
81 | old_count = Forum.count |
82 | delete :destroy, :id => 1 |
83 | assert_equal old_count-1, Forum.count |
84 | |
85 | assert_redirected_to forums_path |
86 | end |
87 | end |