Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
029b5c04
Commit
029b5c04
authored
May 02, 2016
by
Robert Speicher
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add "Developer views empty project instructions" feature spec
This removes several Spinach features and step definitions
parent
4485f376
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
84 additions
and
100 deletions
+84
-100
features/project/create.feature
features/project/create.feature
+2
-42
features/steps/project/create.rb
features/steps/project/create.rb
+0
-55
spec/factories/projects.rb
spec/factories/projects.rb
+7
-3
spec/features/projects/developer_views_empty_project_instructions_spec.rb
...ojects/developer_views_empty_project_instructions_spec.rb
+75
-0
No files found.
features/project/create.feature
View file @
029b5c04
...
...
@@ -5,50 +5,10 @@ Feature: Project Create
Should be able to create a new one
@javascript
Scenario
:
User create a project
with Kerberos disabled
Scenario
:
User create a project
Given
I sign in as a user
And
KRB5 disabled
When
I visit new project page
And
I have an ssh key
And
fill project form with valid data
Then
I should see project page
And
I should see empty project instructions
@javascript
Scenario
:
User create a project with Kerberos enabled
Given
I sign in as a user
And
KRB5 enabled
When
I visit new project page
And
I have an ssh key
And
fill project form with valid data
Then
I should see project page
And
I should see empty project instructions with Kerberos as default url
@javascript
Scenario
:
Empty project instructions with Kerberos disabled
Given
I sign in as a user
And
KRB5 disabled
And
I have an ssh key
When
I visit new project page
And
fill project form with valid data
Then
I see empty project instructions
And
I click on HTTP
Then
Remote url should update to http link
And
If I click on SSH
Then
Remote url should update to ssh link
@javascript
Scenario
:
Empty project instructions with Kerberos enabled
Given
I sign in as a user
Given
KRB5 enabled
And
I have an ssh key
When
I visit new project page
And
fill project form with valid data
Then
I see empty project instructions with Kerberos as default url
And
I click on HTTP
Then
Remote url should update to http link
And
If I click on SSH
Then
Remote url should update to ssh link
And
If I click on KRB5
Then
Remote url should update to kerberos link
And
KRB5 disabled
And
I should see empty project instructions
features/steps/project/create.rb
View file @
029b5c04
...
...
@@ -18,59 +18,4 @@ class Spinach::Features::ProjectCreate < Spinach::FeatureSteps
expect
(
page
).
to
have_content
"git remote"
expect
(
page
).
to
have_content
Project
.
last
.
url_to_repo
end
step
'I should see empty project instructions with Kerberos as default url'
do
expect
(
page
).
to
have_content
"git init"
expect
(
page
).
to
have_content
"git remote"
expect
(
page
).
to
have_content
Project
.
last
.
kerberos_url_to_repo
end
step
'KRB5 enabled'
do
# Enable Kerberos in an alternative port to force Kerberos button and URL to show up in the UI
allow
(
Gitlab
.
config
.
kerberos
).
to
receive
(
:enabled
).
and_return
(
true
)
allow
(
Gitlab
.
config
.
kerberos
).
to
receive
(
:use_dedicated_port
).
and_return
(
true
)
end
step
'KRB5 disabled'
do
allow
(
Gitlab
.
config
.
kerberos
).
to
receive
(
:enabled
).
and_return
(
false
)
end
step
'I see empty project instructions'
do
expect
(
page
).
to
have_content
"git init"
expect
(
page
).
to
have_content
"git remote"
expect
(
page
).
to
have_content
Project
.
last
.
url_to_repo
end
step
'I see empty project instructions with Kerberos as default url'
do
expect
(
page
).
to
have_content
"git init"
expect
(
page
).
to
have_content
"git remote"
expect
(
page
).
to
have_content
Project
.
last
.
kerberos_url_to_repo
end
step
'I click on HTTP'
do
find
(
'#clone-dropdown'
).
click
find
(
'.http-selector'
).
click
end
step
'Remote url should update to http link'
do
expect
(
page
).
to
have_content
"git remote add origin
#{
Project
.
last
.
http_url_to_repo
}
"
end
step
'If I click on SSH'
do
find
(
'#clone-dropdown'
).
click
find
(
'.ssh-selector'
).
click
end
step
'Remote url should update to ssh link'
do
expect
(
page
).
to
have_content
"git remote add origin
#{
Project
.
last
.
url_to_repo
}
"
end
step
'If I click on KRB5'
do
find
(
'#clone-dropdown'
).
click
find
(
'.kerberos-selector'
).
click
end
step
'Remote url should update to kerberos link'
do
expect
(
page
).
to
have_content
"git remote add origin
#{
Project
.
last
.
kerberos_url_to_repo
}
"
end
end
spec/factories/projects.rb
View file @
029b5c04
...
...
@@ -92,6 +92,12 @@ FactoryGirl.define do
mirror
true
mirror_user_id
{
creator_id
}
end
trait
:empty_repo
do
after
(
:create
)
do
|
project
|
project
.
create_repository
end
end
end
# Project with empty repository
...
...
@@ -99,9 +105,7 @@ FactoryGirl.define do
# This is a case when you just created a project
# but not pushed any code there yet
factory
:project_empty_repo
,
parent: :empty_project
do
after
:create
do
|
project
|
project
.
create_repository
end
empty_repo
end
# Project with test repository
...
...
spec/features/projects/developer_views_empty_project_instructions_spec.rb
0 → 100644
View file @
029b5c04
require
'rails_helper'
feature
'Developer views empty project instructions'
,
feature:
true
do
let
(
:project
)
{
create
(
:empty_project
,
:empty_repo
)
}
let
(
:developer
)
{
create
(
:user
)
}
background
do
project
.
team
<<
[
developer
,
:developer
]
login_as
(
developer
)
end
context
'without an SSH key'
do
scenario
'defaults to HTTP'
do
visit_project
expect_instructions_for
(
'http'
)
end
scenario
'switches to SSH'
,
js:
true
do
visit_project
select_protocol
(
'SSH'
)
expect_instructions_for
(
'ssh'
)
end
end
context
'with an SSH key'
do
background
do
create
(
:personal_key
,
user:
developer
)
end
scenario
'defaults to SSH'
do
visit_project
expect_instructions_for
(
'ssh'
)
end
scenario
'switches to HTTP'
,
js:
true
do
visit_project
select_protocol
(
'HTTP'
)
expect_instructions_for
(
'http'
)
end
end
context
'with Kerberos enabled'
do
background
do
allow
(
Gitlab
.
config
.
kerberos
).
to
receive
(
:enabled
).
and_return
(
true
)
end
scenario
'defaults to KRB5'
do
visit_project
expect_instructions_for
(
'kerberos'
)
end
end
def
visit_project
visit
namespace_project_path
(
project
.
namespace
,
project
)
end
def
select_protocol
(
protocol
)
find
(
'#clone-dropdown'
).
click
find
(
".
#{
protocol
.
downcase
}
-selector"
).
click
end
def
expect_instructions_for
(
protocol
)
msg
=
:"
#{
protocol
.
downcase
}
_url_to_repo"
expect
(
page
).
to
have_content
(
"git clone
#{
project
.
send
(
msg
)
}
"
)
end
end
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