Displaying 20 results from an estimated 600 matches similar to: "integration test redirects to external URLs"
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 redirected_controller
2006 Jul 22
5
Prototype error. replace content inside a <TR> in IE
Does anyone know of a fix for the issue with prototype and replacing
table rows in IE?
render :update do |page|
page.replace "row_#{params[:id]}", :partial =>
''wireless_request/wrequest'', :locals => {:wrequest => @wrequest}
end
This ends up making IE throw an "rjs error [object error]"
Searching around I found a couple of posts about
2007 May 22
4
Process safe log files with multiple mongrels
I have a rails application that runs on multiple mongrels and I would
like to make the log files non-interlacing. Are there any logging
modifications/other loggers out there that I could use to create
process safe logging?
Thank you,
Matt Margolis
2006 Jun 23
10
Don''t un-admin the last administrator
I have a User class with a field called admin which is a boolean that
determines if the user is or is not an administrator. I want to make it
impossible for the last administrator for an account to be removed from
the system.
I need to protect against this both when deleting a user and when
editing a user as you can revoke a user''s administrator privileges via a
form.
User
2006 Jun 19
6
SQL Search Qustion
I am working on writing a search method where a user can type a string
of words and I return all the objects that have fields that match all of
the words in one or a combination of fields.
Person
first_name
last_name
Pet
name
Person has_many :pets
I want to write some SQL so that if I search for "Tony AAAA" I will get
all the people who have Tony and AAA either in their
2005 Dec 23
6
Agile book - test error
Hi all,
I get an error when testing the "store_controller_test.rb"
The 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
2006 Jun 14
3
Which Payment Gateway?
I am working on an application where users sign up for one of several
plans. Each plan has a different monthly fee. There is no long term
contract but I would like to bill the users automatically each month
unless service is canceled.
What credit card gateways would you recommend for use with a rails
application?
My criteria in order of importance are
1. API that will let me work in
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
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
--
Posted via
2007 Jan 31
1
help please!
Hi,
I''ll appreciate insight on this one... it''s causing me some pain on my
production env.
<%= link_to "something",
:controller => "somecontroller",
:action => ''someaction'',
:id => someid,
:favorite => is_a_favorite %>
I added a boolean :favorite to the URL arguments.
THis has always worked well under my dev
2006 Jun 26
8
[Semi OT] BlindDown and a floated div
I am using the drop shadow technique described at
http://www.1976design.com/blog/archive/2003/11/14/shadows/ to give
several of my divs drop shadows. That part works fine.
What doesn''t work so well is when I try to BlindDown a div in Firefox
and it ends up ignoring the content below it and just overlapping it.
In IE this problem does not occur. In Firefox the overlapping does
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 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
2006 Mar 18
2
Additional link tag attributes with link_to_function...
Hi,
I''m having a bit of a struggle with link_to_remote. Everything works
exactly as I want it, but the problem is that I want to add another
attribute to the <a>-tag, namely class="". Long story short, I want
specific links to look differently from others, but all of them being
link_to_function. Normally, I''d do this with adding a class="foo" to
2006 Apr 04
1
integration tests - 1.1
I?m using the new 1.1 integration test facility? I?m trying to write 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!
2007 Jul 25
3
autotest + integration testing (follow_redirect!) error
I''ve got an interesting (possibly) problem right now between autotest
and rails integration tests. There are a few things to preface this
with.
Works fine:
rake test
rake test:integration
Blows up:
autotest
Autotest is correctly determining rails and runs tests just 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
2006 Apr 28
4
can someone help DRY a noob? thanks...
hi all
i''m trying to pass a variable name right round the block and need a hand
to ease my aching brain.
##in my sidebar i have
<li><%= SidebarItem(''catalogue'') %></li>
<li><%= SidebarItem(''provenance'') %></li>
<li><%= SidebarItem(''status'') %></li>
##linked to a
2008 Oct 10
16
rspec - undefined method `describe'' for main:Object
When i run a spec file i am getting the following error
D:\Diwakar\spec_diwa\spec\controllers>spec sandbox_controller_spec.rb
c:/ruby/lib/ruby/gems/1.8/gems/rspec-0.5.15/lib/spec/api/sugar.rb:17:in
`method_
missing'': undefined method `describe'' for main:Object (NoMethodError)
from ./sandbox_controller_spec.rb:7
from
2006 Jul 02
2
:include breaks has_many :order
It would appear that using :include on a model that has_many with an
:order on another model makes it so that the order is ignored. Is this
supposed to happen? Strikes me as odd behavior.
For example
class Farmer < ActiveRecord::Base
has_many :cows, :order => ''position''
end
class Cow < ActiveRecord::Base
acts_as_list :scope => :farmer
end
If I do
2007 Feb 03
1
How can I bypass caching for some users
I have action caching setup for several actions of an application but I
want the caching to only run for my administrators and have all other
users see non-cached pages. Is there a way to do this? Perhaps
something like passing a block to caches_action or setting some sort of
flag in my authentication method? If this is not possible with action
or fragment caching does anyone know of a