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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
f3569a25
Commit
f3569a25
authored
Aug 01, 2017
by
Jacob Vosmaer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix bug in blob test
parent
e7988103
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
2 deletions
+8
-2
spec/lib/gitlab/git/blob_spec.rb
spec/lib/gitlab/git/blob_spec.rb
+8
-2
No files found.
spec/lib/gitlab/git/blob_spec.rb
View file @
f3569a25
...
@@ -78,12 +78,18 @@ describe Gitlab::Git::Blob, seed_helper: true do
...
@@ -78,12 +78,18 @@ describe Gitlab::Git::Blob, seed_helper: true do
context
'large file'
do
context
'large file'
do
let
(
:blob
)
{
Gitlab
::
Git
::
Blob
.
find
(
repository
,
SeedRepo
::
Commit
::
ID
,
'files/images/6049019_460s.jpg'
)
}
let
(
:blob
)
{
Gitlab
::
Git
::
Blob
.
find
(
repository
,
SeedRepo
::
Commit
::
ID
,
'files/images/6049019_460s.jpg'
)
}
let
(
:blob_size
)
{
111803
}
let
(
:blob_size
)
{
111803
}
let
(
:stub_limit
)
{
1000
}
before
do
stub_const
(
'Gitlab::Git::Blob::MAX_DATA_DISPLAY_SIZE'
,
stub_limit
)
end
it
{
expect
(
blob
.
size
).
to
eq
(
blob_size
)
}
it
{
expect
(
blob
.
size
).
to
eq
(
blob_size
)
}
it
{
expect
(
blob
.
data
.
length
).
to
eq
(
blob_size
)
}
it
{
expect
(
blob
.
data
.
length
).
to
eq
(
stub_limit
)
}
it
'check that this test is sane'
do
it
'check that this test is sane'
do
expect
(
blob
.
size
).
to
be
<=
Gitlab
::
Git
::
Blob
::
MAX_DATA_DISPLAY_SIZE
# It only makes sense to test limiting if the blob is larger than the limit.
expect
(
blob
.
size
).
to
be
>
Gitlab
::
Git
::
Blob
::
MAX_DATA_DISPLAY_SIZE
end
end
it
'can load all data'
do
it
'can load all data'
do
...
...
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