vendor/rails/actionpack/test/controller/selector_test.rb in radiant-0.6.4 vs vendor/rails/actionpack/test/controller/selector_test.rb in radiant-0.6.5

- old
+ new

@@ -1,12 +1,12 @@ #-- # Copyright (c) 2006 Assaf Arkin (http://labnotes.org) # Under MIT and/or CC By license. #++ -require File.dirname(__FILE__) + '/../abstract_unit' -require File.dirname(__FILE__) + '/fake_controllers' +require "#{File.dirname(__FILE__)}/../abstract_unit" +require "#{File.dirname(__FILE__)}/fake_controllers" class SelectorTest < Test::Unit::TestCase # # Basic selector: element, id, class, attributes. # @@ -83,15 +83,15 @@ # Match any element with attribute. select("*[title]") assert_equal 2, @matches.size assert_equal "2", @matches[0].attributes["id"] assert_equal "3", @matches[1].attributes["id"] - # Match alement with attribute value. + # Match element with attribute value. select("*[title=foo]") assert_equal 1, @matches.size assert_equal "3", @matches[0].attributes["id"] - # Match alement with attribute and attribute value. + # Match element with attribute and attribute value. select("[bar=foo][title]") assert_equal 1, @matches.size assert_equal "2", @matches[0].attributes["id"] # Not case sensitive. select("[BAR=foo][TiTle]") @@ -175,10 +175,10 @@ parse(%Q{<h1 id="1"><a href="foo"></a></h1><h2 id="2"><a href="bar"></a></h2><h3 id="2"><a href="baz"></a></h3>}) select("h1 a, h3 a") assert_equal 2, @matches.size assert_equal "foo", @matches[0].attributes["href"] assert_equal "baz", @matches[1].attributes["href"] - # And now for the three selector challange. + # And now for the three selector challenge. parse(%Q{<h1 id="1"><a href="foo"></a></h1><h2 id="2"><a href="bar"></a></h2><h3 id="2"><a href="baz"></a></h3>}) select("h1 a, h2 a, h3 a") assert_equal 3, @matches.size assert_equal "foo", @matches[0].attributes["href"] assert_equal "bar", @matches[1].attributes["href"]