##// END OF EJS Templates
scm: cvs: code clean up functional test....
Toshi MARUYAMA -
r5332:a20f140734e4
parent child
Show More
@@ -96,8 +96,9 class RepositoriesCvsControllerTest < ActionController::TestCase
96 get :entry, :id => PRJ_ID, :path => ['sources', 'watchers_controller.rb']
96 get :entry, :id => PRJ_ID, :path => ['sources', 'watchers_controller.rb']
97 assert_response :success
97 assert_response :success
98 assert_template 'entry'
98 assert_template 'entry'
99 assert_no_tag :tag => 'td', :attributes => { :class => /line-code/},
99 assert_no_tag :tag => 'td',
100 :content => /before_filter/
100 :attributes => { :class => /line-code/},
101 :content => /before_filter/
101 end
102 end
102
103
103 def test_entry_at_given_revision
104 def test_entry_at_given_revision
@@ -108,16 +109,18 class RepositoriesCvsControllerTest < ActionController::TestCase
108 assert_response :success
109 assert_response :success
109 assert_template 'entry'
110 assert_template 'entry'
110 # this line was removed in r3
111 # this line was removed in r3
111 assert_tag :tag => 'td', :attributes => { :class => /line-code/},
112 assert_tag :tag => 'td',
112 :content => /before_filter/
113 :attributes => { :class => /line-code/},
114 :content => /before_filter/
113 end
115 end
114
116
115 def test_entry_not_found
117 def test_entry_not_found
116 @repository.fetch_changesets
118 @repository.fetch_changesets
117 @repository.reload
119 @repository.reload
118 get :entry, :id => PRJ_ID, :path => ['sources', 'zzz.c']
120 get :entry, :id => PRJ_ID, :path => ['sources', 'zzz.c']
119 assert_tag :tag => 'p', :attributes => { :id => /errorExplanation/ },
121 assert_tag :tag => 'p',
120 :content => /The entry or revision was not found in the repository/
122 :attributes => { :id => /errorExplanation/ },
123 :content => /The entry or revision was not found in the repository/
121 end
124 end
122
125
123 def test_entry_download
126 def test_entry_download
@@ -174,23 +177,33 class RepositoriesCvsControllerTest < ActionController::TestCase
174 assert_response :success
177 assert_response :success
175 assert_template 'annotate'
178 assert_template 'annotate'
176 # 1.1 line
179 # 1.1 line
177 assert_tag :tag => 'th', :attributes => { :class => 'line-num' },
180 assert_tag :tag => 'th',
178 :content => '18',
181 :attributes => { :class => 'line-num' },
179 :sibling => { :tag => 'td', :attributes => { :class => 'revision' },
182 :content => '18',
180 :content => /1.1/,
183 :sibling => {
181 :sibling => { :tag => 'td', :attributes => { :class => 'author' },
184 :tag => 'td',
182 :content => /LANG/
185 :attributes => { :class => 'revision' },
183 }
186 :content => /1.1/,
184 }
187 :sibling => {
188 :tag => 'td',
189 :attributes => { :class => 'author' },
190 :content => /LANG/
191 }
192 }
185 # 1.2 line
193 # 1.2 line
186 assert_tag :tag => 'th', :attributes => { :class => 'line-num' },
194 assert_tag :tag => 'th',
187 :content => '32',
195 :attributes => { :class => 'line-num' },
188 :sibling => { :tag => 'td', :attributes => { :class => 'revision' },
196 :content => '32',
189 :content => /1.2/,
197 :sibling => {
190 :sibling => { :tag => 'td', :attributes => { :class => 'author' },
198 :tag => 'td',
191 :content => /LANG/
199 :attributes => { :class => 'revision' },
192 }
200 :content => /1.2/,
193 }
201 :sibling => {
202 :tag => 'td',
203 :attributes => { :class => 'author' },
204 :content => /LANG/
205 }
206 }
194 end
207 end
195 else
208 else
196 puts "CVS test repository NOT FOUND. Skipping functional tests !!!"
209 puts "CVS test repository NOT FOUND. Skipping functional tests !!!"
General Comments 0
You need to be logged in to leave comments. Login now