Merge branch 'issue_on_empty_repo' into 'master'
Fix for error 500 on create issue for empty repo
This commit is contained in:
commit
71678f08f8
|
@ -1,7 +1,7 @@
|
||||||
%div.issue-form-holder
|
%div.issue-form-holder
|
||||||
%h3.page-title= @issue.new_record? ? "New Issue" : "Edit Issue ##{@issue.iid}"
|
%h3.page-title= @issue.new_record? ? "New Issue" : "Edit Issue ##{@issue.iid}"
|
||||||
%hr
|
%hr
|
||||||
- if !@repository.empty? && @repository.contribution_guide && !@issue.persisted?
|
- if @repository.exists? && !@repository.empty? && @repository.contribution_guide && !@issue.persisted?
|
||||||
- contribution_guide_url = project_blob_path(@project, tree_join(@repository.root_ref, @repository.contribution_guide.name))
|
- contribution_guide_url = project_blob_path(@project, tree_join(@repository.root_ref, @repository.contribution_guide.name))
|
||||||
.alert.alert-info.col-sm-10.col-sm-offset-2
|
.alert.alert-info.col-sm-10.col-sm-offset-2
|
||||||
="Please review the <strong>#{link_to "guidelines for contribution", contribution_guide_url}</strong> to this repository.".html_safe
|
="Please review the <strong>#{link_to "guidelines for contribution", contribution_guide_url}</strong> to this repository.".html_safe
|
||||||
|
|
|
@ -67,3 +67,12 @@ Feature: Project Issues
|
||||||
Given I visit issue page "Release 0.4"
|
Given I visit issue page "Release 0.4"
|
||||||
And I leave a comment with a header containing "Comment with a header"
|
And I leave a comment with a header containing "Comment with a header"
|
||||||
Then The comment with the header should not have an ID
|
Then The comment with the header should not have an ID
|
||||||
|
|
||||||
|
Scenario: Issues on empty project
|
||||||
|
Given empty project "Empty Project"
|
||||||
|
When I visit empty project page
|
||||||
|
And I see empty project details with ssh clone info
|
||||||
|
When I visit empty project's issues page
|
||||||
|
Given I click link "New Issue"
|
||||||
|
And I submit new issue "500 error on profile"
|
||||||
|
Then I should see issue "500 error on profile"
|
||||||
|
|
|
@ -142,4 +142,25 @@ class ProjectIssues < Spinach::FeatureSteps
|
||||||
project: project,
|
project: project,
|
||||||
author: project.users.first)
|
author: project.users.first)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Given 'empty project "Empty Project"' do
|
||||||
|
create :empty_project, name: 'Empty Project', namespace: @user.namespace
|
||||||
|
end
|
||||||
|
|
||||||
|
When 'I visit empty project page' do
|
||||||
|
project = Project.find_by(name: 'Empty Project')
|
||||||
|
visit project_path(project)
|
||||||
|
end
|
||||||
|
|
||||||
|
And 'I see empty project details with ssh clone info' do
|
||||||
|
project = Project.find_by(name: 'Empty Project')
|
||||||
|
page.all(:css, '.git-empty .clone').each do |element|
|
||||||
|
element.text.should include(project.url_to_repo)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
When "I visit empty project's issues page" do
|
||||||
|
project = Project.find_by(name: 'Empty Project')
|
||||||
|
visit project_issues_path(project)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue