On 04/29/2010 04:30 PM, Chris Apolzon wrote:
> Just a shot in the dark, but a 302 is a redirect, so even though it
> *appears* to work when you do a manual check you might just be missing
> the fact that you were redirected.
Unluckily for me thats not the case
Failure is
---
1) Failure:
test_logged_in_can_access(FriendsControllerTest)
[/test/functional/friends_controller_test.rb:23]:
Expected response to be a <:success>, but was <302>
---
and test is
---
def test_logged_in_can_access
log_in('Abraham', 'pass')
get :index
assert_response :redirect
assert_redirected_to :controller => :users, :action => :login
assert_response :success
end
---
so assertions
assert_response :redirect
assert_redirected_to :controller => :users, :action => :login
succeed and
assert_response :success
fails. Which means I'm redirected to login page ( in this test).
I suspect I'm doing login or fixture wrong:
---
def log_in(uname, pass)
post :controller => :users, :action => :login, :login => uname,
:password => pass
end
---
---
<% SALT = "Natrium Chloride"%>
<% PASS = "pass"%>
Admin:
id: 1
name: Abraham
email_address: [email protected]
administrator: true
salt: <%= SALT %>
crypted_password: <%= User.encrypt( PASS, SALT)%>
---
--
You received this message because you are subscribed to the Google Groups "Hobo
Users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/hobousers?hl=en.