From 639cf728f8c14560e85e0f54d5f4f27329d98c3c Mon Sep 17 00:00:00 2001 From: Kamil Trzcinski Date: Tue, 23 Feb 2016 12:03:03 +0100 Subject: [PATCH] Fix adding pages domain to projects in groups --- app/views/projects/pages_domains/_form.html.haml | 2 +- features/project/pages.feature | 9 +++++++++ features/steps/shared/project.rb | 6 ++++++ 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/app/views/projects/pages_domains/_form.html.haml b/app/views/projects/pages_domains/_form.html.haml index e97d19653d5..ca1b41b140a 100644 --- a/app/views/projects/pages_domains/_form.html.haml +++ b/app/views/projects/pages_domains/_form.html.haml @@ -1,4 +1,4 @@ -= form_for [@project.namespace, @project, @domain], html: { class: 'form-horizontal fieldset-form' } do |f| += form_for [@project.namespace.becomes(Namespace), @project, @domain], html: { class: 'form-horizontal fieldset-form' } do |f| - if @domain.errors.any? #error_explanation .alert.alert-danger diff --git a/features/project/pages.feature b/features/project/pages.feature index 392f2d29c3c..87d88348d09 100644 --- a/features/project/pages.feature +++ b/features/project/pages.feature @@ -40,6 +40,15 @@ Feature: Project Pages And I click on "Create New Domain" Then I should see a new domain added + Scenario: I should be able to add a new domain for project in group namespace + Given I own a project in some group namespace + And pages are enabled + And pages are exposed on external HTTP address + When I visit add a new Pages Domain + And I fill the domain + And I click on "Create New Domain" + Then I should see a new domain added + Scenario: I should be denied to add the same domain twice Given pages are enabled And pages are exposed on external HTTP address diff --git a/features/steps/shared/project.rb b/features/steps/shared/project.rb index 7a6707a7dfb..dae248b8b7e 100644 --- a/features/steps/shared/project.rb +++ b/features/steps/shared/project.rb @@ -7,6 +7,12 @@ module SharedProject @project.team << [@user, :master] end + step "I own a project in some group namespace" do + @group = create(:group, name: 'some group') + @project = create(:project, namespace: @group) + @project.team << [@user, :master] + end + step "project exists in some group namespace" do @group = create(:group, name: 'some group') @project = create(:project, :repository, namespace: @group, public_builds: false)