similar to: Trouble defining a stub method for a controller

Displaying 20 results from an estimated 1000 matches similar to: "Trouble defining a stub method for a controller"

2007 Jun 05
6
Help with spec controller
Hello, I haven''t been able to create a controller spec. You can see the code here: http://pastie.caboo.se/67980 The error message I''m getting is: Spec::Mocks::MockExpectationError in ''PersonController should tell the Person model to create a new person on POST to create'' Mock ''person'' received unexpected message :save with (no args)
2007 Aug 06
5
Problems with array mock
Hi everyone, I''m trying this in my helper spec and it didn''t work: @curr_odontogram.should_receive(''photos[1]'').and_return(@photo) and the error is: SyntaxError in ''PersonHelper Deberia devolverme un link para eliminar una foto'' compile error /home/gramos/src/rails/r-dental/config/../vendor/plugins/rspec/lib/spec/mocks/proxy.rb:99: syntax
2007 Jun 07
6
Problem with response.should render_template
Hello, I have problems with this spec controllers: http://pastie.caboo.se/68634 when I run: rake spec:controllers I get this error: ...............F...... 1) ''DocTypeController should update and redirect to show'' FAILED expected redirect to {:action=>"show", :id=>1}, got redirect to
2007 May 21
2
logger anybody?
Hello, When trying to use logger into any RSpec I get: logger anyboundefined local variable or method `logger'' for #<#<Class:0x278bee0>:0x253cdec> Not sure if this is the spected behaviour (haven''t checked under the hood) It was just annoying not having a logger instance available as in Rails out of the tests. -- An?bal Rojas http://www.rubycorner.com
2007 May 27
1
annotate_models plugin to annotate RSpec specs and fixture
I have found useful to have the table information associated to models disp?ayed in the models and fixtures files of my rails applications. If you want to add this information to the spec_fixtures and specs add the following patch to your plugin. Index: vendor/plugins/annotate_models/lib/annotate_models.rb =================================================================== ---
2006 Dec 24
1
How to get database.yml configuration to use it in a rake taks
Hello, I want to get the production environment configuration from the database.yml in the /shared folder of a deployed rails application. I could use scp to get the file, write it to temporary file, read it and open it with YAML, but is there a better way to do this? Best regards, -- AnĂ­bal Rojas http://www.rubycorner.com http://www.hasmanydevelopers.com
2006 Feb 07
3
Dinamic controller
Is it possible to make a Rails app respond to a "dinamic" controller? As I understand method_missing can be used inside a controller to respond to nonexisting methods, is it possible to provide a similar behavior at a controller level? I am not sure at whic level would this code be inserted... -- An?bal Rojas http://www.lacaraoscura.com/ anibalrojas@gmail.com
2007 Aug 31
2
How to spec routes for a resource nested in multiples resources?
Hi, I got the resource "Llamadas" nested in: - Operadores - Productos - Centros Here is part of my routes http://pastie.caboo.se/92767 I want to spec that the routes for Llamadas, I tried several approachs: - route_for(:controller => "llamadas", :action => "exitosas", :operador_id => 1).should == "/operador/1/llamadas;exitosas" -
2008 May 21
32
Rack, Camping 2.0++
=== 1. Camping on Rack === I''ve just finished rewriting Camping to use Rack in the "core". I got rid of (a little less) than 1kB in camping.rb and removed lots of un-necessary files (lib/server/*.rb, fastcgi.rb & mongrel.rb). bin/camping does now only provide WEBrick, Mongrel and console-support and should only be used in development. It uses Rack::ShowExceptions to catch
2008 Jun 06
2
Problems with view spec and mocking will_paginate
Hi all, I have some failures that not I don''t understand this the pastie with index.erb.html http://pastie.org/private/zgohh6dcts04wpfagfgz5q and this is the pastie for view''s spec: http://pastie.org/210485 and the failure: 1) ActionView::TemplateError in ''/posts/index.html.erb should render list of posts'' undefined method `count'' for
2008 May 24
19
Camping 2.0 - What''s left?
I''ve just sent a pull-request to _why with my changes[1] and here is some things that I think needs to be done before a (possible) release: * The cookie session is named Camping::Session and is placed in camping/session.rb. Maybe this should be called Camping::CookieSession or??? * The ActiveRecord session is named Camping::ARSession and is placed in camping/ar/session.rb. Maybe it
2007 May 29
0
Specify methods (GET, POST) allowed for an action in Rails
Hello, I have been trying without sucess to specify that a specific action should only be reached when the appropiated method is used. I think I am missing something obvious... :-) (and yes, the context of this problem is the restful routes) -- An?bal Rojas http://www.rubycorner.com http://www.hasmanydevelopers.com
2006 Mar 13
0
RubyCorner a meeting place for the Ruby and Rails blogging community
After spending some of our spare time (a software developer having "spare time"? really?) writing unit and functional tests, RubyCorner is going live: A blog directory focused on the Ruby language, Rails and any other Ruby related project. We like to think about RubyCorner as a "meeting place" for the community, also as a "focal point" where the people new to
2006 Jul 11
4
validates_unlike plugin
Validates Unlike Plugin (v 0.1) ======================== Validates Unlike plugin validates that the value of the specified attribute doesn''t match against the regular expression provided Class Contact < ActiveRecord::Base validates_unlike :comment, :with =>/html|http|onclick|onmouseover/ , :message => "comment can''t include: href,http,onclick,onmouseover."
2007 May 25
2
Switch back to mount after fallback
Hi Geoff, Geoff Shang wrote: > Hi, > > That's what fallback-override is meant to do. Are you saying that it's not > working for you? Not working. But what is wrong? I've added the second mount to icecast.xml and tested whether it switch back to the original mount point. The mount part of icecast.xml: <mount>
2007 May 25
2
Switch back to mount after fallback
Hello icecast user, That's my first post to this list, because everything works fine :) But now I'm missing a feature and I'm not sure if it is possible to realise. I have two mounts. Only one defined in the configuration: <mount> <mount-name>/gast.ogg</mount-name> <fallback-mount>/offline.ogg</fallback-mount>
2020 Apr 17
3
Convertir lista de precios a dolares por gramo
Se ha borrado un adjunto en formato HTML... URL: <https://stat.ethz.ch/pipermail/r-help-es/attachments/20200417/11369880/attachment.html>
2006 Jul 07
2
Problem with GetText 1.6.0 - undefined method ''N_''
I''m just upgraded GetText from 1.4.0 to 1.6.0, and all my tests got broken. I got this error: ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.3/lib/active_record/base.rb:1129:in `method_missing'': undefined method `N_'' for User:Class (NoMethodError) etc My model user.rb has this line: validates_format_of :login, :with => /^[a-zA-Z0-9_]+$/, :message =>
2005 Apr 16
2
String in data frame
hello, how can take the string in the data frame. right now i have a table that create as a data frame and stored in the file called "data.xls" and now i want to read data frame as a table in my another r program, i used the following command: the first column of the data frame is just one number called "num", but the second one a list of string, called "name". d
2006 Dec 11
2
Does mongrel look at the Rails page cache?
Hi all. I''m trying to skip the Rails page cache if the user is logged in: --- # Rewrite index to check for static RewriteCond %{HTTP_COOKIE} !^.*logged_in=yes.*$ RewriteRule ^/$ /index.html [QSA] # Rewrite to check for Rails cached page RewriteCond %{HTTP_COOKIE} !^.*logged_in=yes.*$ RewriteRule ^([^.]+)$ $1.html [QSA] # Redirect all non-static requests to cluster RewriteCond