Correctly sends project ID

This commit is contained in:
Phil Hughes 2016-05-20 21:52:45 +01:00
parent 8536c49f19
commit 672bd4e6ff
3 changed files with 3 additions and 3 deletions

View File

@ -40,7 +40,7 @@ class AutocompleteController < ApplicationController
end end
no_project = OpenStruct.new(id: 0, name_with_namespace: 'No project') 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) projects.delete(project)
render json: projects.to_json(only: [:id, :name_with_namespace], methods: :name_with_namespace) render json: projects.to_json(only: [:id, :name_with_namespace], methods: :name_with_namespace)

View File

@ -90,7 +90,7 @@
= label_tag :move_to_project_id, 'Move', class: 'control-label' = label_tag :move_to_project_id, 'Move', class: 'control-label'
.col-sm-10 .col-sm-10
.issuable-form-select-holder .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; &nbsp;
%span{ data: { toggle: 'tooltip', placement: 'auto top' }, style: 'cursor: default', %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.' } 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.' }

View File

@ -47,7 +47,7 @@ feature 'issue move to another project' do
expect(page).to have_content(issue.title) expect(page).to have_content(issue.title)
end 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!(:private_project) { create(:project, :private) }
let(:another_project) { create(:project) } let(:another_project) { create(:project) }
background { another_project.team << [user, :guest] } background { another_project.team << [user, :guest] }