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
4d89f081
Commit
4d89f081
authored
Apr 08, 2017
by
Douwe Maan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix specs
parent
d3c0cfa5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
+5
-5
spec/models/blob_spec.rb
spec/models/blob_spec.rb
+5
-5
No files found.
spec/models/blob_spec.rb
View file @
4d89f081
...
@@ -55,13 +55,13 @@ describe Blob do
...
@@ -55,13 +55,13 @@ describe Blob do
describe
'#pdf?'
do
describe
'#pdf?'
do
it
'is falsey when file extension is not .pdf'
do
it
'is falsey when file extension is not .pdf'
do
git_blob
=
double
(
name:
'git_blob.txt'
)
git_blob
=
Gitlab
::
Git
::
Blob
.
new
(
name:
'git_blob.txt'
)
expect
(
described_class
.
decorate
(
git_blob
)).
not_to
be_pdf
expect
(
described_class
.
decorate
(
git_blob
)).
not_to
be_pdf
end
end
it
'is truthy when file extension is .pdf'
do
it
'is truthy when file extension is .pdf'
do
git_blob
=
double
(
name:
'git_blob.pdf'
)
git_blob
=
Gitlab
::
Git
::
Blob
.
new
(
name:
'git_blob.pdf'
)
expect
(
described_class
.
decorate
(
git_blob
)).
to
be_pdf
expect
(
described_class
.
decorate
(
git_blob
)).
to
be_pdf
end
end
...
@@ -140,7 +140,7 @@ describe Blob do
...
@@ -140,7 +140,7 @@ describe Blob do
stl?:
false
stl?:
false
)
)
described_class
.
decorate
(
double
).
tap
do
|
blob
|
described_class
.
decorate
(
Gitlab
::
Git
::
Blob
.
new
({})
).
tap
do
|
blob
|
allow
(
blob
).
to
receive_messages
(
overrides
)
allow
(
blob
).
to
receive_messages
(
overrides
)
end
end
end
end
...
@@ -158,7 +158,7 @@ describe Blob do
...
@@ -158,7 +158,7 @@ describe Blob do
it
'handles SVGs'
do
it
'handles SVGs'
do
blob
=
stubbed_blob
(
text?:
true
,
svg?:
true
)
blob
=
stubbed_blob
(
text?:
true
,
svg?:
true
)
expect
(
blob
.
to_partial_path
(
project
)).
to
eq
'
image
'
expect
(
blob
.
to_partial_path
(
project
)).
to
eq
'
svg
'
end
end
it
'handles images'
do
it
'handles images'
do
...
@@ -167,7 +167,7 @@ describe Blob do
...
@@ -167,7 +167,7 @@ describe Blob do
end
end
it
'handles text'
do
it
'handles text'
do
blob
=
stubbed_blob
(
text?:
true
)
blob
=
stubbed_blob
(
text?:
true
,
name:
'test.txt'
)
expect
(
blob
.
to_partial_path
(
project
)).
to
eq
'text'
expect
(
blob
.
to_partial_path
(
project
)).
to
eq
'text'
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