##// END OF EJS Templates
scm: mercurial: functional test for accept both of revision number and changeset id (#3724)....
Toshi MARUYAMA -
r4544:a223a0dffdca
parent child
Show More
@@ -68,15 +68,18 class RepositoriesMercurialControllerTest < ActionController::TestCase
68 end
68 end
69
69
70 def test_show_at_given_revision
70 def test_show_at_given_revision
71 get :show, :id => 3, :path => ['images'], :rev => 0
71 [0, '0', '0885933ad4f6'].each do |r1|
72 get :show, :id => 3, :path => ['images'], :rev => r1
72 assert_response :success
73 assert_response :success
73 assert_template 'show'
74 assert_template 'show'
74 assert_not_nil assigns(:entries)
75 assert_not_nil assigns(:entries)
75 assert_equal ['delete.png'], assigns(:entries).collect(&:name)
76 assert_equal ['delete.png'], assigns(:entries).collect(&:name)
76 end
77 end
78 end
77
79
78 def test_show_directory_sql_escape_percent
80 def test_show_directory_sql_escape_percent
79 get :show, :id => 3, :path => ['sql_escape', 'percent%dir'], :rev => 13
81 [13, '13', '3a330eb32958'].each do |r1|
82 get :show, :id => 3, :path => ['sql_escape', 'percent%dir'], :rev => r1
80 assert_response :success
83 assert_response :success
81 assert_template 'show'
84 assert_template 'show'
82
85
@@ -88,6 +91,7 class RepositoriesMercurialControllerTest < ActionController::TestCase
88 # assert_not_nil changesets
91 # assert_not_nil changesets
89 # assert_equal %w(13 11 10 9), changesets.collect(&:revision)
92 # assert_equal %w(13 11 10 9), changesets.collect(&:revision)
90 end
93 end
94 end
91
95
92 def test_changes
96 def test_changes
93 get :changes, :id => 3, :path => ['images', 'edit.png']
97 get :changes, :id => 3, :path => ['images', 'edit.png']
@@ -123,6 +127,7 class RepositoriesMercurialControllerTest < ActionController::TestCase
123 end
127 end
124
128
125 def test_diff
129 def test_diff
130 [4, '4', 'def6d2f1254a'].each do |r1|
126 # Full diff of changeset 4
131 # Full diff of changeset 4
127 get :diff, :id => 3, :rev => 4
132 get :diff, :id => 3, :rev => 4
128 assert_response :success
133 assert_response :success
@@ -134,6 +139,7 class RepositoriesMercurialControllerTest < ActionController::TestCase
134 :attributes => { :class => /diff_out/ },
139 :attributes => { :class => /diff_out/ },
135 :content => /def remove/ }
140 :content => /def remove/ }
136 end
141 end
142 end
137
143
138 def test_annotate
144 def test_annotate
139 get :annotate, :id => 3, :path => ['sources', 'watchers_controller.rb']
145 get :annotate, :id => 3, :path => ['sources', 'watchers_controller.rb']
General Comments 0
You need to be logged in to leave comments. Login now