Commit cc51931d1f4a205de412ed8dfca98b832f4c5c91

Authored by Dmitriy Zaporozhets
1 parent 5582ae14

Fix 500 error when rename repository

Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
app/contexts/projects/update_context.rb
... ... @@ -9,7 +9,7 @@ module Projects
9 9  
10 10 new_branch = params[:project].delete(:default_branch)
11 11  
12   - if project.repository.exists? && new_branch != project.default_branch
  12 + if project.repository.exists? && new_branch && new_branch != project.default_branch
13 13 project.change_head(new_branch)
14 14 end
15 15  
... ...
features/project/project.feature
... ... @@ -19,3 +19,8 @@ Feature: Project Feature
19 19 And change project settings
20 20 And I save project
21 21 Then I should see project with new settings
  22 +
  23 + Scenario: I change project path
  24 + When I visit edit project "Shop" page
  25 + And change project path settings
  26 + Then I should see project with new path settings
... ...
features/steps/project/project.rb
... ... @@ -3,16 +3,25 @@ class ProjectFeature &lt; Spinach::FeatureSteps
3 3 include SharedProject
4 4 include SharedPaths
5 5  
6   - And 'change project settings' do
  6 + step 'change project settings' do
7 7 fill_in 'project_name', with: 'NewName'
8 8 uncheck 'project_issues_enabled'
9 9 end
10 10  
11   - And 'I save project' do
  11 + step 'I save project' do
12 12 click_button 'Save changes'
13 13 end
14 14  
15   - Then 'I should see project with new settings' do
  15 + step 'I should see project with new settings' do
16 16 find_field('project_name').value.should == 'NewName'
17 17 end
  18 +
  19 + step 'change project path settings' do
  20 + fill_in "project_path", with: "new-path"
  21 + click_button "Rename"
  22 + end
  23 +
  24 + step 'I should see project with new path settings' do
  25 + project.path.should == "new-path"
  26 + end
18 27 end
... ...