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
0
Merge Requests
0
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
Jérome Perrin
gitlab-ce
Commits
79248f4c
Commit
79248f4c
authored
Dec 18, 2013
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #5866 from jhollingsworth/fix/default-public-pull-url
Update default public pull url.
parents
dad576a7
1521f467
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
45 additions
and
10 deletions
+45
-10
app/helpers/projects_helper.rb
app/helpers/projects_helper.rb
+8
-0
app/views/projects/empty.html.haml
app/views/projects/empty.html.haml
+2
-2
app/views/shared/_clone_panel.html.haml
app/views/shared/_clone_panel.html.haml
+3
-3
features/public/public_projects.feature
features/public/public_projects.feature
+16
-3
features/steps/public/projects_feature.rb
features/steps/public/projects_feature.rb
+16
-2
No files found.
app/helpers/projects_helper.rb
View file @
79248f4c
...
...
@@ -179,4 +179,12 @@ module ProjectsHelper
title
end
def
default_url_to_repo
current_user
?
@project
.
url_to_repo
:
@project
.
http_url_to_repo
end
def
default_clone_protocol
current_user
?
"ssh"
:
"http"
end
end
app/views/projects/empty.html.haml
View file @
79248f4c
...
...
@@ -29,7 +29,7 @@
touch README
git add README
git commit -m 'first commit'
%span
.clone
=
"git remote add origin
#{
@project
.
url_to_repo
}
"
%span
.clone
=
"git remote add origin
#{
default_
url_to_repo
}
"
:preserve
git push -u origin master
...
...
@@ -38,7 +38,7 @@
%pre
.dark
:preserve
cd existing_git_repo
%span
.clone
=
"git remote add origin
#{
@project
.
url_to_repo
}
"
%span
.clone
=
"git remote add origin
#{
default_
url_to_repo
}
"
:preserve
git push -u origin master
...
...
app/views/shared/_clone_panel.html.haml
View file @
79248f4c
.git-clone-holder
%button
{
class:
"btn #{
current_user ? 'active' : '
' }"
,
:"data-clone"
=>
@project
.
ssh_url_to_repo
}
SSH
%button
{
class:
"btn #{
current_user ? '' : 'active
' }"
,
:"data-clone"
=>
@project
.
http_url_to_repo
}=
gitlab_config
.
protocol
.
upcase
=
text_field_tag
:project_clone
,
(
current_user
?
@project
.
url_to_repo
:
@project
.
http_url_to_repo
)
,
class:
"one_click_select span5"
,
readonly:
true
%button
{
class:
"btn #{
'active' if default_clone_protocol == 'ssh
' }"
,
:"data-clone"
=>
@project
.
ssh_url_to_repo
}
SSH
%button
{
class:
"btn #{
'active' if default_clone_protocol == 'http
' }"
,
:"data-clone"
=>
@project
.
http_url_to_repo
}=
gitlab_config
.
protocol
.
upcase
=
text_field_tag
:project_clone
,
default_url_to_repo
,
class:
"one_click_select span5"
,
readonly:
true
features/public/public_projects.feature
View file @
79248f4c
...
...
@@ -26,6 +26,14 @@ Feature: Public Projects Feature
Given
public empty project
"Empty Public Project"
When
I visit empty project page
Then
I should see empty public project details
And
I should see empty public project details with http clone info
Scenario
:
I
visit an empty public project page as user
Given
I sign in as a user
And
public empty project
"Empty Public Project"
When
I visit empty project page
Then
I should see empty public project details
And
I should see empty public project details with ssh clone info
Scenario
:
I
visit public area as user
Given
I sign in as a user
...
...
@@ -42,10 +50,15 @@ Feature: Public Projects Feature
Scenario
:
I
visit public project page
When
I visit project
"Community"
page
Then
I should see project
"Community"
home page
And
I should see a http link to the repository
And
I should see a
n
http link to the repository
Scenario
:
I
visit public
area
as user
Scenario
:
I
visit public
project page
as user
Given
I sign in as a user
When
I visit project
"Community"
page
Then
I should see project
"Community"
home page
And
I should see a ssh link to the repository
And
I should see an ssh link to the repository
Scenario
:
I
visit an empty public project page
Given
public empty project
"Empty Public Project"
When
I visit empty project page
Then
I should see empty public project details
features/steps/public/projects_feature.rb
View file @
79248f4c
...
...
@@ -46,6 +46,20 @@ class Spinach::Features::PublicProjectsFeature < Spinach::FeatureSteps
page
.
should
have_content
'Git global setup'
end
step
'I should see empty public project details with http clone info'
do
project
=
Project
.
find_by_name
(
'Empty Public Project'
)
page
.
all
(
:css
,
'.git-empty .clone'
).
each
do
|
element
|
element
.
text
.
should
include
(
project
.
http_url_to_repo
)
end
end
step
'I should see empty public project details with ssh clone info'
do
project
=
Project
.
find_by_name
(
'Empty Public Project'
)
page
.
all
(
:css
,
'.git-empty .clone'
).
each
do
|
element
|
element
.
text
.
should
include
(
project
.
url_to_repo
)
end
end
step
'private project "Enterprise"'
do
create
:project
,
name:
'Enterprise'
end
...
...
@@ -84,12 +98,12 @@ class Spinach::Features::PublicProjectsFeature < Spinach::FeatureSteps
end
end
Then
'I should see a
http link to the repository'
do
step
'I should see an
http link to the repository'
do
project
=
Project
.
find_by_name
'Community'
page
.
should
have_field
(
'project_clone'
,
with:
project
.
http_url_to_repo
)
end
Then
'I should see a
ssh link to the repository'
do
step
'I should see an
ssh link to the repository'
do
project
=
Project
.
find_by_name
'Community'
page
.
should
have_field
(
'project_clone'
,
with:
project
.
url_to_repo
)
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