Permalink
Browse files

Add test case to test attribute matching by assert_tag

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5082 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information...
1 parent 45b5555 commit 5bf41ed8bcb8e9a15e2290e2e72a7aaffafa31b5 @jamis jamis committed Sep 9, 2006
Showing with 10 additions and 0 deletions.
  1. +10 −0 actionpack/test/controller/test_test.rb
@@ -291,6 +291,16 @@ def test_assert_tag_children_without_content
:only => { :tag => "img" } } } }
end
+ def test_assert_tag_attribute_matching
+ @response.body = '<input type="text" name="my_name">'
+ assert_tag :tag => 'input',
+ :attributes => { :name => /my/, :type => 'text' }
+ assert_no_tag :tag => 'input',
+ :attributes => { :name => 'my', :type => 'text' }
+ assert_no_tag :tag => 'input',
+ :attributes => { :name => /^my$/, :type => 'text' }
+ end
+
def test_assert_generates
assert_generates 'controller/action/5', :controller => 'controller', :action => 'action', :id => '5'
end

0 comments on commit 5bf41ed

Please sign in to comment.