similar to: Testing misc methods in ApplicationController

Displaying 20 results from an estimated 1000 matches similar to: "Testing misc methods in ApplicationController"

2009 Mar 21
5
- 2.3.2 uninitialized constant ApplicationController
Hi, I just migrated from rails 2.2.2 to 2.3.2 The rails app was running fine until i migrated I checked for the application.rb in the controller folder and its there Any suggestions, why this is happening??? Regards, Vimal Das --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk"
2007 Nov 20
3
Plugin: can't call before_filter in ApplicationController
Hi all I want to outsource an extension for ApplicationController, that I had in application.rb so far, into a plugin. I have created this plugin, and in init.rb I load require File.dirname(__FILE__) + ''/lib/application_controller'' In lib/application_controller.rb I have the following code: class ApplicationController before_filter :prepare_user ... end This worked
2008 Mar 28
10
Inheriting from AdminController intstead from ApplicationController
Hi I would like to do the following: I have created an admin namespace and the required folders app/admin views/admin etc. And then I wanted all controllers under app/admin to inherit from a controller named AdminController which resists under app/admin/admin.rb instead of inhereting from ApplicationController, so I could better separate between admin and public section. The AdminController
2008 Mar 05
4
has_many_polymorphs is breaking my spec file
Hey folks I have a bunch of classes that are polymorphs, with has_many_polymorphs (they are all ''labellable'', which is similar to being ''taggable'' in the acts_as_taggable scheme). I have a couple of modules, LabellableInstanceMethods and LabellableClassMethods in a file called labellable_methods.rb. The classes all get labelled with
2008 Nov 07
15
any tricks re using " eql(5.5)", but where 5.5 is a decimal not float?
-- Sent from my mobile device
2008 Oct 20
5
RSpec-Rails bug with to_xml?
Hello, everyone. I''ve been lurking here for a while, but this is my first post. I think I''ve run into a RSpec bug in a Rails project I''m working on. I was working on a few REST controllers, and started getting failures on a specific spec that verified whether a certain action returned XML output. I spent quite a lot of time checking my code to see if it was something I
2007 May 15
3
NOOB question RSPEC
Hi all !! I have this code: require ''account'' describe Account, "when first created" do before do @account = Account.new end it "should have a balance of $0" do @account.balance.should eql(Money.new(0, :dollars)) end after do @account = nil end end How can I pass the @account.balance.should eql(Money.new(0, :dollars)) spec. From my
2010 Jul 05
1
[PATCH] gettext initiation problem Thanks to Thibault Deloffre <tdeloffre@linagora.com>
From: root <root at ovirt.admin.virt.par.lng> Signed-off-by: root <root at ovirt.admin.virt.par.lng> --- src/app/controllers/application_controller.rb | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/src/app/controllers/application_controller.rb b/src/app/controllers/application_controller.rb index 4c4666e..c7f8431 100644 ---
2009 Sep 10
1
undefined method `protect_against_forgery?'
When I use plugin ''railstree'' (http://www.hashcode.eti.br/?p=91) as following code: node = Node.new :label => menu_item.name, :link_to_remote => { :base => self, :update => "container", :url => {
2001 Oct 31
2
removing duplicated rows from a data.frame
Dear all, Sorry for the simplicity of the question, but how does one go about removing duplicated rows in a data.frame? I'm looking for a quick and simple solution, as my data.frames are relatively large (50000 by 50). I've racked my brain and searched the help files and found nothing useful or quick, only duplicated() and unique() which work only work on lists. Thanks Gary.
2010 Mar 31
1
[PATCH] Upgrading the server to work with Rails 2.3.4.
Signed-off-by: Darryl L. Pierce <dpierce at redhat.com> --- src/app/controllers/application_controller.rb | 2 +- src/config/environment.rb | 2 +- src/config/initializers/new_rails_defaults.rb | 6 +++++- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/app/controllers/application_controller.rb b/src/app/controllers/application_controller.rb
2007 May 17
8
Model: self is not child's parent
Assume a model Parent and another model Child. Child belongs_to Parent and Parent has_many Children. The following fails: @ p = Parent.find(:first) assert p.equal?(p.children[0].parent) @ It seems odd to me that I and my child''s parent are not the same object. In fact, this is royally screwing me up. Can anyone tell me why this is or point me at a relevant discussion, blog posting,
2010 Apr 14
5
Model Magic
>> [].eql? @product.files => false >> @product.files.eql? [] => true version: 2.3.5 Product :has_many files -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to
2010 Feb 09
4
Rails3 pre and protect_from_forgery
I''ve almost entirely converted a rails 2.3.5 app to 3pre. I''m having some trouble with protect_from_forgery. I had protect_from_forgery set in application_controller.rb, but run some uploadify ajax stuff in one of my controllers, where I had protect_from_forgery, :except => :add_file set. In rails 3 I''m getting ActionController::InvalidAuthenticityToken on the ajax
2009 Oct 18
4
NoMethodError in User sessionsController#new
I''m setting up authentication with Authlogic and I get this error. I''ve done some searching but with no success. I tried setting the current_user method in Application_controller to protected and not private, on the recommendation in Stack Overflow. Error in browser----------------- NoMethodError in User sessionsController#new undefined method `require_no_user'' for
2010 Jul 02
6
making something available application wide
I''d like to display a banner on every page. Ultimately I''ll be tweaking which banner is displayed via different controllers but initially I''d just like to set a single banner application wide and display it in my "_header", a partial I include in all layouts. I''ve got a BannerAdvert model, simple. If I''m in my welcome controller index action
2007 Sep 05
4
False Positives and Autotest on New Folders
False Positives I just discovered how easy it was to create a false positive when I, trying my first RSpec test, did this: ob.should eql?(''foo'') instead of: ob.should eql(''foo'') or: ob.should == ''foo'' As far as I can see, this is roughly equivalent to: ob.should false Neither eql?(''foo'') nor false causes the spec
2008 Mar 19
2
Stub / Mock - A little guidance?
Hi there, I''m still trying to wrap my head around when to use a stub and a mock. If I understand this right, I should be using a ''mock'' when imitating an object, but not its behavior. I should be using a stub when I want to imitate the behavior of an object. Does that sound about right? With that said, I''m struggling a little trying to spec out this instance
2009 Jul 06
3
Speed up code, profiling, optimization, lapply vs. loops
High everybody, currently I'm writinig a package that, for a given family of variance functions depending on a parameter theta, say, computes the extended quasi likelihood (eql) function for different values of theta. The computation involves a couple of calls of the 'glm' routine. What I'm doing now is to call 'lapply' for a list of theta values and a function, that
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