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
This commit is contained in:
Jamis Buck
2006-09-09 22:05:21 +00:00
parent 45b5555f4c
commit 5bf41ed8bc

View File

@@ -291,6 +291,16 @@ HTML
: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