summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhil Hughes <me@iamphill.com>2016-05-20 21:52:45 +0100
committerPhil Hughes <me@iamphill.com>2016-05-20 21:52:45 +0100
commit672bd4e6ff52da0acad0a5838324ba0039ed484c (patch)
tree4bcdc9b27ddb57027d638e62060af162d4a29d61
parent8536c49f1958b08a6dc556f0cf9abd166f821669 (diff)
downloadgitlab-ce-672bd4e6ff52da0acad0a5838324ba0039ed484c.tar.gz
Correctly sends project ID
-rw-r--r--app/controllers/autocomplete_controller.rb2
-rw-r--r--app/views/shared/issuable/_form.html.haml2
-rw-r--r--spec/features/issues/move_spec.rb2
3 files changed, 3 insertions, 3 deletions
diff --git a/app/controllers/autocomplete_controller.rb b/app/controllers/autocomplete_controller.rb
index 155c78bcd8a..61e92c1a805 100644
--- a/app/controllers/autocomplete_controller.rb
+++ b/app/controllers/autocomplete_controller.rb
@@ -40,7 +40,7 @@ class AutocompleteController < ApplicationController
end
no_project = OpenStruct.new(id: 0, name_with_namespace: 'No project')
- projects.unshift(no_project.marshal_dump)
+ projects.unshift(no_project.to_h)
projects.delete(project)
render json: projects.to_json(only: [:id, :name_with_namespace], methods: :name_with_namespace)
diff --git a/app/views/shared/issuable/_form.html.haml b/app/views/shared/issuable/_form.html.haml
index c014332d7f3..ff5224d7df8 100644
--- a/app/views/shared/issuable/_form.html.haml
+++ b/app/views/shared/issuable/_form.html.haml
@@ -90,7 +90,7 @@
= label_tag :move_to_project_id, 'Move', class: 'control-label'
.col-sm-10
.issuable-form-select-holder
- = hidden_field_tag :move_to_project_id, nil, class: 'js-move-dropdown', data: { placeholder: 'Select project', projects_url: autocomplete_projects_path(project_id: '1') }
+ = hidden_field_tag :move_to_project_id, nil, class: 'js-move-dropdown', data: { placeholder: 'Select project', projects_url: autocomplete_projects_path(project_id: @project.id) }
&nbsp;
%span{ data: { toggle: 'tooltip', placement: 'auto top' }, style: 'cursor: default',
title: 'Moving an issue will copy the discussion to a different project and close it here. All participants will be notified of the new location.' }
diff --git a/spec/features/issues/move_spec.rb b/spec/features/issues/move_spec.rb
index 307ecc6fcaf..c7019c5aea1 100644
--- a/spec/features/issues/move_spec.rb
+++ b/spec/features/issues/move_spec.rb
@@ -47,7 +47,7 @@ feature 'issue move to another project' do
expect(page).to have_content(issue.title)
end
- context 'projects user does not have permission to move issue to exist', js: true do
+ context 'user does not have permission to move the issue to a project', js: true do
let!(:private_project) { create(:project, :private) }
let(:another_project) { create(:project) }
background { another_project.team << [user, :guest] }