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
ae9f0ca8
Commit
ae9f0ca8
authored
Jul 31, 2016
by
winniehell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add failing test for #20462
parent
c009f620
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
47 additions
and
2 deletions
+47
-2
spec/finders/branches_finder_spec.rb
spec/finders/branches_finder_spec.rb
+5
-1
spec/routing/project_routing_spec.rb
spec/routing/project_routing_spec.rb
+4
-1
spec/support/test_env.rb
spec/support/test_env.rb
+1
-0
spec/views/projects/tree/show.html.haml_spec.rb
spec/views/projects/tree/show.html.haml_spec.rb
+37
-0
No files found.
spec/finders/branches_finder_spec.rb
View file @
ae9f0ca8
...
@@ -20,7 +20,11 @@ describe BranchesFinder do
...
@@ -20,7 +20,11 @@ describe BranchesFinder do
result
=
branches_finder
.
execute
result
=
branches_finder
.
execute
expect
(
result
.
first
.
name
).
to
eq
(
'crlf-diff'
)
recently_updated_branch
=
repository
.
branches
.
max
do
|
a
,
b
|
repository
.
commit
(
a
.
target
).
committed_date
<=>
repository
.
commit
(
b
.
target
).
committed_date
end
expect
(
result
.
first
.
name
).
to
eq
(
recently_updated_branch
.
name
)
end
end
it
'sorts by last_updated'
do
it
'sorts by last_updated'
do
...
...
spec/routing/project_routing_spec.rb
View file @
ae9f0ca8
...
@@ -479,13 +479,16 @@ end
...
@@ -479,13 +479,16 @@ end
describe
Projects
::
NetworkController
,
'routing'
do
describe
Projects
::
NetworkController
,
'routing'
do
it
'to #show'
do
it
'to #show'
do
expect
(
get
(
'/gitlab/gitlabhq/network/master'
)).
to
route_to
(
'projects/network#show'
,
namespace_id:
'gitlab'
,
project_id:
'gitlabhq'
,
id:
'master'
)
expect
(
get
(
'/gitlab/gitlabhq/network/master'
)).
to
route_to
(
'projects/network#show'
,
namespace_id:
'gitlab'
,
project_id:
'gitlabhq'
,
id:
'master'
)
expect
(
get
(
'/gitlab/gitlabhq/network/master.json'
)).
to
route_to
(
'projects/network#show'
,
namespace_id:
'gitlab'
,
project_id:
'gitlabhq'
,
id:
'master'
,
format:
'json'
)
expect
(
get
(
'/gitlab/gitlabhq/network/ends-with.json'
)).
to
route_to
(
'projects/network#show'
,
namespace_id:
'gitlab'
,
project_id:
'gitlabhq'
,
id:
'ends-with.json'
)
expect
(
get
(
'/gitlab/gitlabhq/network/master?format=json'
)).
to
route_to
(
'projects/network#show'
,
namespace_id:
'gitlab'
,
project_id:
'gitlabhq'
,
id:
'master'
,
format:
'json'
)
end
end
end
end
describe
Projects
::
GraphsController
,
'routing'
do
describe
Projects
::
GraphsController
,
'routing'
do
it
'to #show'
do
it
'to #show'
do
expect
(
get
(
'/gitlab/gitlabhq/graphs/master'
)).
to
route_to
(
'projects/graphs#show'
,
namespace_id:
'gitlab'
,
project_id:
'gitlabhq'
,
id:
'master'
)
expect
(
get
(
'/gitlab/gitlabhq/graphs/master'
)).
to
route_to
(
'projects/graphs#show'
,
namespace_id:
'gitlab'
,
project_id:
'gitlabhq'
,
id:
'master'
)
expect
(
get
(
'/gitlab/gitlabhq/graphs/ends-with.json'
)).
to
route_to
(
'projects/graphs#show'
,
namespace_id:
'gitlab'
,
project_id:
'gitlabhq'
,
id:
'ends-with.json'
)
expect
(
get
(
'/gitlab/gitlabhq/graphs/master?format=json'
)).
to
route_to
(
'projects/graphs#show'
,
namespace_id:
'gitlab'
,
project_id:
'gitlabhq'
,
id:
'master'
,
format:
'json'
)
end
end
end
end
...
...
spec/support/test_env.rb
View file @
ae9f0ca8
...
@@ -6,6 +6,7 @@ module TestEnv
...
@@ -6,6 +6,7 @@ module TestEnv
# When developing the seed repository, comment out the branch you will modify.
# When developing the seed repository, comment out the branch you will modify.
BRANCH_SHA
=
{
BRANCH_SHA
=
{
'empty-branch'
=>
'7efb185'
,
'empty-branch'
=>
'7efb185'
,
'ends-with.json'
=>
'98b0d8b3'
,
'flatten-dir'
=>
'e56497b'
,
'flatten-dir'
=>
'e56497b'
,
'feature'
=>
'0b4bc9a'
,
'feature'
=>
'0b4bc9a'
,
'feature_conflict'
=>
'bb5206f'
,
'feature_conflict'
=>
'bb5206f'
,
...
...
spec/views/projects/tree/show.html.haml_spec.rb
0 → 100644
View file @
ae9f0ca8
require
'spec_helper'
describe
'projects/tree/show'
do
include
Devise
::
TestHelpers
let
(
:project
)
{
create
(
:project
)
}
let
(
:repository
)
{
project
.
repository
}
before
do
assign
(
:project
,
project
)
assign
(
:repository
,
repository
)
allow
(
view
).
to
receive
(
:can?
).
and_return
(
true
)
allow
(
view
).
to
receive
(
:can_collaborate_with_project?
).
and_return
(
true
)
end
context
'for branch names ending on .json'
do
let
(
:ref
)
{
'ends-with.json'
}
let
(
:commit
)
{
repository
.
commit
(
ref
)
}
let
(
:path
)
{
''
}
let
(
:tree
)
{
repository
.
tree
(
commit
.
id
,
path
)
}
before
do
assign
(
:ref
,
ref
)
assign
(
:commit
,
commit
)
assign
(
:id
,
commit
.
id
)
assign
(
:tree
,
tree
)
assign
(
:path
,
path
)
end
it
'displays correctly'
do
render
expect
(
rendered
).
to
have_css
(
'.js-project-refs-dropdown .dropdown-toggle-text'
,
text:
ref
)
expect
(
rendered
).
to
have_css
(
'.readme-holder .file-content'
,
text:
ref
)
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