similar to: rescue_action overridden

Displaying 20 results from an estimated 2000 matches similar to: "rescue_action overridden"

2007 Oct 07
0
Is there a way to use the rescue_action defined in a controller in the controller''s specs?
Heyho, I start to discover RSpec but it seems that just on my second day I ran into some strange trouble with the rescue_action of my controllers. Just like in Rails 2.0 where there is a rescue_from Exception, :with => :foo_method thing to rescue exception thrown in actions in the production environment, I did a little helper that rescues my action exceptions with a defined class. For
2006 Feb 26
0
rescue_action with RoutingError not loading ApplicationController/ApplicationHelper
Why is it that when rescue_action is called with any exception except for RoutingError, "self" refers to a controller within my application, but when there''s a RoutingError, "self" refers to an object of ActionController::Base? This makes some sense because a "RoutingError" implies that no controller was found to process the request. However, I am trying to
2007 May 20
9
How to test for exceptions
Hi folks, I''m in the process of converting a Test::Unit functional test to RSpec, but I''ve run into a slight problem. I tried looking through the documentation but I still don''t know what I missed. Thanks in advance, Blake describe VenuesController, "on update" do before(:each) do @venue = mock("venue")
2009 Jul 23
0
[PATCH server] Add network QMF apis.
From: Scott Seago <sseago at redhat.com> This adds some of the network API stuff to ovirt-agent. It's still not complete but what is there is functional. Signed-off-by: Ian Main <imain at redhat.com> --- src/ovirt-agent/lib/ovirt.rb | 3 + .../ovirt/controllers/hardwarepool_controller.rb | 2 +- .../lib/ovirt/controllers/network_controller.rb |
2007 Sep 17
2
Why do we check for the controller file?
I remember having this discussion on IRC before, so Ezra if you could remind me that would be appreciated: Why do we check for the existence of the controller file in (what is now) Request#controller_class? The reason I ask is that I would like to implement some sort of "Rails engine" like features for gem plugins--in other words, drop in a gem that has controllers/views etc.
2006 Oct 26
2
Mocha and SimplyHelpful
Hi, I''m getting a conflict between the Mocha plugin and the Rails SimplyHelpful plugin. For some reason the dom_id method from SimplyHelpful is not being found in my views when the Mocha plugin is installed. The dom_id method if used in the controller works properly. This is the error I get when running the tests: 1) Error: test_truth(HmmControllerTest):
2009 Jun 16
1
[PATCH server] Fix errors in controller tests.
A bunch of controllers were not extending ActionController::TestCase, and instead were just using the basic test/unit testcase, so we were not getting some of the rails baked-in stuff. Signed-off-by: Jason Guiditta <jguiditt at redhat.com> --- src/test/functional/host_controller_test.rb | 2 +- src/test/functional/nic_controller_test.rb | 2 +-
2012 Sep 11
1
define_method vs module_eval
Rails code: Accessors.send :define_method, :"default_#{name}", &block Accessors.module_eval <<-METHOD, __FILE__, __LINE__ + 1    def #{name}    -ISKimRw02aC5oVgD8gxYQQ@public.gmane.org(:#{name}, [])    end    def #{name}=(value)    value = value.present? ? Array(value) : default_#{name}    _set_detail(:#{name}, value) if value != @details[:#{name}]    end  
2006 Jun 30
1
Taking Control of Un-handled Exceptions
Greetings, I''m trying to catch all un-handled exceptions. I''m having problems handling the RoutingError and UnknownAction exceptions. I''ve added the following to my application controller as a protected method: def rescue_action(exception) render(:text => "error") end As far as I understand, this should catch all uncaught exceptions and override
2007 Jun 01
0
[1044] trunk/wxruby2: Special memory management for Wx::Grid
<!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:
2005 Dec 15
3
define_method with parameters
Hi, I''m trying to write a macro which defines methods. One of these should have a parameter, but I can''t get that to work. Something like: define_method("printstuff") do puts "blabla" end works fine. But, how do I use define_method to create something like: def printstuff(the_stuff) puts the_stuff end Thanks in advance.
2008 Mar 16
0
Corrupt rspec_on_rails tar file?
I just downloaded rspec_on_rails-1.1.3.tgz onto a mac on OSX 10.4 and another computer (Ubuntu 7.10) and I get the same tar errors when I try to decompress: rspec_on_rails-1.1.3/spec_resources/views/view_spec/implicit_helper.rhtml rspec_on_rails-1.1.3/spec_resources/views/view_spec/multiple_helpers.rhtml gzip: stdin: decompression OK, trailing garbage ignored
2007 May 23
8
Rails Rendering diagnostics.rhtml in Controller Spec
Forgive me if this isn''t the proper list. It''s specific to the rSpec Rails plugin. The problem is, some controller actions are rendering the "diagnostics.rhtml" template when I''m expecting it to render something else in a controller spec. I''m assuming this is the template that displays the error message and a stack trace when an error is raised in the
2007 Oct 11
0
Custom rescue_action_* methods not being called?
All, Rails 1.1.6 Ruby 1.8.6 Win XP It appears that none of my rescue_action_* methods, if defined in my application.rb file, are being called. I''ve placed debug statements inside of the ActionController Rescue module to verify that rescue_action is being called. Here are my overrides in application.rb, none of which are being called - they are all protected visibility (these are just
2007 Jan 11
0
writing tests for rescue_action_in_public
I''m having trouble with rescue_action_in_public, both in getting it to work right in my rails app, and in writing tests to make sure. What I ultimately want to do is test for what a normal user would see when an error is trapped. I override local_request? like so: application.rb -------------- def rescue_action_in_public(exception) render :text => "oops" end def
2007 Jul 26
5
Coding standards and whitespace
Recently as a result of using Git I''ve noticed a number of inconsistencies in the RSpec codebase with respect to whitespace (mixed line endings, mixed use of spaces and tabs for indentation, and trailing whitespace at the end of lines). I never would have noticed, but Git produces nice colorized diff output which highlights these kinds of inconsistencies. I wanted to ask if the
2007 Sep 27
2
1.0.8 tarball problem.
When I untar 1.0.8 after having downloaded it from rubyforge, I get these errors: <snip> rspec-1.0.8/spec/spec/runner/spec_parser_spec.rb rspec-1.0.8/spec/spec/spec_classes.rb gzip: stdin: decompression OK, trailing garbage ignored rspec-1.0.8/spec/spec/translator_spec.rb rspec-1.0.8/spec/spec_helper.rb rspec-1.0.8/UPGRADE tar: Child returned status 2 tar: Error exit delayed from
2007 Oct 11
2
Incompatibility Issues after updating CURRENT
Hi, I''m using piston to manage rspec and rspec_on_rails in vendor/plugins. ---- ~/work/simplify_md $ piston st vendor/plugins/ vendor/plugins/rspec (svn://rubyforge.org/var/svn/rspec/tags/CURRENT/rspec) vendor/plugins/rspec_on_rails (svn://rubyforge.org/var/svn/rspec/tags/CURRENT/rspec_on_rails) ---- After I ''piston update''d rspec and
2007 Jan 19
3
problems updating to 0.7.5.1
Hi all I''ve upgraded the rails plugin from 0.7.5 to 0.7.5.1 (plugin/remove rspec_on_rails followed by : ruby script/plugin install svn://rubyforge.org/var/svn/rspec/tags/REL_0_7_5_1/rspec_on_rails/vendor/plugins/rspec_on_rails I''ve also updated the rspec gem and removed the older version. I''m running rubygems 0.9.1 on a windows box however, when I try to run a spec
2006 Nov 22
0
rspec_on_rails MissingSourceFile
Hi there, I''ve installed rspec, rails plugin & generators thusly: $ sudo gem install rspec $ sudo gem install rspec_generator $ sudo gem install zentest -v 3.4.1 $ ./script/plugin install svn://rubyforge.org/var/svn/rspec/tags/REL_0_7_2/vendor/rspec_on_rails/vendor/plugins/rspec $ ./script/generate rspec $ ./script/generate rspec_model ModelName With Rails version: $ rails