From b8b8a34b524fc38c194973d298ca24a0769c27a6 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Mon, 23 Dec 2013 13:19:13 +0200 Subject: [PATCH] Fix 500 error when rename repository Signed-off-by: Dmitriy Zaporozhets --- app/contexts/projects/update_context.rb | 2 +- features/project/project.feature | 5 +++++ features/steps/project/project.rb | 15 ++++++++++++--- 3 files changed, 18 insertions(+), 4 deletions(-) diff --git a/app/contexts/projects/update_context.rb b/app/contexts/projects/update_context.rb index ed0d451a31a..94de10de0f6 100644 --- a/app/contexts/projects/update_context.rb +++ b/app/contexts/projects/update_context.rb @@ -9,7 +9,7 @@ module Projects new_branch = params[:project].delete(:default_branch) - if project.repository.exists? && new_branch != project.default_branch + if project.repository.exists? && new_branch && new_branch != project.default_branch project.change_head(new_branch) end diff --git a/features/project/project.feature b/features/project/project.feature index 59eda4a781d..d8bb1d55e2d 100644 --- a/features/project/project.feature +++ b/features/project/project.feature @@ -19,3 +19,8 @@ Feature: Project Feature And change project settings And I save project Then I should see project with new settings + + Scenario: I change project path + When I visit edit project "Shop" page + And change project path settings + Then I should see project with new path settings diff --git a/features/steps/project/project.rb b/features/steps/project/project.rb index a96b086fae5..92728d474b2 100644 --- a/features/steps/project/project.rb +++ b/features/steps/project/project.rb @@ -3,16 +3,25 @@ class ProjectFeature < Spinach::FeatureSteps include SharedProject include SharedPaths - And 'change project settings' do + step 'change project settings' do fill_in 'project_name', with: 'NewName' uncheck 'project_issues_enabled' end - And 'I save project' do + step 'I save project' do click_button 'Save changes' end - Then 'I should see project with new settings' do + step 'I should see project with new settings' do find_field('project_name').value.should == 'NewName' end + + step 'change project path settings' do + fill_in "project_path", with: "new-path" + click_button "Rename" + end + + step 'I should see project with new path settings' do + project.path.should == "new-path" + end end