Displaying 20 results from an estimated 200 matches similar to: "Can't test application controller methods in functional tests?"
2006 Jul 24
1
All functional tests fail with RoutingError
All,
I''m using InstantRails 1.0 on Windows XP and all my functional
(controller) tests fail with ActionController::RoutingError, although
the actions work OK through a web server/browser. Here''s an example of
an error:
1) Error:
test_create(AdminControllerTest):
ActionController::RoutingError: No url can be generated for the hash
{:controlle
r=>"admin",
2007 Jun 07
0
Functional Tests Fail - No URL can be generated for hash
Hi,
I''m just learning Ruby and Rails. I have developed a Rails application,
but not using the creation scripts that come with the rails
distribution. Consequently, no test scaffolding is available to me, and
I''m trying to write my functional tests from scratch.
I have what might be considered a standard plain old controller
(dashboard_controller.rb) that I''m trying
2006 Jan 10
0
problem with cookies in tests (TDD)
The problem I''m having is that I can''t seem to destroy the cookies and
assert that they were indeed destroyed inside the test.
The code to do this does work - the cookies are created, and are
destroyed when this is done in a browser, but I can''t seem to make the
test pass.
account_signup_test.rb
def test_should_pass_if_logout_destroys_cookie_data
post :login,
2006 Feb 13
4
activerecord << operator
Hello,
I am new here and actually I am writing my first RoR app.
My question is:
--------
class Topic < ActiveRecord::Base
has_many :messages
end
class Message < ActiveRecord::Base
belongs_to :topic
end
class ForumController < ApplicationController
def post
message = Message.new(params[:message])
@topic = Topic.find(params[:id])
@topic.messages
2006 Feb 08
1
functional test problem
I am trying to write a test for my delete method.
I find a User in the db by its id, do the delete action, then I want to
see if it is still in the db.
How do I check that the User IS Deleted without causing errors?
** My Test ********************************
def test_delete_user
login
user = User.find(2)
post :delete_user, {:id => user.id}
assert_equal "User
2007 Jun 13
1
seleniumrc_fu initial test issue
I have the seleniumrc_fu plugin installed and setup according to the
instructions, and can run the selenium:test task if there are no test
cases. My first test case simply does an open_home_page to verify
that things are working at all. Unfortuniately there seems to be an
issue with even this simple a test case. The following suggests that
there is an issue with the getNewBrowserSession
2006 May 31
1
Using caches_action ?
Hi
When I enable action caching in my controller with
caches_action :view_thread
only the first part of my layout template is rendered (up to the yield
statement), and the development.log shows
Processing ForumController#view_thread (for 127.0.0.1 at 2006-05-31
03:13:19) [GET]
Session ID: d6f7ef15f479250fd7e31e252d70f5ff
Parameters: {"action"=>"view_thread",
2006 Apr 28
0
Minimum needed to observe a model
I have a model called Post and a observer called PostObserver. I also
have in environment.rb file the line:
config.active_record.observers = :post_observer
I read that observers default to the model with the same name, but the
model class isn''t being observed.
Observe works if I put in the ForumController:
observer :post_observer
But this doesn''t seem right.
Jose
--
2006 Sep 22
2
foo.expects(:blah).returns(10).then(11) syntax
I recently needed the behavior of my object to change on subsequent
method calls so I added the syntax above.
Here''s the diff of changes I made:
Index: test/mocha/expectation_test.rb
===================================================================
--- test/mocha/expectation_test.rb (revision 854)
+++ test/mocha/expectation_test.rb (working copy)
@@ -95,6 +95,12 @@
2006 Apr 29
0
Trouble with firefox and AJAX
I''ve been creating my own message board in rails as a learning
exercise. I''m currently trying to implement posting using AJAX, so the
topic page as a whole doesn''t need reloading.
What I''ve written works as epected in IE6 and Safari, but the AJAX
call fails silently in Firefox 1.5 -- although the server has logged
the request, the "success" callback
2006 Jun 29
0
@response.body accumulating in functional tests?
I have two functional tests for my user controller:
def test_bad_registration
post :register, :email => "tester1@foo.com"
assert_response :success
assert_not_nil @response.body =~ /^\<error/
assert_nil assigns[''user'']
end
def test_good_registration
@response.body = nil
post :register, :username => "tester",
2008 Mar 27
0
handling post-remove URL / uninstall of application
Hi there,
I''ve configured my post-remove URL (which has to be directly to my
site, not an apps.facebook.com URL) and now I''m trying to figure out
how to handle this. It''s poorly documented here:
http://wiki.developers.facebook.com/index.php/Post-Remove_URL
It seems as though support for this is currently not yet in
Facebooker. In order to get it to work, it
2005 Oct 27
0
has_one with Single Table Inheritance - NameError : uninitialized constant
I am having a problem with using SIngle Table Inheritance with a has_one
relationship, and I am at a loss of what could be causing it. Below is the
related code and the error message.
class User < ActiveRecord::Base
has_one :wishlist
end
class List < ActiveRecord::Base
belongs_to :user
end
class Wishlist < List
has_and_belongs_to_many :items, :class_name =>
2006 Dec 01
0
[766] trunk/wxruby2: Added item_data aliases for client_data functions, update doc & tests;
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" /><style type="text/css"><!--
#msg dl { border: 1px #006 solid; background: #369; padding:
2007 Nov 02
1
1 error(s) on assignment of multiparameter attributes - Very Strange
Hello...
Well, I post this one without too much hope that someone will be able
to give me an answer, because it is strange.
I have a time select field, the field on the database is of type time
only.
When creating a document, as long as the time is not greater than
14:00, then it saves as 00:00, but if the time is greater than 14:00
and less than 22:00 then it throws this error:
1 error(s) on
2010 Apr 27
3
"ORA-12154: TNS:..." error after successful oracle connection
Hi,
After a few days of struggling, I was able to run this command
successfully.
ruby -r oci8 -e "OCI8.new(''xxx_dba'', ''xxx'', ''//xxxx:1521/
xxxxx.xxx.org'').exec(''SELECT 1 from dual'') {|r| puts r.join}"
I got "1.0" as output and I got my prompt back.
So, I went back to the RoR app that I am working on,
2013 Nov 05
4
Handling closed clients
We have a service that clients use to upload files. We have a couple of clients that are on slow links and so their upload times out. We get errors in the logs that I''d like to get rid of.
I was hoping that the recent commit 24b9f66dcdda44378b4053645333ce9ce336b413 would help us, but it does not. After digging in a bit, I have some ideas about why and a patch I''d like comments
2004 Dec 19
2
OH323 channel compile error
Hello
I am trying to compile asterisk-oh323-0.7.0 with pwlib-Janus_patch4
and openh323-Janus_patch4 downloaded from inaccessnetworks so I did
this:
tar -zxvf openh323-Janus_patch4-src-tar.gz
cd openh323
patch -p1 < /root/asterisk-oh323-0.7.0/openh323_1.13.5-make.patch
./configure
make opt
cd asterisk-oh323-0.7.0
vi Makefile (to set the paths and options according to my system...)
NOW I
2005 Oct 10
1
ActionPack tests are failing
Hi,
i''m currently looking into a problem with the tests for ActionPack. 127
of them are failing on my windows machine. On Linux everything is
working fine so far. I just wasted a good part of an hour trying to find
the problem on windows...the solution is: Nitro and not Windows.
I''m using Edge Rails and have no rails gem installed. On Windows I have
the Nitro/Glue/Og gems
2004 Jun 25
2
Problems Compiling and Loading asterisk-oh323 0.6.2
Hi,
I having a problem compiling the wrapper for oh323. I am running Debian,
kernel version 2.4.18-bf2.4. The pwlib version I have is 1.6.6 and the
openh323 version I have is 1.13.5. I execute the following commands first
before attempting to compile the wrapper:
pwlib_1.6.6:
make both
openh323 1.13.5
./configure
make opt
asterisk-oh323 0.6.2
make