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
Léo-Paul Géneau
gitlab-ce
Commits
6c80b597
Commit
6c80b597
authored
Jul 13, 2016
by
Lin Jen-Shin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Introduce path_from_ref and save some typing
parent
bb5f0671
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
18 deletions
+8
-18
spec/requests/projects/artifacts_controller_spec.rb
spec/requests/projects/artifacts_controller_spec.rb
+8
-18
No files found.
spec/requests/projects/artifacts_controller_spec.rb
View file @
6c80b597
...
@@ -50,12 +50,12 @@ describe Projects::ArtifactsController do
...
@@ -50,12 +50,12 @@ describe Projects::ArtifactsController do
end
end
context
'302'
do
context
'302'
do
def
path_from_
sha
def
path_from_
ref
(
ref
=
pipeline
.
sha
,
build_name
=
build
.
name
)
search_namespace_project_artifacts_path
(
search_namespace_project_artifacts_path
(
project
.
namespace
,
project
.
namespace
,
project
,
project
,
pipeline
.
sha
,
ref
,
build
.
name
,
build
_
name
,
'browse'
)
'browse'
)
end
end
...
@@ -72,7 +72,7 @@ describe Projects::ArtifactsController do
...
@@ -72,7 +72,7 @@ describe Projects::ArtifactsController do
context
'with sha'
do
context
'with sha'
do
before
do
before
do
get
path_from_
sha
get
path_from_
ref
end
end
it_behaves_like
'redirect to the build'
it_behaves_like
'redirect to the build'
...
@@ -84,12 +84,7 @@ describe Projects::ArtifactsController do
...
@@ -84,12 +84,7 @@ describe Projects::ArtifactsController do
end
end
before
do
before
do
get
search_namespace_project_artifacts_path
(
get
path_from_ref
(
'master'
)
project
.
namespace
,
project
,
'master'
,
build
.
name
,
'browse'
)
end
end
it_behaves_like
'redirect to the build'
it_behaves_like
'redirect to the build'
...
@@ -101,12 +96,7 @@ describe Projects::ArtifactsController do
...
@@ -101,12 +96,7 @@ describe Projects::ArtifactsController do
end
end
before
do
before
do
get
search_namespace_project_artifacts_path
(
get
path_from_ref
(
'improve/awesome'
)
project
.
namespace
,
project
,
'improve/awesome'
,
build
.
name
,
'browse'
)
end
end
it_behaves_like
'redirect to the build'
it_behaves_like
'redirect to the build'
...
@@ -120,7 +110,7 @@ describe Projects::ArtifactsController do
...
@@ -120,7 +110,7 @@ describe Projects::ArtifactsController do
end
end
before
do
before
do
get
path_from_
sha
get
path_from_
ref
end
end
it_behaves_like
'redirect to the build'
it_behaves_like
'redirect to the build'
...
@@ -133,7 +123,7 @@ describe Projects::ArtifactsController do
...
@@ -133,7 +123,7 @@ describe Projects::ArtifactsController do
end
end
before
do
before
do
get
path_from_
sha
get
path_from_
ref
end
end
it_behaves_like
'redirect to the build'
it_behaves_like
'redirect to the build'
...
...
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