Log In
Log In
Places
All Projects
Status Monitor
Collapse sidebar
obs:server:fedora:2.7
obs-server
obs-server-2.7.1-0019-api-Use-File.join-to-join...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File obs-server-2.7.1-0019-api-Use-File.join-to-join-root_path-with-URL-rest-in.patch of Package obs-server
From 8aa3b5ef054a415ac03401bcf46100325a8dd59c Mon Sep 17 00:00:00 2001 From: Oleg Girko <ol@infoserver.lv> Date: Mon, 4 Jul 2016 21:10:00 +0100 Subject: [PATCH 19/29] [api] Use File.join to join root_path with URL rest in API tests. Using + operator to join root_path and rest of URL starting with '/' leads to a string that starts with '//' if root_path is '/'. This is undesirable because part of URL following leading '//' can be interpreted as server name, not path component. Using File.join is much safer because it produces correct path without double slashes. Signed-off-by: Oleg Girko <ol@infoserver.lv> --- src/api/test/functional/webui/package_controller_test.rb | 6 +++--- src/api/test/functional/webui/search_controller_test.rb | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/api/test/functional/webui/package_controller_test.rb b/src/api/test/functional/webui/package_controller_test.rb index f13aebc..56b0c2f 100644 --- a/src/api/test/functional/webui/package_controller_test.rb +++ b/src/api/test/functional/webui/package_controller_test.rb @@ -153,7 +153,7 @@ class Webui::PackageControllerTest < Webui::IntegrationTest def test_succesful_comment_creation use_js login_Iggy - visit root_path + '/package/show/home:Iggy/TestPack' + visit File.join(root_path, 'package/show/home:Iggy/TestPack') # rubocop:disable Metrics/LineLength fill_comment "Write some http://link.com\n\nand some other\n\n* Markdown\n* markup\n\nReferencing sr#23, bco#24, fate#25, @_nobody_, @a-dashed-user and @Iggy. https://anotherlink.com" # rubocop:enable Metrics/LineLength @@ -175,7 +175,7 @@ class Webui::PackageControllerTest < Webui::IntegrationTest def test_another_succesful_comment_creation use_js login_Iggy - visit root_path + '/package/show?project=home:Iggy&package=TestPack' + visit File.join(root_path, 'package/show?project=home:Iggy&package=TestPack') # @Iggy works at the very beginning and requests are case insensitive fill_comment "@Iggy likes to mention himself and to write request#23 with capital 'R', like Request#23." within('div.thread_level_0') do @@ -194,7 +194,7 @@ class Webui::PackageControllerTest < Webui::IntegrationTest def test_succesful_reply_comment_creation use_js login_Iggy - visit root_path + '/package/show/BaseDistro3/pack2' + visit File.join(root_path, 'package/show/BaseDistro3/pack2') find(:id, 'reply_link_id_201').click fill_in 'reply_body_201', with: 'Comment Body' diff --git a/src/api/test/functional/webui/search_controller_test.rb b/src/api/test/functional/webui/search_controller_test.rb index a462218..fa3766d 100644 --- a/src/api/test/functional/webui/search_controller_test.rb +++ b/src/api/test/functional/webui/search_controller_test.rb @@ -88,13 +88,13 @@ class Webui::SearchControllerTest < Webui::IntegrationTest visit search_path validate_search_page - visit root_path + '/search?search_text=basedistro' + visit File.join(root_path, 'search?search_text=basedistro') page.must_have_text(/Base.* contains official released updates/) - visit root_path + '/search?search_text=basedistro3' + visit File.join(root_path, 'search?search_text=basedistro3') page.must_have_text(/Base.* distro without update project/) - visit root_path + '/search?search_text=kdebase' + visit File.join(root_path, 'search?search_text=kdebase') page.must_have_link 'kdebase' end -- 2.7.4
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Contact
Support
@OBShq
The Open Build Service is an
openSUSE project
.
Log In
Places
Places
All Projects
Status Monitor