From 2fa36ddd9c9efcc4f0d40755f535867573a0483c Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Tue, 27 Jan 2015 11:32:28 -0800 Subject: Replace p with h4 for empty repo text --- app/views/projects/empty.html.haml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/projects/empty.html.haml b/app/views/projects/empty.html.haml index 776a7327bc2..36628195b4e 100644 --- a/app/views/projects/empty.html.haml +++ b/app/views/projects/empty.html.haml @@ -6,7 +6,7 @@ .center.well %h3 The repository for this project is empty - %p.lead + %h4 You can = link_to project_new_blob_path(@project, 'master'), class: 'btn btn-new btn-lg' do add a file -- cgit v1.2.1 From e956066d4a9c3f556a52f80acfb5c761aede7c6c Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Tue, 27 Jan 2015 12:19:32 -0800 Subject: Add tests for initializing bare repo and creating new file in it --- features/project/source/browse_files.feature | 13 +++++++++++++ features/steps/project/source/browse_files.rb | 11 +++++++++++ features/steps/shared/project.rb | 4 ++++ 3 files changed, 28 insertions(+) diff --git a/features/project/source/browse_files.feature b/features/project/source/browse_files.feature index 6ea64f70092..ccb29293a89 100644 --- a/features/project/source/browse_files.feature +++ b/features/project/source/browse_files.feature @@ -34,6 +34,19 @@ Feature: Project Source Browse Files Then I am redirected to the new file And I should see its new content + @javascript + Scenario: I can create file in empty repo + Given I own an empty project + And I visit my empty project page + And I create bare repo + When I click on "add a file" link + And I edit code + And I fill the new file name + And I fill the commit message + And I click on "Commit Changes" + Then I am redirected to the new file + And I should see its new content + @javascript Scenario: If I enter an illegal file name I see an error message Given I click on "new file" link in repo diff --git a/features/steps/project/source/browse_files.rb b/features/steps/project/source/browse_files.rb index bd1ca55a20a..770e8162497 100644 --- a/features/steps/project/source/browse_files.rb +++ b/features/steps/project/source/browse_files.rb @@ -166,6 +166,17 @@ class Spinach::Features::ProjectSourceBrowseFiles < Spinach::FeatureSteps expect(page).to have_content('Your changes could not be committed') end + step 'I create bare repo' do + click_link 'Create empty bare repository' + end + + step 'I click on "add a file" link' do + click_link 'add a file' + + # Remove pre-receive hook so we can push without auth + FileUtils.rm(File.join(Project.last.repository.path, 'hooks', 'pre-receive')) + end + private def set_new_content diff --git a/features/steps/shared/project.rb b/features/steps/shared/project.rb index 0bd5653538c..cf0be256231 100644 --- a/features/steps/shared/project.rb +++ b/features/steps/shared/project.rb @@ -28,6 +28,10 @@ module SharedProject @project.team << [@user, :master] end + step 'I visit my empty project page' do + visit project_path(Project.find_by(name: 'Empty Project')) + end + step 'project "Shop" has push event' do @project = Project.find_by(name: "Shop") -- cgit v1.2.1