Displaying 10 results from an estimated 10 matches for "usercontrollertest".
2005 Dec 23
1
Salted Login Error
Anyone know what''s causing this?
------------------------------------------------------------------------
1) Error:
test_delete(UserControllerTest):
NoMethodError: undefined method `advance_by_days='' for Time:Class
./test/functional/user_controller_test.rb:132:in `test_delete''
2) Error:
test_signup(UserControllerTest):
NoMethodError: undefined method `advance_by_days='' for Time:Class
./test/functional/use...
2006 Jun 17
3
What is this failure trying to tell me?
...:user=>{ :login => "bob", :password => "test"}
assert_response :redirect
assert_session_has :user
assert_redirected_to :action => ''welcome''
Here is the failure I''m getting when I run my tests.
2) Failure:
test_login_required(UserControllerTest)
[test/functional/user_controller_test.rb:122]:
response is not a redirection to all of the options supplied
(redirection is <"http://test.host/user/welcome">), difference:
<{:controller=>"user"}>
assert_redirected_to :action => ''welcome''...
2008 Mar 01
0
Fixtures in ActionController::TestCase
Hi guys,
Need some help.
I am using Rails 2.0 and while writing functional test, I encountered
the following problem
class UserControllerTest < ActionController::TestCase
fixtures :users
...
def do_something
attempt_login(users(:valid_user)) # assuming valid_user is a
proper line in
...
end
def attempt_login(user)
post :login, :user => { :login => user.login, :password =>
user.password }
end
Running the test:
.....
2009 Apr 06
9
setup method in functional tests and instance variables
I have the following in my functional test file.
class UserControllerTest < ActionController::TestCase
fixtures :users
def setup
@controller = UserController.new
@request = ActionController::TestRequest.new
@response = ActionController::TestResponse.new
@invalid_user = user(:invalid_user)
@valid_user = users(:valid_user)
end
def test_login_succe...
2005 Jul 05
2
Salted hash login generator (verification problem?)
...nstant RAILS_DEFAULT_LOGGER
./test/functional/admin/../../../config/environment.rb:66: warning:
already initialized constant Controllers
Loaded suite
/usr/local/lib/ruby/gems/1.8/gems/rake-0.5.4/lib/rake/rake_test_loader
Started
....E.E..F
Finished in 10.11708 seconds.
1) Error:
test_delete(UserControllerTest):
NoMethodError: undefined method `deleted='' for nil:NilClass
./test/functional/../../config/..//app/controllers/user_controller.rb:
141:in `restore_deleted''
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.8.1/lib/
action_controller/base.rb:708:in `send''...
2005 May 18
10
Salted Login Generator issues
Hello all,
I''ve just installed and begun to integrate the salted login generator.
So far I''m very impressed, though I''ve hit a few snags along the way.
Unfortunately, I''ve met the first one that I haven''t been able to
resolve on my own.
When I hit the login action, I get errors in my log files. The specific
error with trace is included below.
2006 Jul 11
0
assert_redirected_to not recognizing routes
...est_signin
admin = users(:adminuser)
post :signin, {:login => admin.email, :realpass => @password}
assert_redirected_to :action => ''list'' # failure happens on this line
assert_equal admin.id, session[:user].id
end
The error is:
2) Error:
test_signin(UserControllerTest):
RuntimeError: The number of parameters does not match the number of
substitutions.
/opt/local/lib/ruby/gems/1.8/gems/actionpack-1.12.3/lib/action_controller/assertions.rb:92:in
`assert_redirected_to''
/opt/local/lib/ruby/gems/1.8/gems/actionpack-1.12.3/lib/action_controller/assert...
2006 May 03
0
Accessing the params hash in a functional test not working
...ror] = "The email address and/or password you entered is
invalid.".t
redirect_back_or_default :action => "login"
end
end
end
The test fails as follows. Note that session[:debug_params] is missing the
parameters sent by post.
7) Failure:
test_auth_bob(UserControllerTest)
[c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.1
/lib/action_controller/depr
ecated_assertions.rb:23:in `assert_session_has''
./test/functional/user_controller_test.rb:25:in `test_auth_bob'']:
<:user> is not in the session <#<ActionController::TestSession:0x36...
2006 Feb 27
1
Functional test problem with environments variables
...statements like
@user = [''USER_DETAILS''].name.
But when i code the functional test, even the most simple test like
test_index in user_controller_test, it failed and result in this error :
NameError: uninitialized constant USER_DETAILS
inside the test_index is like this:
class UserControllerTest < Test::Unit::TestCase
def setup
@user = User.new
end
def test_index
get :index
assert_response :success
end
end
Is there anything that went wrong? Is there any files i need to set to
tell rails to go to the config file to get the constant USER_DETAILS?
Thanks for any help...
2007 Mar 22
1
Functional test and flash with an error
...mes Apps was successfully created.",
:attributes=>{:id=>"notice"}, :tag=>"div"} in the file application.rb.
I tried using a regular expression - /#{user.first_name}/ , but that
wouldn''t work either
user_controller_test.rb
1) Failure:
test_create(Admin::UserControllerTest)
[/usr/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/action_controller/assertions/tag_assertions.rb:102:in
`assert_tag''
/usr/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/action_controller/assertions/tag_assertions.rb:99:in
`clean_backtrace''
/usr/lib/ruby/gems/1.8/gems...