diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2014-06-19 14:20:42 +0400 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2014-06-19 14:20:42 +0400 |
commit | f3369e3a004ad01176b9191e2cb494866f91b637 (patch) | |
tree | e3b64871fbb73e7289af13ef6b9b2aa00e199e93 | |
parent | 67934145e88e439c4266d6a4f19372f170fc6095 (diff) |
Fix project trasnfer for admin area
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
-rw-r--r-- | app/controllers/admin/projects_controller.rb | 8 | ||||
-rw-r--r-- | features/admin/projects.feature | 6 | ||||
-rw-r--r-- | features/steps/admin/projects.rb | 26 |
3 files changed, 34 insertions, 6 deletions
diff --git a/app/controllers/admin/projects_controller.rb b/app/controllers/admin/projects_controller.rb index d2f86369b58..1c7c09d0cd4 100644 --- a/app/controllers/admin/projects_controller.rb +++ b/app/controllers/admin/projects_controller.rb @@ -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 diff --git a/features/admin/projects.feature b/features/admin/projects.feature index fb07ccdb352..a6c3d6b7822 100644 --- a/features/admin/projects.feature +++ b/features/admin/projects.feature @@ -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 diff --git a/features/steps/admin/projects.rb b/features/steps/admin/projects.rb index b410b23851b..992aa46a8bc 100644 --- a/features/steps/admin/projects.rb +++ b/features/steps/admin/projects.rb @@ -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 |