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
Boxiang Sun
gitlab-ce
Commits
46e0a66a
Commit
46e0a66a
authored
Nov 01, 2017
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added refs_controller_spec
parent
5a2d9f66
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
3 deletions
+15
-3
spec/controllers/projects/refs_controller_spec.rb
spec/controllers/projects/refs_controller_spec.rb
+15
-3
No files found.
spec/controllers/projects/refs_controller_spec.rb
View file @
46e0a66a
...
@@ -19,16 +19,19 @@ describe Projects::RefsController do
...
@@ -19,16 +19,19 @@ describe Projects::RefsController do
format:
format
format:
format
end
end
def
xhr_get
(
format
=
:html
)
def
xhr_get
(
format
=
:html
,
path
=
'foo/bar/baz.html'
)
xhr
:get
,
xhr
:get
,
:logs_tree
,
:logs_tree
,
namespace_id:
project
.
namespace
.
to_param
,
namespace_id:
project
.
namespace
.
to_param
,
project_id:
project
,
id:
'master'
,
project_id:
project
,
path:
'foo/bar/baz.html'
,
format:
format
id:
'master'
,
path:
path
,
format:
format
end
end
it
'never throws MissingTemplate'
do
it
'never throws MissingTemplate'
do
expect
{
default_get
}.
not_to
raise_error
expect
{
default_get
}.
not_to
raise_error
expect
{
xhr_get
(
:json
)
}.
not_to
raise_error
expect
{
xhr_get
}.
not_to
raise_error
expect
{
xhr_get
}.
not_to
raise_error
end
end
...
@@ -42,5 +45,14 @@ describe Projects::RefsController do
...
@@ -42,5 +45,14 @@ describe Projects::RefsController do
xhr_get
(
:js
)
xhr_get
(
:js
)
expect
(
response
).
to
be_success
expect
(
response
).
to
be_success
end
end
it
'renders JSON'
do
xhr_get
(
:json
,
'/'
)
expect
(
response
).
to
be_success
expect
(
json_response
).
to
be_kind_of
(
Array
)
expect
(
json_response
[
0
][
'type'
]).
to
eq
(
'tree'
)
expect
(
json_response
[
0
][
'file_name'
]).
to
eq
(
'bar'
)
end
end
end
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