BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
f57bffc8
Commit
f57bffc8
authored
Jan 27, 2015
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'init-from-ui' into 'master'
Add tests for creating bare repo and first file in UI Part of #1930 See merge request !1444
parents
fc17b440
e956066d
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
29 additions
and
1 deletion
+29
-1
empty.html.haml
app/views/projects/empty.html.haml
+1
-1
browse_files.feature
features/project/source/browse_files.feature
+13
-0
browse_files.rb
features/steps/project/source/browse_files.rb
+11
-0
project.rb
features/steps/shared/project.rb
+4
-0
No files found.
app/views/projects/empty.html.haml
View file @
f57bffc8
...
...
@@ -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
...
...
features/project/source/browse_files.feature
View file @
f57bffc8
...
...
@@ -35,6 +35,19 @@ Feature: Project Source Browse Files
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
And
I fill the new file name with an illegal name
...
...
features/steps/project/source/browse_files.rb
View file @
f57bffc8
...
...
@@ -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
...
...
features/steps/shared/project.rb
View file @
f57bffc8
...
...
@@ -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"
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment