comparison test/functional/.svn/text-base/repositories_cvs_controller_test.rb.svn-base @ 245:051f544170fe

* Update to SVN trunk revision 4993
author Chris Cannam
date Thu, 03 Mar 2011 11:42:28 +0000
parents 0579821a129a
children cbce1fd3b1b7
comparison
equal deleted inserted replaced
244:8972b600f4fb 245:051f544170fe
39 User.current = nil 39 User.current = nil
40 40
41 @project = Project.find(PRJ_ID) 41 @project = Project.find(PRJ_ID)
42 @repository = Repository::Cvs.create(:project => Project.find(PRJ_ID), 42 @repository = Repository::Cvs.create(:project => Project.find(PRJ_ID),
43 :root_url => REPOSITORY_PATH, 43 :root_url => REPOSITORY_PATH,
44 :url => MODULE_NAME) 44 :url => MODULE_NAME,
45 :log_encoding => 'UTF-8')
45 assert @repository 46 assert @repository
46 end 47 end
47 48
48 if File.directory?(REPOSITORY_PATH) 49 if File.directory?(REPOSITORY_PATH)
49 def test_show 50 def test_show
151 assert_template 'diff' 152 assert_template 'diff'
152 assert_tag :tag => 'td', :attributes => { :class => 'line-code diff_out' }, 153 assert_tag :tag => 'td', :attributes => { :class => 'line-code diff_out' },
153 :content => /watched.remove_watcher/ 154 :content => /watched.remove_watcher/
154 assert_tag :tag => 'td', :attributes => { :class => 'line-code diff_in' }, 155 assert_tag :tag => 'td', :attributes => { :class => 'line-code diff_in' },
155 :content => /watched.remove_all_watcher/ 156 :content => /watched.remove_all_watcher/
157 end
158
159 def test_diff_new_files
160 @repository.fetch_changesets
161 @repository.reload
162 get :diff, :id => PRJ_ID, :rev => 1, :type => 'inline'
163 assert_response :success
164 assert_template 'diff'
165 assert_tag :tag => 'td', :attributes => { :class => 'line-code diff_in' },
166 :content => /watched.remove_watcher/
167 assert_tag :tag => 'th', :attributes => { :class => 'filename' },
168 :content => /test\/README/
169 assert_tag :tag => 'th', :attributes => { :class => 'filename' },
170 :content => /test\/images\/delete.png /
171 assert_tag :tag => 'th', :attributes => { :class => 'filename' },
172 :content => /test\/images\/edit.png/
173 assert_tag :tag => 'th', :attributes => { :class => 'filename' },
174 :content => /test\/sources\/watchers_controller.rb/
156 end 175 end
157 176
158 def test_annotate 177 def test_annotate
159 @repository.fetch_changesets 178 @repository.fetch_changesets
160 @repository.reload 179 @repository.reload