similar to: assert_equal - problems returning value from controller

Displaying 20 results from an estimated 1000 matches similar to: "assert_equal - problems returning value from controller"

2007 Apr 19
4
render_to_string in a model ?
I have a batch job that will call script/runner, I would like in this call to create html formated email and save it to the database. This is easy enough in a controller with yournewhost.email = render_to_string :action => "email_newhost_ready", :layout => false But render_to_string is only available in controller action pack, is there a easy way to render_to_string in a Model? Or
2007 Jul 21
3
manging rescues
What''s the recommended way to catch errors like this: NoMethodError in Register#confirm Showing app/views/register/confirm.rhtml where line #4 raised: undefined method `namen'' for nil:NilClass I get this error when someone does somethinh like: http://.........../register/confirm?email=jkdsfadslkjflksd If I make: remail = params[:email] @user = Request.find(:first,
2007 Jun 27
5
Regexp not matched
Sorry, meant to post this in the rails forum. Anyways, how would I write a rescue method to recover from a failed regexp parsing with error "regexp not matched" -Thanks -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post
2007 Jul 07
6
Help in upgrading from 1.1.6 to 1.2.3
Hi, I was developing a rails app with version 1.1.6 that just worked fine. I decided to upgrade to 1.2.3 and then, I keep getting that horrible message: "Application error Change this error message for exceptions thrown outside of an action (like in Dispatcher setups or broken Ruby code) in public/500.html" Now, before starting script/server I modiffied config/environment.rb and
2007 Jul 23
1
readline (LoadError)
hi, i''m a noob in ror, today i bought a book to learn ror. i do everthing that stand''s in this book, and the shit does''t work! i use Aptana IDE with RadRails the problem is: Loading development environment. /usr/lib/ruby/1.8/irb/completion.rb:10:in `require'': No such file to load -- readline (LoadError) from /usr/lib/ruby/1.8/irb/completion.rb:10 from
2007 Jul 10
3
need to add XTHML class attribute, link_to's html options?
I need to add a class attribute to the elements generated by link_to for my CSS to style the links. How can I do that? <%= link_to "Artworks", :controller => "artwork", :action => "list" %> --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk"
2007 Jun 13
2
Delete the fixtures on a functionnal test
Hi, Since couple a day, I block with the delete of my fixtures in my functionnals test. In my controller, I need test a redirect if there are no value. But i load my fixtures in start of my test and in a specific test I want delete all. Only in this method, not in other method. In API, I discover the method delete_existing_fixtures, who seem the good practice, but I can''t find how use
2007 Jul 14
3
observe_field, does this generate HTML?
I don''t have Rails installed at the moment, I''d like to check myself, but it''s just a simple curiosity. observe_field fits into replacement tags <%= %>, which caught my attention because as far as I know it''s just javascript observing a field and should not stick anything into HTML. Is <%= merely used as an enabling method, or will there actually be
2008 Dec 03
2
Rails functional test how to assert json result?
As title, I want to have my functional test check results from a json render result, how can I achieve this? --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this
2007 Jul 19
8
Where do I put code for my own types?
Sorry for all the questions today... Beyond the obvious things--models, controllers, helpers, and other framework-related types--where should I put the code for my own types? For example, I was thinking of writing my own AJAX-friendly paginator, but I don''t know where to put the code for that sort of thing. I would prefer to keep things object-oriented, so I would rather do a lot of
2010 Nov 14
2
Question re assert_equal
In Agile Web Development with Rails, the following statement is given: assert_equal "has already been taken", product.errors[:title].join(''; '') My question is: Why is the join(...) needed and what exactly does it do here? If it does what I assume, join an array of strings and use "; " as the separator, then I wonder how the assert_equal statement could ever
2010 Aug 06
1
New bie question: Why use assert_equal when there are comparison operators in Rspec?
hi guys, I''m reading up on Rspec, Mocha and some related material to put BDD in my new rails app. I have also checked out Ryan Bates'' railscasts on rspec (that''s how I got to know about Mocha). Reading up on the Rspec''s main site, the main example in http://rspec.rubyforge.org/rspec/1.3.0/ does not show any use of assert_equals. Rather it just uses the
2012 Aug 16
6
undefined method `with_indifferent_access' for "":String
Hi I''m having a issue with one object when try to update the attributes in this object previously saved in the database I have one object comp and one object reg they have this relationship comp has_many regs reg belongs_to comp when run use the method valid? like this current_contribuyente.comps.build(params[:comp]).valid? it returns: IndexError (string not matched) And when
2007 Sep 28
2
RoR uses something rather than erb or eRuby?
it seems that RoR doesn''t use erb or eRuby to generate its output for rhtml? the program erb and the description of eRuby at http://www.eruby.info both said that <% print "foo bar" %> or <% puts "hello" %> will be placed into the output... but currently for RoR, it won''t... only <%= expr %> is doing it and it cannot be print or
2005 Mar 07
2
erb and builder in same view ....
Has anyone tried using erb and builder in the same file? Either .rxml or .rhtml? I''m wanting to do some think like the following: xml.div(''id''=>''menu'') {|xml| link_to "create race", :controller=>"derby", :action=>"new" } Thanks, -- Tom. -- "Nothing will ever be attempted, if all possible objections must
2006 Apr 10
4
has render_component changed?
I have an application that worked fine, but after the recent updates has broken in some calls to render_component from views. I might be missing something but as far as I remember Rails updates is the only thing I''ve done in between. See the log: *** START LOG SNIPPET Start rendering component ({:params=> {:center_id=>10, :id=>25},
2007 Jan 23
1
assert_select issue
I''d like to do an assert_select where only ONE of the matching elements needs to match the :text. It seems counterintuitive to me to require them *all* to match, which precludes me from testing the existence of a particular tag (h1) with some particular text if other instances of the same tag exist. I know that I can narrow down the field by using more detailed selectors, but it sure
2007 Jul 28
19
Harry Potter 5 - The order of the Phoenix
*Harry Potter 5 <http://www.gobsmack.info/Harry-Potter/>* *The Order of the Phoenix* *Harry Potter and His friends * ** *Wallpapers, Story and Video download* *Harry Potter 5 - The Order of the Phoenix<http://www.gobsmack.info/Harry-Potter/> * --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby
2004 Sep 27
2
Looking for .Call functions
Hi, In my ongoing quest to track down the source of an error (see message "[R] optim error in arima" above), I find in the cource code for arima0 the following: arma0f <- function(p) { par <- as.double(fixed) par[mask] <- p .Call("arma0fa", G, par, PACKAGE = "stats") } I would like to know what the function
2009 Sep 01
13
Function Testing Reloading Fixtures before assertion
Hey Everyone, I have a function test the is failing (despite the fact the function actually works in the application). I was looking for some debug advice on how to find my problem. Here is the test: def test_should_delete_word assert_equal ''published'', words(:one).status debugger delete :destroy, :id => words(:one).to_param assert_equal