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
Tatuya Kamada
gitlab-ce
Commits
91e01275
Commit
91e01275
authored
Jul 09, 2014
by
Marin Jankovski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add tests to check for correct browse link name.
parent
6b121aa5
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
45 additions
and
6 deletions
+45
-6
app/helpers/commits_helper.rb
app/helpers/commits_helper.rb
+4
-5
features/project/source/browse_files.feature
features/project/source/browse_files.feature
+13
-1
features/steps/project/browse_files.rb
features/steps/project/browse_files.rb
+28
-0
No files found.
app/helpers/commits_helper.rb
View file @
91e01275
...
...
@@ -183,13 +183,12 @@ module CommitsHelper
def
link_to_browse_code
(
project
,
commit
)
if
current_controller?
(
:projects
,
:commits
)
if
@repo
.
blob_at
(
commit
.
id
,
@path
)
link_to
"Browse File »"
,
project_blob_path
(
project
,
tree_join
(
commit
.
id
,
@path
)),
class:
"pull-right"
els
e
link_to
"Browse Dir »"
,
project_tree_path
(
project
,
tree_join
(
commit
.
id
,
@path
)),
class:
"pull-right"
return
link_to
"Browse File »"
,
project_blob_path
(
project
,
tree_join
(
commit
.
id
,
@path
)),
class:
"pull-right"
els
if
@path
.
present?
return
link_to
"Browse Dir »"
,
project_tree_path
(
project
,
tree_join
(
commit
.
id
,
@path
)),
class:
"pull-right"
end
else
link_to
"Browse Code »"
,
project_tree_path
(
project
,
commit
),
class:
"pull-right"
end
link_to
"Browse Code »"
,
project_tree_path
(
project
,
commit
),
class:
"pull-right"
end
protected
...
...
features/project/source/browse_files.feature
View file @
91e01275
...
...
@@ -38,4 +38,16 @@ Feature: Project Browse files
And
I click link
"Diff"
Then
I see diff
Scenario
:
I
can browse directory with Browse Dir
Given
I click on app directory
And
I click on history link
Then
I see Browse dir link
Scenario
:
I
can browse file with Browse File
Given
I click on readme file
And
I click on history link
Then
I see Browse file link
Scenario
:
I
can browse code with Browse Code
Given
I click on history link
Then
I see Browse code link
features/steps/project/browse_files.rb
View file @
91e01275
...
...
@@ -62,4 +62,32 @@ class ProjectBrowseFiles < Spinach::FeatureSteps
page
.
should
have_content
"File name"
page
.
should
have_content
"Commit message"
end
step
'I click on app directory'
do
click_link
'app'
end
step
'I click on history link'
do
click_link
'history'
end
step
'I see Browse dir link'
do
page
.
should
have_link
'Browse Dir »'
page
.
should_not
have_link
'Browse Code »'
end
step
'I click on readme file'
do
click_link
'README.md'
end
step
'I see Browse file link'
do
page
.
should
have_link
'Browse File »'
page
.
should_not
have_link
'Browse Code »'
end
step
'I see Browse code link'
do
page
.
should
have_link
'Browse Code »'
page
.
should_not
have_link
'Browse File »'
page
.
should_not
have_link
'Browse Dir »'
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