similar to: assert_xhtml - test your HTML by example

Displaying 20 results from an estimated 800 matches similar to: "assert_xhtml - test your HTML by example"

2009 Mar 26
0
assert2-0.4.6 provides assert_xhtml, an alternative to assert_select
Rubyists: Consider the following monstrosity, coded using assert_select: assert_select "div#logo_box img[src=/0000/0001/logo.gif][alt=My Company]" Now, behold it rewritten to use assert_xhtml: assert_xhtml do div.logo_box! do img :src => /logo.gif$/, :alt => ''My Company'' end end That sample contains more Ruby; it''s not just
2008 Apr 18
1
[LLVMdev] Disabling Verifier
Hi, I've noticed that the funcionality in the Verifier.cpp significantely slows down the compilation, especially for big basic blocks. In this case the llvm::DominatorTree::dominates() seems to consume a lot of time. Some debugging has shown that it is the Assert2() macro usage in the Verifier::visitInstruction(), arount this place: // Definition must dominate use unless use is
2007 Dec 31
2
Conditional Float Precision
I''m trying to figure out the best way (and hopefully leanest) to conditionally have precision to a float number. Here''s what I''m doing... I have a float (which has a default precision of 1) so like 250.0 What I want to do is have the precision go to 0 if the value after the . is 0 = so 250.0 would show as 250, but 250.5 would show 250.5. Thoughts? Thanks.
2006 Feb 03
6
Go back to previous action
Hello all! I have two views (list_1 and list_2) that show a list of users in two different ways. In the views for these actions there is a link to edit a specific user properties (edit_user). That works fine, except that when I change the user I want to go back to the view that originated the request and not to the default list (list_1). Can anyone help me? Best regards, Hugo -- Posted via
2009 Feb 01
8
undefined method `inherit'' for Merb::Test::ExampleGroup
RSpeckers: I''m trying to install this into a Merb-generated RSpec rig: http://code.jeremyevans.net/doc/fixture_dependencies/ It requires inserting their test case into RSpec. This is the documented way to do it: describe ''Post'' do inherit FixtureDependencies::SequelTestCase And that leads to the syntax error in the subject line. (No stack trace is available
2006 Oct 30
1
domain language?
RSpeckers: I went with RSpec instead of Systir because I downloaded and installed the former first. (I know that''s not exactly a ringing endorsement! ;-) I want to compete with FIT and Fitnesse, like this: http://www.zeroplayer.com/cgi-bin/wiki?TestFlea#tropism (Click on a Green Bar to distend one test case.) I want a domain-specific language in the parchment-colored area on the
2008 Jan 04
2
Nested Routes + Facebook Resources
Does anyone have nested routes working with the facebook_resources method? My routes.rb has: map.facebook_resources :users do |users| users.facebook_resources :images users.facebook_resources :connections end but user_connections_url won''t generate. "rake routes" gives me: new_user POST /users/new {:action=>"new",
2006 Jan 05
2
help - edit without using scaffold
Hello, What am I doing wrong? The code below does not show the current record for editing. def edit @user = User.find(params[:id]) end def update @user = User.find(params[:id]) if @user.update_attributes(params[:user]) flash[:notice] = ''User was successfully updated.'' redirect_to :action => ''show'', :id => @user else render :action
2006 Nov 07
0
Wiki -> RSpec -> Watir
Rubies & Acceptance Testers: For those of you not doing acceptance tests yet, I have a very slick test rig to show off. I haven''t demo-ized it yet, so please accept these diverse audiovisual displays as if they were a united whole! We start with MiniRubyWiki, at this demo: http://www.zeroplayer.com/cgi-bin/wiki?TestFlea Click on any of the green bars. Now imagine if the left
2012 Feb 21
1
link_to 'Frob', '/thang/frob', :remote => true
Railsters: I have finally gotten back to Rails, and I''m having the usual "a little bit too flexible for your own good" problems. Specifically, the above in my Haml renders this: <a href="/thang/frob" data-remote="true">Frob</a> I need href=''#'' and an Ajax call. What did I do wrong? (Besides, ahem, attempt to read the fine
2010 Jun 03
7
Scheduled tasks in Rails: Cron + wget = Best solution?
Hi there, do you agree that for having scheduled tasks in Rails, the leanest solution is the following? - Create a controller with an action for each task - Implement the logic of the task as controller code - Set up a cron job at the OS level that uses wget to invoke the URL of this controller/action at the appropriate time intervals Advantages: 1) full access to all your Rails objects just as
2010 Jun 10
0
strange problem:no such file to load -- nokogiri on rails3
I am test the script named test.rb by command "ruby test.rb" and it pass. Then i converte it as rake task. The rake task pass on rails 2.3.4 but fail on rails 3 beta4 with error msg: "no such file to load -- nokogiri" ============================ env :rails 3 beta4, ruby 1.8.7, ubuntu ============================ test.rb ============================ require
2010 Nov 20
4
How to get rspec running?
I''m quite new to RoR and recently worked through Michael Hartl''s Rail Tutorial. Now that I had started my first own project and began with the implementation of a first model and it''s controller. The tests I wanted to implement just after that. However, I run into some error messages when I want to start rspec (see below). The Gemfile is the same as in the Tutorial
2009 Sep 17
1
Load Error Using Mechanize Gem
Hi, I''m getting a "Could not open any of [xml2, xslt, exslt] (LoadError)" error when trying to run a simple Ruby program taken from the EXAMPLES.rdoc file of the Mechanize gem. The error is in this line of the Nokogiri module of libxml.rb: ffi_lib ''xml2'', ''xslt'', ''exslt'' Not sure if there are missing gems, and if so,
2010 Nov 04
0
Rails routing issue
Within a rails app I''ve got a special url (/profile) that I''m mapping to the user controller to allow a user to view and edit their profile. I made the following entries into my route file so that the "get" for profile will route me to the profile action in the user controller and the "post" for profile will route to the update_profile action in the user
2010 Oct 31
0
Loading xml document using Nokogiri and retrieving CDATA element
This is an extension of my last post (problems with REXML) which has me looking to Nokogiri again. The reason I am not using Nokogiri is I can not seem to find a way to get CDATA out of a Nokogiri document. First, can you tell me if I am loading my document correctly, because when I call my_document.to_xml, I only get one line back: (rdb:1) test_file = Nokogiri::XML(mismo_xml_file)
2013 Jun 04
3
Nokogiri::XML methods example
Hi, I am not able to find out a simple example to find out the how the method works: > Nokogiri::XML::EntityReference::new (http://nokogiri.org/Nokogiri/XML/EntityReference.html#method-c-new) > Nokogiri::XML::Document#canonicalize (http://nokogiri.org/Nokogiri/XML/Document.html#method-i-canonicalize) Thanks -- Posted via http://www.ruby-forum.com/. -- You received this message
2013 Sep 02
2
Why the string interpolation is not working inside the Nokogiri method `#search` ?
Why the string interpolation is not working inside the Nokogiri method `#search` ? require ''nokogiri'' doc = Nokogiri::HTML::Document.parse <<-eotl <div> <p>foo</p> <p>foo</p> <p>bar</p> </div> eotl doc.class # => Nokogiri::HTML::Document class Person attr_accessor :name end ram = Person.new
2009 Nov 11
2
nokogiri: parsing tags
Hello, I''m trying to use nokogiri gem to parse individual xhtml tags (not the whole html document) and preform some processing on them. Heres an example of a string that I want to process: str = ''<img src="http://www.canadascapital.gc.ca/data/2/rec_imgs/5005_Pepsi_H1NB.gif"/> some text<a href="#">test</a> ....'' The following code
2010 Apr 29
0
Missing source file (valid in console, errors when accessed online)
Environment info: Ruby 1.9.1-p376 Rails 2.3.5 Apache2 with Passenger mod I installed the nokogiri gem like I would any other gem however when I require it at the top of my controller and access it through apache, I get an error saying "Missing source file" and it lists nokogiri. I have other gems required at the top and when I don''t have nokogiri required everything works