Displaying 20 results from an estimated 1100 matches similar to: "assert_redirected_to not recognizing routes"
2006 Jun 17
3
What is this failure trying to tell me?
Here is my unit test code.
post :login, :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)
2007 Jan 21
0
Functional Test Fails with before filter in application.rb
Hi There,
I am trying to write my first tests for a role bassed authentication
taken from Rails Recipies. Whenever I add:
assert_redirected_to :action => ''login''
I get the following error:
NoMethodError: undefined method `first'' for :user:Symbol
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.13.1/lib/action_controller/assertions/response_assertions.rb:72:in
2010 Feb 19
2
Problem with assert_redirected_to
I have taken over some old Rails code and am trying to get the tests to run.
In the functional test every time the assertion ''assert_redirected_to'' is
called I get the following error:
test_should_update_venue(VenuesControllerTest):
NoMethodError: undefined method `[]'' for
#<Enumerable::Enumerator:0x102f747e0>
2006 May 03
0
Accessing the params hash in a functional test not working
I am having problems reading params in a functional test (Rails 1.1.2). My
test looks like this:
fixtures :users
def test_auth_bob
@request.session[:return_to] = "/bogus/location"
post :login, :user => { :email => "bob@example.com", :password => "test"
}
assert_session_has :user
assert_equal @bob, @response.session[:user]
2007 Mar 22
1
Functional test and flash with an error
I''m getting this error thats moaning about expected tag, but no tag
found matching {:content=>"User James 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:
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
2005 Jul 05
2
Salted hash login generator (verification problem?)
Hi all,
I hope someone can help with what is probably a simple newb
installation mistake on my part. I''m having a couple of problems with
the salted hash login generator. I installed it following the
quickstart guide, and the unit tests work like a charm. There are two
errors and a failure on the function tests, though; the verified field
seems to be involved in at least one of
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
2007 Dec 24
1
Uninitialized constant in integration test
I am seeing weird issues when trying to create integration tests. Here
is a very simple example of something that is failing. The
assert_redirected_to, and other methods, fail with this or similar
exceptions.
I have tried requiring both ''application'' and ''listings_controller'', but
neither solves this problem, although the exception changes.
Anybody know
2006 Feb 27
1
Functional test problem with environments variables
Hi guys,
i have been experiencing this problem once i put in some constant
declarations in /config/environments/development.rb. I declared it very
normally like this :
USER_DETAILS = {
:name => ''abc'',
:password => ''123''}
it works in the controller and when i run the application, i managed to
get the values out from the development.rb by using some
2006 Mar 22
0
assert_redirected_to behaviour
Consider following situation: you''ve got controller Foo that has
following routing rules related:
map.connect ''/foo'', :controller => ''foo'', :action => ''index''
map.foo ''/foo/:x/:y/:z/:action'', :controller => ''foo''
You want all Foo actions to make use of partial url rewriting, so
instead
2006 Dec 11
1
assert_redirected_to error
I''m new to TDD in rails, I''m getting this weird error with
assert_redirected_to.
Here''s my test:
def test_friendship_request_accept
@request.session[:user] = users(:nathan).id
get :accept, { :id => 1 }
assert_redirected_to :controller => "/users/profile", :action =>
"index", :id => users(:nathan).id
end
When I run this I
2006 Aug 03
2
Failing test with assert_redirected_to
I''m having a strange problem with an assert_redirected_to in my
controller test which hopefully someone can point out my failings with!
;)
Controller method -
def new
if request.post?
#Not important here.
else
flash[:notice] = ''Please join a tree from this page.''
redirect_to :controller => ''trees'', :action =>
2010 Aug 16
0
assert_redirected_to partial assertion does not work?
Hi,
From the docs I see:
http://api.rubyonrails.org/classes/ActionController/Assertions/ResponseAssertions.html
This match can be partial, such that assert_redirected_to(:controller =>
"weblog") will also match the redirection of redirect_to(:controller =>
"weblog", :action => "show") and so on
But it my case it does not work. As
2006 Jun 30
4
Strange behaviour from assert_redirected_to
I have this assertion in my tests:
assert_redirected_to :controller => ''user'', :action => ''change_password''
It fails with:
response is not a redirection to all of the options supplied
(redirection is <"http://test.host/user/change_password">),
difference: <{:controller=>"user"}>
The redirection was:
redirect_to
2006 Jul 02
5
"the number of parameters does not match the number of substitutions" error
All of a sudden, I''m getting this error:
1) Error:
test_index(AccountControllerTest):
RuntimeError: The number of parameters does not match the number of
substitutions.
/home/joe/projects/tanga/trunk/config/../vendor/rails/actionpack/lib/action_controller/assertions.rb:92:in
`assert_redirected_to''
2007 Jan 09
1
assert_redirected_to not working as expected
I''ve installed the "acts_as_authenticated" plugin and made some
modifications to the controller (app/controllers/account_controller.rb)
"signup" module as follows:
===
def signup
@page_title = ''Create Account''
@user = User.new(@params[:user])
if request.post?
if @user.save
session[:user] = User.authenticate(@user.login,
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.
2009 Jan 19
1
in functional test, assert_redirected_to w prefix
I had to use sub-URI deployment (could not use subdomains..), and when
running my functional tests, I the redirected_to assertion embed the
prefix.. quite normal ;-))
is there a way to stipulate this prefix in the test setup to avoid
hard-coding in all the tests ?
Expected response to be a redirect to <http://test.host/my/page>
but was a redirect to
2006 Jul 05
1
RuntimeError with Rails Recipe "Authenticating Your Users"
HI,
I''ve gotten this Rails Recipe running fine (a bit before I completely
understand it) except when the signin is incorrect I return an
error(below). All I want is to either have the incorrect signin
redirected to "store" rhtml
or to a refreshed and empty signin. Any clues???
TIA
Chas
######From Browser ##### http://localhost:3000/admin/signin
RuntimeError in