Commit 52afe463 authored by Sean McGivern's avatar Sean McGivern

Only escape the 'No Milestone' param

This is less invasive than the parent commit.
parent b0ae433e
...@@ -50,6 +50,8 @@ describe API::Issues, api: true do ...@@ -50,6 +50,8 @@ describe API::Issues, api: true do
end end
let!(:note) { create(:note_on_issue, author: user, project: project, noteable: issue) } let!(:note) { create(:note_on_issue, author: user, project: project, noteable: issue) }
let(:no_milestone_title) { URI.escape(Milestone::None.title) }
before do before do
project.team << [user, :reporter] project.team << [user, :reporter]
project.team << [guest, :guest] project.team << [guest, :guest]
...@@ -174,7 +176,7 @@ describe API::Issues, api: true do ...@@ -174,7 +176,7 @@ describe API::Issues, api: true do
end end
it 'returns an array of issues with no milestone' do it 'returns an array of issues with no milestone' do
get api("/issues?milestone=#{Milestone::None.title}", author) get api("/issues?milestone=#{no_milestone_title}", author)
expect(response).to have_http_status(200) expect(response).to have_http_status(200)
expect(json_response).to be_an Array expect(json_response).to be_an Array
...@@ -365,7 +367,7 @@ describe API::Issues, api: true do ...@@ -365,7 +367,7 @@ describe API::Issues, api: true do
end end
it 'returns an array of issues with no milestone' do it 'returns an array of issues with no milestone' do
get api("#{base_url}?milestone=#{Milestone::None.title}", user) get api("#{base_url}?milestone=#{no_milestone_title}", user)
expect(response).to have_http_status(200) expect(response).to have_http_status(200)
expect(json_response).to be_an Array expect(json_response).to be_an Array
...@@ -537,7 +539,7 @@ describe API::Issues, api: true do ...@@ -537,7 +539,7 @@ describe API::Issues, api: true do
end end
it 'returns an array of issues with no milestone' do it 'returns an array of issues with no milestone' do
get api("#{base_url}/issues?milestone=#{Milestone::None.title}", user) get api("#{base_url}/issues?milestone=#{no_milestone_title}", user)
expect(response).to have_http_status(200) expect(response).to have_http_status(200)
expect(json_response).to be_an Array expect(json_response).to be_an Array
......
...@@ -18,7 +18,7 @@ module ApiHelpers ...@@ -18,7 +18,7 @@ module ApiHelpers
# #
# Returns the relative path to the requested API resource # Returns the relative path to the requested API resource
def api(path, user = nil) def api(path, user = nil)
"/api/#{API::API.version}#{URI.escape(path)}" + "/api/#{API::API.version}#{path}" +
# Normalize query string # Normalize query string
(path.index('?') ? '' : '?') + (path.index('?') ? '' : '?') +
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment