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
657170b2
Commit
657170b2
authored
Apr 06, 2017
by
Douglas Barbosa Alexandre
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve spec for the GeoNodeStatus
parent
1becbca3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
0 deletions
+16
-0
spec/models/geo_node_status_spec.rb
spec/models/geo_node_status_spec.rb
+16
-0
No files found.
spec/models/geo_node_status_spec.rb
View file @
657170b2
...
...
@@ -34,13 +34,29 @@ describe GeoNodeStatus, model: true do
describe
'#attachments_synced_count'
do
it
'does not count synced files that were replaced'
do
user
=
create
(
:user
,
avatar:
fixture_file_upload
(
Rails
.
root
+
'spec/fixtures/dk.png'
,
'image/png'
))
subject
=
described_class
.
new
expect
(
subject
.
attachments_count
).
to
eq
(
1
)
expect
(
subject
.
attachments_synced_count
).
to
eq
(
0
)
upload
=
Upload
.
find_by
(
model:
user
,
uploader:
'AvatarUploader'
)
Geo
::
FileRegistry
.
create
(
file_type: :avatar
,
file_id:
upload
.
id
)
subject
=
described_class
.
new
expect
(
subject
.
attachments_count
).
to
eq
(
1
)
expect
(
subject
.
attachments_synced_count
).
to
eq
(
1
)
user
.
update
(
avatar:
fixture_file_upload
(
Rails
.
root
+
'spec/fixtures/rails_sample.jpg'
,
'image/jpg'
))
subject
=
described_class
.
new
expect
(
subject
.
attachments_count
).
to
eq
(
1
)
expect
(
subject
.
attachments_synced_count
).
to
eq
(
0
)
upload
=
Upload
.
find_by
(
model:
user
,
uploader:
'AvatarUploader'
)
Geo
::
FileRegistry
.
create
(
file_type: :avatar
,
file_id:
upload
.
id
)
subject
=
described_class
.
new
expect
(
subject
.
attachments_count
).
to
eq
(
1
)
expect
(
subject
.
attachments_synced_count
).
to
eq
(
1
)
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