Commit 4f47eaf9 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Merge branch 'fix-default-branch' into 'master'

Fix project default branch change

It is a regression since 7.0. It was caused with switch to `strong_params`.

This MR is safe to merge and it fixes issue https://gitlab.com/gitlab-org/gitlab-ce/issues/433

See merge request !984
parents c5678d4e af2a6ec1
......@@ -189,7 +189,7 @@ class ProjectsController < ApplicationController
def project_params
params.require(:project).permit(
:name, :path, :description, :issues_tracker, :label_list,
:issues_enabled, :merge_requests_enabled, :snippets_enabled, :issues_tracker_id,
:issues_enabled, :merge_requests_enabled, :snippets_enabled, :issues_tracker_id, :default_branch,
:wiki_enabled, :visibility_level, :import_url, :last_activity_at, :namespace_id
)
end
......
......@@ -29,3 +29,9 @@ Feature: Project Feature
When I visit project "Shop" page
Then I should see project "Shop" README link
And I should see project "Shop" version
Scenario: I should change project default branch
When I visit edit project "Shop" page
And change project default branch
And I save project
Then I should see project default branch changed
......@@ -36,4 +36,15 @@ class ProjectFeature < Spinach::FeatureSteps
page.should have_content "Version: 2.2.0"
end
end
step 'change project default branch' do
select 'stable', from: 'project_default_branch'
end
step 'I should see project default branch changed' do
# TODO: Uncomment this when we can do real gitlab-shell calls
# from spinach tests. Right now gitlab-shell calls are stubbed so this test
# will not pass
# find(:css, 'select#project_default_branch').value.should == 'stable'
end
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment