Changesets can be listed by changeset number.
The Git repository is here.
- Revision:
- 206
- Log:
Initial import of Gullery, an open source photo gallery:
http://nubyonrails.com/pages/gullery
- Author:
- rool
- Date:
- Sun May 20 19:05:59 +0100 2007
- Size:
- 812 Bytes
1 | module AuthenticatedTestHelper |
2 | # Sets the current user in the session from the user fixtures. |
3 | def login_as(user) |
4 | @request.session[:user] = users(user).id |
5 | end |
6 | |
7 | def logout |
8 | @request.session[:user] = nil |
9 | end |
10 | |
11 | # Assert the block redirects to the login |
12 | # |
13 | # assert_requires_login(:bob) { get :edit, :id => 1 } |
14 | # |
15 | def assert_requires_login(user = nil, &block) |
16 | login_as(user) if user |
17 | block.call |
18 | assert_redirected_to :controller => 'account', :action => 'login' |
19 | end |
20 | |
21 | # Assert the block accepts the login |
22 | # |
23 | # assert_accepts_login(:bob) { get :edit, :id => 1 } |
24 | # |
25 | # Accepts anonymous logins: |
26 | # |
27 | # assert_accepts_login { get :list } |
28 | # |
29 | def assert_accepts_login(user = nil, &block) |
30 | login_as(user) if user |
31 | block.call |
32 | assert_response :success |
33 | end |
34 | end |