Displaying 16 results from an estimated 16 matches for "follow_redirect".
2007 Nov 28
2
follow_redirect!() doesn't exist?
Hi all
I want to do some functional testing. I stumbled over the method
follow_redirect!() somewhere, but evidently this doesn''t seem to exist
in my Rails version (1.2.5 or so)?! Then I tried follow_redirect()
(without the exclamation mark), and I get the following error:
TypeError: can''t convert Symbol into String
What am I doing wrong? Thanks for help :-)
Josh
--...
2007 Jul 25
3
autotest + integration testing (follow_redirect!) error
...st fine. One
part of the behavior is that if I save a change in just the
integration test (even hitting cmd+s to trigger a diff) the tests
execute fine. Running all the tests from functional to integration to
unit, however, and the integration tests blow up.
>From what I can tell it runs into follow_redirect! and goes into a
hissy fit, and delivers this error message:
Runtime Error: not a redirect! 500 Internal
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/
action_controller/integ
ration.rb:115:in `follow_redirect!''
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/
action_c...
2006 Apr 03
0
follow_redirect! aborts rake during integration tests
I''m running integration tests on Rails 1.1/Ruby 1.8.4/Windows XP and have
found that any call to follow_redirect! (directly or through
[get|post]_via_redirect) causes rake to abort (see command line output
below). Has anyone else seen this error, or know what might be the trouble?
Thanks!
Tom
C:\dev\h2h>rake test:integration --trace
(in C:/dev/h2h)
** Invoke test:integration (first_time)
** Invoke db:tes...
2006 Sep 03
1
Returning different values with stubs
Right now I''m working on adding tests to a method that looks like this:
def get_via_redirect(path, args={})
get path, args
follow_redirect! while redirect?
status
end
So, I want to confirm that get is called and that status is returned
but I also want to see that when the value of redirect? effects how
many times follow_redirect is called. Is there already a built in way
to do this or should I go hacking?
My test looks...
2006 Apr 04
1
integration tests - 1.1
...a
test that sees if a controller redirects to the correct place and
preserves the query string.
Here?s the code:
class LoginRedirectTest < ActionController::IntegrationTest
def test_non_admin_auth
request_uri = "/datafeed/event/report?blah=blah"
get(request_uri)
follow_redirect!
assert_response :success
status = post("/login/authenticate", :login_info => {:user_name =>
"blah", :password => "blah"})
follow_redirect!
assert_response :success
user = session[:user]
assert !user.nil?
# puts response[&quo...
2005 Dec 23
6
Agile book - test error
...e troublesome line is in the test below:
def test_add_to_cart
get :add_to_cart, :id => @version_control_book.id <<<
cart = session[:cart]
assert_equal @version_control_book.price, cart.total_price
assert_redirected_to :action => ''display_cart''
follow_redirect
assert_equal 1, assigns(:items).size
assert_template "store/display_cart"
end
And the error n question is:
1) Error:
test_add_to_cart(StoreControllerTest):
RuntimeError: Called id for nil, which would mistakenly be 4 -- if you really
wanted the id of nil, use object_id
t...
2006 May 16
3
UserEngine and hiding controllers
I''m using LoginEngine + UserEngine for web application.
1. I have some controllers under and admin subdirectory
(Admin::PostController etc). The auto-fill permission in UserEngine
does not work correctly with those controllers.
Right at the moment this is not a problem, since I kind like having the
Admin section separated and available only for god users. However, I
could use
2008 Jan 16
1
session data and user stories
hello there,
i have been trying my hand at this rbehave material, specifically in terms
of integration testing a rails application, and i am curious about the most
friendly way to deal with session data.
currently, the only way i have found to simulate a session is to open a
session and refer to everything afterward via the @session variable stored
after open_session. it seems to be workable,
2008 Jun 02
2
Cannot log in/authenticate within RSpec Story
...ec story functions to assist this scenario
(along with others):
--------------------------------------------------
Given("I am logged in") do
post ''/login/login'', {:name => ''domain\\username'', :password =>
''password''}
follow_redirect if redirect?
end
When "I visit the post details page" do
get(''/posts/1'')
end
Then "there should be a link to add a new comment" do
response.should have_text(/.*Add New Comment.*/)
end
--------------------------------------------------
Th...
2006 Jul 17
5
Functional Tests misbehaving with Globalize
Howdy all
Apologies to the folks subscribed to the globalize list for dual
posting this message...
I''ve got a project running globalize and rails 1.1.4, and I''ve only
recently adopted a strong love for testing. Now my models are 100%
tested (I must note that I do not make use of any translations in the
database yet), and I''ve now started with functional tests before
2008 May 08
0
New test helpers
...sted action with the rest of the params that the test
specifies.
2) assert_facebook_redirect_to
Takes a URL as an argument, extracts the redirection URL from an
fb:redirect tag, and asserts the two are equal.
NOTE: This method replaces assert_fb_redirect_to.
3) follow_facebook_redirect!
Used like follow_redirect! in integration tests. Again, extracts the
URL from a response containing fb:redirect and makes a call to
facebook_post to that URL.
Give these a roll and let me know if there are any issues. Thanks a
lot to Ryan Kinderman for this patch and the descriptions above.
Shane
--
http://shanesbrain...
2006 Feb 27
0
Functional Tests when using the User Engine
Hi all,
I''m trying to write a functional test for a controller. In my app I''m using
the users engine, so of course the test needs to login. However, I can''t use
follow_redirect since that gives an error. What is the proper way to do the
login in the test?
Thanks in advance,
Nick
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060227/d47aaf43/attachment.html
2007 Mar 12
1
Can't follow redirects outside current controller - but it's the same controller
Running a functional test on FooController that does
''follow_redirect'', I get ''Can''t follow redirects outside current
controller (from "foo" to "foo"). On further investigation, it turns
out that :foo != ''foo'' around line 401 of actionpack/lib/
action_controller/test_process.rb. Changing the line:
if r...
2007 Apr 29
0
integration test redirects to external URLs
In an integration test that I am writing I want to do something like
def test_my_page
get "/rails/someaction"
assert_response :redirect
follow_redirect!
assert_url => ''http://www.somepageoutsidemyrailsapp''
end
Is there any way to do something like ''assert_url'' and see if I was
redirected to a page outside of the rails application? If the page
was part of my rails app I could use assert_redirected_t...
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)
2006 May 04
6
second assert_tag failling in rails integration test
Hi all,
I''m fairly new to rails and ruby, but I''ve come across an interesting
glitch and I''m not sure whether I''ve just got something wrong with my
assumptions or if it really is an error in the underlying framework...
I''ve created a bare-bones set of tests to show you where the problem is.
What follows are the steps I went through to reproduce the