##// END OF EJS Templates
Rails3: test: scm: bazaar: use "repository_path_hash" for path param...
Toshi MARUYAMA -
r8807:d086683b1766
parent child
Show More
@@ -58,7 +58,7 class RepositoriesBazaarControllerTest < ActionController::TestCase
58 end
58 end
59
59
60 def test_browse_directory
60 def test_browse_directory
61 get :show, :id => PRJ_ID, :path => ['directory']
61 get :show, :id => PRJ_ID, :path => repository_path_hash(['directory'])[:param]
62 assert_response :success
62 assert_response :success
63 assert_template 'show'
63 assert_template 'show'
64 assert_not_nil assigns(:entries)
64 assert_not_nil assigns(:entries)
@@ -70,7 +70,8 class RepositoriesBazaarControllerTest < ActionController::TestCase
70 end
70 end
71
71
72 def test_browse_at_given_revision
72 def test_browse_at_given_revision
73 get :show, :id => PRJ_ID, :path => [], :rev => 3
73 get :show, :id => PRJ_ID, :path => repository_path_hash([])[:param],
74 :rev => 3
74 assert_response :success
75 assert_response :success
75 assert_template 'show'
76 assert_template 'show'
76 assert_not_nil assigns(:entries)
77 assert_not_nil assigns(:entries)
@@ -79,14 +80,16 class RepositoriesBazaarControllerTest < ActionController::TestCase
79 end
80 end
80
81
81 def test_changes
82 def test_changes
82 get :changes, :id => PRJ_ID, :path => ['doc-mkdir.txt']
83 get :changes, :id => PRJ_ID,
84 :path => repository_path_hash(['doc-mkdir.txt'])[:param]
83 assert_response :success
85 assert_response :success
84 assert_template 'changes'
86 assert_template 'changes'
85 assert_tag :tag => 'h2', :content => 'doc-mkdir.txt'
87 assert_tag :tag => 'h2', :content => 'doc-mkdir.txt'
86 end
88 end
87
89
88 def test_entry_show
90 def test_entry_show
89 get :entry, :id => PRJ_ID, :path => ['directory', 'doc-ls.txt']
91 get :entry, :id => PRJ_ID,
92 :path => repository_path_hash(['directory', 'doc-ls.txt'])[:param]
90 assert_response :success
93 assert_response :success
91 assert_template 'entry'
94 assert_template 'entry'
92 # Line 19
95 # Line 19
@@ -97,14 +100,17 class RepositoriesBazaarControllerTest < ActionController::TestCase
97 end
100 end
98
101
99 def test_entry_download
102 def test_entry_download
100 get :entry, :id => PRJ_ID, :path => ['directory', 'doc-ls.txt'], :format => 'raw'
103 get :entry, :id => PRJ_ID,
104 :path => repository_path_hash(['directory', 'doc-ls.txt'])[:param],
105 :format => 'raw'
101 assert_response :success
106 assert_response :success
102 # File content
107 # File content
103 assert @response.body.include?('Show help message')
108 assert @response.body.include?('Show help message')
104 end
109 end
105
110
106 def test_directory_entry
111 def test_directory_entry
107 get :entry, :id => PRJ_ID, :path => ['directory']
112 get :entry, :id => PRJ_ID,
113 :path => repository_path_hash(['directory'])[:param]
108 assert_response :success
114 assert_response :success
109 assert_template 'show'
115 assert_template 'show'
110 assert_not_nil assigns(:entry)
116 assert_not_nil assigns(:entry)
@@ -127,7 +133,8 class RepositoriesBazaarControllerTest < ActionController::TestCase
127 end
133 end
128
134
129 def test_annotate
135 def test_annotate
130 get :annotate, :id => PRJ_ID, :path => ['doc-mkdir.txt']
136 get :annotate, :id => PRJ_ID,
137 :path => repository_path_hash(['doc-mkdir.txt'])[:param]
131 assert_response :success
138 assert_response :success
132 assert_template 'annotate'
139 assert_template 'annotate'
133 assert_tag :tag => 'th', :content => '2',
140 assert_tag :tag => 'th', :content => '2',
General Comments 0
You need to be logged in to leave comments. Login now