Displaying 20 results from an estimated 90000 matches similar to: "Testing ActionController::Streaming"
2005 Mar 09
9
Unit testing + instance variables
After *much* digging and playing around, I finally figured out how to
unit test instance variables that are created by actions. It was
more difficult than I expected. It seems like there should have been
a more straight forward way to do this. Can someone enlighten me? A
simplified and somewhat contrived example of what I am current doing:
Thanks.
Matt
>>
# My Controller of interest
2009 Jul 01
1
[PATCH server] fixed expected status messages that were failing unit/functional tests.
---
.../functional/cloud/instance_controller_test.rb | 2 +-
src/test/unit/vm_service_test.rb | 6 +++---
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/test/functional/cloud/instance_controller_test.rb b/src/test/functional/cloud/instance_controller_test.rb
index 71d132b..0d713d4 100644
--- a/src/test/functional/cloud/instance_controller_test.rb
+++
2009 May 18
0
[PATCH server] fixed functional tests after recent controller refactoring and managed node controller fixes.
Signed-off-by: Scott Seago <sseago at redhat.com>
---
src/test/functional/host_controller_test.rb | 41 --------------------
.../functional/managed_node_configuration_test.rb | 14 ++++---
src/test/functional/nic_controller_test.rb | 8 ----
src/test/functional/permission_controller_test.rb | 15 ++++---
src/test/functional/quota_controller_test.rb | 2 +-
2006 Sep 26
0
some help with functional testing of nested routes
I have the following functional test in test/functional for testing my
products_controller:
require File.dirname(__FILE__) + ''/../test_helper''
require ''products_controller''
# Re-raise errors caught by the controller.
class ProductsController
def rescue_action(e)
raise e
end
end
class ProductsControllerTest < Test::Unit::TestCase
fixtures
2005 Dec 11
7
Catching Exceptions in ActionController
I''d like to be able to catch ActionController::MissingTemplate
exceptions from within ActionControlle, *but*, MissingTemplate isn''t
defined within my controllers!!!
How is that possible - after all, all controller subclass
ActionController, so how are exceptions it defines not there!?
More importantly, how can I do this?
--
Posted via http://www.ruby-forum.com/.
2006 Apr 03
5
Strange Problem with ActionController (I think)
I''m working through the Agile Depot example
I have no idea what I did, but when I try and delete something from the
web page I get this error on the log.
Processing AdminController#destroy (for 127.0.0.1 at 2006-04-02
22:28:06) [GET]
Session ID: 4371bd7ca2cb5ec5e08e60a7590df90a
Parameters: {"action"=>"destroy", "id"=>"5",
2007 May 30
2
Bug? Filter chain halted as [#<ActionController::Filters::..
OK so I''ve been trying to follow the tutorial here:
http://rails.homelinux.org/
When I simply do "scaffold: category" in the controller.rb, everything
works fine. BUT after I generate the controllers and other files using
scaffold AS A SCRIPT (script/generate scaffold categories), DESTROY (or
DELETE) does not work for any record in a table. This is the error I
got:
Processing
2011 Jun 23
0
Exception in ActionController::Base:Class for "first request only"
Hi,
I am running Rails 3.0 with Ruby 1.9.2 (compiled from source) on
Ubuntu 10.04.1 (Lucid Lynx) 32-bit.
About a week back I started seeing this weird exception for a
particular request and that too only for the "first time", every time
after I restart my server (WEBrick in this case). All subsequent
requests are fine. If the same request made again, it works fine.
Here is the
2012 Mar 14
0
How do I create a new object in testing to test a controller?
I''m using Test::Unit to do functional testing on one of my controllers.
The action I want to test is create, from SessionsController. I have
simplified it to the extreme:
def create
@user = User.find_by_email(params[:email])
if @user
flash.now[:notice] = "ok, it exists"
else
flash.now[:notice] = "it does not exist"
end
render :new
end
This is my
2014 Mar 31
0
Rails Engine ActionController::UrlGenerationError on functional tests
Hi,
I'm looking for a way to solve an error I get each times I run my
functional tests. I have a Rails Engine gem (isolated), I have a JSON
action with a route declared. But each times I use the method get in a test
I get an ActionController::UrlGenerationError exception.
Here an example of code with the problem:
# config/routes.rbMyEngine::Engine.routes.draw do
resources :cats, only:
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 Dec 16
0
Specifying asset hosts via a proc (ActionController::Base.asset_host)
Hi all,
I just submitted a patch that would allow you to pass a proc to
ActionController::Base.asset_host rather than just using a %d
wildcard (e.g. assets%d.example.com). Basically this frees you from
the hard-coded assumption that you have 4 hosts numbered 0-3 and also
allows you to do smarter things depending on the asset (e.g. images
from a particular domain, stylesheets from another). The
2006 Dec 01
4
Functional Testing AAF Plugin
Is there a way to reliably test the acts_as_ferret plugin using RoR
functional tests? I load my fixtures and no matter what I do, the test
won''t return a result for what *should* be a query that returns results.
Any help on this would be greatly appreciated.
FIXTURE
********
article_001:
id: 1
title: some valid article title
2008 Aug 23
0
Why ActionController::Base.class_eval for includes?
Just out of curiosity, why does action_controller.rb include classes
with class_eval instead of directly? I.e., why
ActionController::Base.class_eval do
include ActionController::Flash
include ActionController::Filters
...
end
instead of just
class ActionController::Base
include ActionController::Flash
include ActionController::Filters
...
end
--
Posted via
2007 Apr 16
4
Web Flow and the session method in ActionController
Hi there,
I''m writing a port of Spring Webflow to Ruby on rails and I''ve
encountered quite a lot of difficulty finding how to override the
session[] method which is accessed via any ActionController.
I have my pseudo-code ready to implement, but I can''t find the method
declaration to copy it''s signature.
Also, if anyone wants to collaborate on this particular
2010 Jan 18
0
rails 3.0: ActionController::Base render()
Can anyone explain where render() comes from in
ActionController::Base?
I managed to trace it down only that far:
ActionController::Base includes ActionController::Rendering where
render() method is defined. This definition however calls to render of
the superclass. Superclass is ActionController::Metal. Which in its
turn inherits from AbstractController::Base. None of those have render
() either
2011 Apr 12
0
Suppress ActionController::RoutingError in logs
My rails log get chock a block with things like
<<<<<<<<<<<<
ActionController::RoutingError (No route matches "/admin/Y-
ivrrecording.php" with {:method=>:get}):
...
ActionController::RoutingError (No route matches "/manager/html" with
{:method=>:get}):
..
ActionController::RoutingError (No route matches "/webdav/test" with
2008 Mar 10
3
Only 5 tests out of 376 currently failing!
Good news! SuperRedCloth is down to just five failing tests! I was
down to 10 or so in mid-February but then I added test cases from
"The official reference manual for Textile 2", which added 97 new
tests, many of them failing. I''m happy to say, they''re almost all
passing now.
Four of these last five I just need to check with you on before I
deviate from
2007 Jul 01
0
rake: uninitialized const ActionController::TestUploadedFile
Hi,
My app uses attachment_fu and I''d like to pre-load some data via a rake
task.
Thus:
[code]desc "Upload template files"
task :upload_files_test => :environment do |t|
conf = Conference.find(1)
[{:f => ''styles.css'', :type_code => ''css'', :content_type =>
''text/css''}].each do |i|
file =
2006 Aug 15
0
Using config.action_controller.asset_host with ActionController::AbstractRequest.relative_url_root
I''m looking for some help with an issue I''m having using an external
asset host. I''ve got the lines below in my environments/development.rb
file.
# Enable serving of images, stylesheets, and javascripts from an asset server
config.action_controller.asset_host = "http://assets.example.com"
#make rails think it lives in /app