similar to: Rails functional test how to assert json result?

Displaying 20 results from an estimated 2000 matches similar to: "Rails functional test how to assert json result?"

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 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 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 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 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 06
3
assert_equal - problems returning value from controller
Hi, I have the following assert_equal that is returning false. @q seems to be returning niil, but is set in the controller, how can I get hold of this value in my tests? assert_equal ''derby'', @q Thanks Mark -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups
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
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
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
2008 May 11
3
Get current controller name/action name from view
Hi. I swear I found this in the group archives, but now I cannot find this in the group or elsewhere online! In a view I would like to get the current controller name and action that was used to get here. For example, I have a template that I''m using from two different controllers (and four different actions in each controller), such as :controller => "my_view", :action
2009 Mar 08
2
rspec 1.1.99.12, Rails 2.3.1, undefined method `rspec_options=''
Hi David, all: I recently upgraded to Rails 2.3.1RC2 (Ubuntu 8.10, ruby 1.8.7 (2008-08-11 patchlevel 72) [i486-linux]) and have been dilligently following the instructions for upgrading rspec and rspec-rails according to: http://wiki.github.com/dchelimsky/rspec/rails-with-rspec-gems. and when I run ''rake gem'' fails with error: rake aborted! undefined method
2007 Jul 23
3
dependencies
I knew that hpricot was a dependency, but hoe and rubyforge....is this right? Version 0.6.9 for ruby Mike B. ---------------------------------------------------------------- This message was sent using IMP, the Internet Messaging Program.
2006 Oct 19
2
How to get multiple Correlation Coefficients
Hi I have used a polycor package for categorical correlation coefficients. I run the following script. But there were no results. Could you tell me how to correct the script? Thanks in advance, vars <- names(sdi) for (i in 1:length(vars)) { for (j in 1:length(vars)) { paste(vars[i]," and ", vars[j]) polychor(vars[i], vars[j]) # corr } } -- Kum-Hoe Hwang, Ph.D.Phone :
2012 Nov 28
1
Build error of NSD4 on Debian Squeeze
Hello World, I am trying to build NSD4 on Debian Squeeze and I get the following errors when running `make`. ``` $ pwd /home/wiz/src/nsd/tags/NSD_4_0_0_imp_5 $ make [... output omitted ...] gcc -g -O2 -o nsd-checkconf answer.o axfr.o buffer.o configlexer.o configparse acket.o query.o rbtree.o radtree.o rdata.o region-allocator.o tsig.o tsig-opens 4_pton.o b64_ntop.o -lcrypto configparser.o: In
2006 Aug 15
5
Set up a default route
Phlip wrote: > Can I fix it by adding a view called ''inventories''? That worked, because I have a sufficiently late version of MySQL. Next question. What does "Set up a default route" mean? When I read... http://wiki.rubyonrails.com/rails/pages/Routes ...it reminds me of the Apache documentation for mod_rewrite. I hope someone appreciates the candor of my
2006 Mar 05
2
what is scale function? Is it for variable transformation?
HOwdy I read R books about scale function for variable transformation. Acoording to this book scale function leads me to better regression results. Or am I worng? I hope somebody tell me about a scale function? Is it for variable transformation? -- Kum-Hoe Hwang, Phone : 82-31-250-3516Email : phdhwang@gmail.com [[alternative HTML version deleted]]
2007 Feb 14
1
Any packages for conducting AHP( Analytic Hierarchy Process) data
Hi, R Lovers! I have some survey data. I'd like to run R or R packages for processing data inputted from AHP(Analytic Hierarchy Process) survey. Are there any R packages or subsititues for running data from AHP survey. Thanks in advance, -- Kum-Hoe Hwang, Ph.D.Phone : 82-31-250-3516 Email : phdhwang@gmail.com [[alternative HTML version deleted]]