Fix project trasnfer for admin area
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
This commit is contained in:
parent
67934145e8
commit
f3369e3a00
3 changed files with 34 additions and 6 deletions
|
@ -23,13 +23,9 @@ class Admin::ProjectsController < Admin::ApplicationController
|
|||
end
|
||||
|
||||
def transfer
|
||||
result = ::Projects::TransferService.new(@project, current_user, project: params).execute(:admin)
|
||||
::Projects::TransferService.new(@project, current_user, params.dup).execute
|
||||
|
||||
if result
|
||||
redirect_to [:admin, @project]
|
||||
else
|
||||
render :show
|
||||
end
|
||||
redirect_to [:admin, @project.reload]
|
||||
end
|
||||
|
||||
protected
|
||||
|
|
|
@ -12,3 +12,9 @@ Feature: Admin Projects
|
|||
When I visit admin projects page
|
||||
And I click on first project
|
||||
Then I should see project details
|
||||
|
||||
Scenario: Transfer project
|
||||
Given group 'Web'
|
||||
And I visit admin project page
|
||||
When I transfer project to group 'Web'
|
||||
Then I should see project transfered
|
||||
|
|
|
@ -19,4 +19,30 @@ class AdminProjects < Spinach::FeatureSteps
|
|||
page.should have_content(project.name_with_namespace)
|
||||
page.should have_content(project.creator.name)
|
||||
end
|
||||
|
||||
step 'I visit admin project page' do
|
||||
visit admin_project_path(project)
|
||||
end
|
||||
|
||||
step 'I transfer project to group \'Web\'' do
|
||||
find(:xpath, "//input[@id='namespace_id']").set group.id
|
||||
click_button 'Transfer'
|
||||
end
|
||||
|
||||
step 'group \'Web\'' do
|
||||
create(:group, name: 'Web')
|
||||
end
|
||||
|
||||
step 'I should see project transfered' do
|
||||
page.should have_content 'Web / ' + project.name
|
||||
page.should have_content 'Namespace: Web'
|
||||
end
|
||||
|
||||
def project
|
||||
@project ||= Project.first
|
||||
end
|
||||
|
||||
def group
|
||||
Group.find_by(name: 'Web')
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue