get :revision, :id => 1, :rev => 2
assert_response :success
assert_template 'revision'
- assert_tag :tag => 'ul',
- :child => { :tag => 'li',
- # link to the entry at rev 2
- :child => { :tag => 'a',
- :attributes => {:href => '/projects/ecookbook/repository/revisions/2/entry/test/some/path/in/the/repo'},
- :content => 'repo',
- # link to partial diff
- :sibling => { :tag => 'a',
- :attributes => { :href => '/projects/ecookbook/repository/revisions/2/diff/test/some/path/in/the/repo' }
- }
- }
- }
+
+ assert_select 'ul' do
+ assert_select 'li' do
+ # link to the entry at rev 2
+ assert_select 'a[href=?]', '/projects/ecookbook/repository/revisions/2/entry/test/some/path/in/the/repo', :text => 'repo'
+ # link to partial diff
+ assert_select 'a[href=?]', '/projects/ecookbook/repository/revisions/2/diff/test/some/path/in/the/repo'
+ end
+ end
end
def test_invalid_revision
get :revision, :id => 1, :rev => 2
assert_response :success
assert_template 'revision'
- assert_tag :tag => 'ul',
- :child => { :tag => 'li',
- # link to the entry at rev 2
- :child => { :tag => 'a',
- :attributes => {:href => '/projects/ecookbook/repository/revisions/2/entry/path/in/the/repo'},
- :content => 'repo',
- # link to partial diff
- :sibling => { :tag => 'a',
- :attributes => { :href => '/projects/ecookbook/repository/revisions/2/diff/path/in/the/repo' }
- }
- }
- }
+
+ assert_select 'ul' do
+ assert_select 'li' do
+ # link to the entry at rev 2
+ assert_select 'a[href=?]', '/projects/ecookbook/repository/revisions/2/entry/path/in/the/repo', :text => 'repo'
+ # link to partial diff
+ assert_select 'a[href=?]', '/projects/ecookbook/repository/revisions/2/diff/path/in/the/repo'
+ end
+ end
end
def test_revision_diff