scm: cvs: code clean up functional test.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@5452 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Toshi MARUYAMA 2011-04-14 07:20:57 +00:00
parent d43bc98a49
commit a20f140734

View File

@ -96,8 +96,9 @@ class RepositoriesCvsControllerTest < ActionController::TestCase
get :entry, :id => PRJ_ID, :path => ['sources', 'watchers_controller.rb'] get :entry, :id => PRJ_ID, :path => ['sources', 'watchers_controller.rb']
assert_response :success assert_response :success
assert_template 'entry' assert_template 'entry'
assert_no_tag :tag => 'td', :attributes => { :class => /line-code/}, assert_no_tag :tag => 'td',
:content => /before_filter/ :attributes => { :class => /line-code/},
:content => /before_filter/
end end
def test_entry_at_given_revision def test_entry_at_given_revision
@ -108,16 +109,18 @@ class RepositoriesCvsControllerTest < ActionController::TestCase
assert_response :success assert_response :success
assert_template 'entry' assert_template 'entry'
# this line was removed in r3 # this line was removed in r3
assert_tag :tag => 'td', :attributes => { :class => /line-code/}, assert_tag :tag => 'td',
:content => /before_filter/ :attributes => { :class => /line-code/},
:content => /before_filter/
end end
def test_entry_not_found def test_entry_not_found
@repository.fetch_changesets @repository.fetch_changesets
@repository.reload @repository.reload
get :entry, :id => PRJ_ID, :path => ['sources', 'zzz.c'] get :entry, :id => PRJ_ID, :path => ['sources', 'zzz.c']
assert_tag :tag => 'p', :attributes => { :id => /errorExplanation/ }, assert_tag :tag => 'p',
:content => /The entry or revision was not found in the repository/ :attributes => { :id => /errorExplanation/ },
:content => /The entry or revision was not found in the repository/
end end
def test_entry_download def test_entry_download
@ -174,23 +177,33 @@ class RepositoriesCvsControllerTest < ActionController::TestCase
assert_response :success assert_response :success
assert_template 'annotate' assert_template 'annotate'
# 1.1 line # 1.1 line
assert_tag :tag => 'th', :attributes => { :class => 'line-num' }, assert_tag :tag => 'th',
:content => '18', :attributes => { :class => 'line-num' },
:sibling => { :tag => 'td', :attributes => { :class => 'revision' }, :content => '18',
:content => /1.1/, :sibling => {
:sibling => { :tag => 'td', :attributes => { :class => 'author' }, :tag => 'td',
:content => /LANG/ :attributes => { :class => 'revision' },
} :content => /1.1/,
} :sibling => {
:tag => 'td',
:attributes => { :class => 'author' },
:content => /LANG/
}
}
# 1.2 line # 1.2 line
assert_tag :tag => 'th', :attributes => { :class => 'line-num' }, assert_tag :tag => 'th',
:content => '32', :attributes => { :class => 'line-num' },
:sibling => { :tag => 'td', :attributes => { :class => 'revision' }, :content => '32',
:content => /1.2/, :sibling => {
:sibling => { :tag => 'td', :attributes => { :class => 'author' }, :tag => 'td',
:content => /LANG/ :attributes => { :class => 'revision' },
} :content => /1.2/,
} :sibling => {
:tag => 'td',
:attributes => { :class => 'author' },
:content => /LANG/
}
}
end end
else else
puts "CVS test repository NOT FOUND. Skipping functional tests !!!" puts "CVS test repository NOT FOUND. Skipping functional tests !!!"