mirror of
https://github.com/github/rails.git
synced 2026-01-30 00:38:00 -05:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user