summaryrefslogtreecommitdiffstats
path: root/test/functional/repositories_bazaar_controller_test.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2017-05-31 17:32:34 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2017-05-31 17:32:34 +0000
commitb834e81d7f41121fc6d9bef95ee090f8f466493e (patch)
tree61fddb6214c64e96fddd504301029bdb382ba439 /test/functional/repositories_bazaar_controller_test.rb
parent1d4300b674f739d671a8be22d3ea617922f16517 (diff)
downloadredmine-b834e81d7f41121fc6d9bef95ee090f8f466493e.tar.gz
redmine-b834e81d7f41121fc6d9bef95ee090f8f466493e.zip
Use Rails 5 syntax for functional tests.
git-svn-id: http://svn.redmine.org/redmine/trunk@16585 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/functional/repositories_bazaar_controller_test.rb')
-rw-r--r--test/functional/repositories_bazaar_controller_test.rb63
1 files changed, 49 insertions, 14 deletions
diff --git a/test/functional/repositories_bazaar_controller_test.rb b/test/functional/repositories_bazaar_controller_test.rb
index 8938c97a2..e59407703 100644
--- a/test/functional/repositories_bazaar_controller_test.rb
+++ b/test/functional/repositories_bazaar_controller_test.rb
@@ -42,7 +42,10 @@ class RepositoriesBazaarControllerTest < Redmine::ControllerTest
def test_get_new
@request.session[:user_id] = 1
@project.repository.destroy
- get :new, :project_id => 'subproject1', :repository_scm => 'Bazaar'
+ get :new, :params => {
+ :project_id => 'subproject1',
+ :repository_scm => 'Bazaar'
+ }
assert_response :success
assert_select 'select[name=?]', 'repository_scm' do
assert_select 'option[value=?][selected=selected]', 'Bazaar'
@@ -50,7 +53,9 @@ class RepositoriesBazaarControllerTest < Redmine::ControllerTest
end
def test_browse_root
- get :show, :id => PRJ_ID
+ get :show, :params => {
+ :id => PRJ_ID
+ }
assert_response :success
assert_select 'table.entries tbody' do
assert_select 'tr', 2
@@ -60,7 +65,10 @@ class RepositoriesBazaarControllerTest < Redmine::ControllerTest
end
def test_browse_directory
- get :show, :id => PRJ_ID, :path => repository_path_hash(['directory'])[:param]
+ get :show, :params => {
+ :id => PRJ_ID,
+ :path => repository_path_hash(['directory'])[:param]
+ }
assert_response :success
assert_select 'table.entries tbody' do
assert_select 'tr', 3
@@ -71,8 +79,11 @@ class RepositoriesBazaarControllerTest < Redmine::ControllerTest
end
def test_browse_at_given_revision
- get :show, :id => PRJ_ID, :path => repository_path_hash([])[:param],
+ get :show, :params => {
+ :id => PRJ_ID,
+ :path => repository_path_hash([])[:param],
:rev => 3
+ }
assert_response :success
assert_select 'table.entries tbody' do
assert_select 'tr', 4
@@ -84,32 +95,40 @@ class RepositoriesBazaarControllerTest < Redmine::ControllerTest
end
def test_changes
- get :changes, :id => PRJ_ID,
+ get :changes, :params => {
+ :id => PRJ_ID,
:path => repository_path_hash(['doc-mkdir.txt'])[:param]
+ }
assert_response :success
assert_select 'h2', :text => /doc-mkdir.txt/
end
def test_entry_show
- get :entry, :id => PRJ_ID,
+ get :entry, :params => {
+ :id => PRJ_ID,
:path => repository_path_hash(['directory', 'doc-ls.txt'])[:param]
+ }
assert_response :success
# Line 19
assert_select 'tr#L29 td.line-code', :text => /Show help message/
end
def test_entry_download
- get :entry, :id => PRJ_ID,
+ get :entry, :params => {
+ :id => PRJ_ID,
:path => repository_path_hash(['directory', 'doc-ls.txt'])[:param],
:format => 'raw'
+ }
assert_response :success
# File content
assert @response.body.include?('Show help message')
end
def test_directory_entry
- get :entry, :id => PRJ_ID,
+ get :entry, :params => {
+ :id => PRJ_ID,
:path => repository_path_hash(['directory'])[:param]
+ }
assert_response :success
assert_select 'table.entries tbody'
end
@@ -117,7 +136,11 @@ class RepositoriesBazaarControllerTest < Redmine::ControllerTest
def test_diff
# Full diff of changeset 3
['inline', 'sbs'].each do |dt|
- get :diff, :id => PRJ_ID, :rev => 3, :type => dt
+ get :diff, :params => {
+ :id => PRJ_ID,
+ :rev => 3,
+ :type => dt
+ }
assert_response :success
# Line 11 removed
assert_select 'th.line-num:contains(11) ~ td.diff_out', :text => /Display more information/
@@ -125,8 +148,10 @@ class RepositoriesBazaarControllerTest < Redmine::ControllerTest
end
def test_annotate
- get :annotate, :id => PRJ_ID,
+ get :annotate, :params => {
+ :id => PRJ_ID,
:path => repository_path_hash(['doc-mkdir.txt'])[:param]
+ }
assert_response :success
assert_select "th.line-num", :text => '2' do
@@ -147,8 +172,11 @@ class RepositoriesBazaarControllerTest < Redmine::ControllerTest
:identifier => 'author_escaping',
:log_encoding => 'UTF-8')
assert repository
- get :annotate, :id => PRJ_ID, :repository_id => 'author_escaping',
+ get :annotate, :params => {
+ :id => PRJ_ID,
+ :repository_id => 'author_escaping',
:path => repository_path_hash(['author-escaping-test.txt'])[:param]
+ }
assert_response :success
assert_select "th.line-num", :text => '1' do
@@ -175,8 +203,11 @@ class RepositoriesBazaarControllerTest < Redmine::ControllerTest
:identifier => 'author_non_ascii',
:log_encoding => log_encoding)
assert repository
- get :annotate, :id => PRJ_ID, :repository_id => 'author_non_ascii',
+ get :annotate, :params => {
+ :id => PRJ_ID,
+ :repository_id => 'author_non_ascii',
:path => repository_path_hash(['author-non-ascii-test.txt'])[:param]
+ }
assert_response :success
assert_select "th.line-num", :text => '1' do
@@ -198,7 +229,9 @@ class RepositoriesBazaarControllerTest < Redmine::ControllerTest
assert @repository.changesets.count > 0
assert_difference 'Repository.count', -1 do
- delete :destroy, :id => @repository.id
+ delete :destroy, :params => {
+ :id => @repository.id
+ }
end
assert_response 302
@project.reload
@@ -217,7 +250,9 @@ class RepositoriesBazaarControllerTest < Redmine::ControllerTest
assert_equal 0, @repository.changesets.count
assert_difference 'Repository.count', -1 do
- delete :destroy, :id => @repository.id
+ delete :destroy, :params => {
+ :id => @repository.id
+ }
end
assert_response 302
@project.reload