Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
wattsworth
/
lumen-api
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
ed0a8a8f
authored
Jul 13, 2016
by
John Doe
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
working on metadata updates
parent
d8ed8a7f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
49 additions
and
5 deletions
spec/models/db_file_spec.rb
spec/services/db/update_db_spec.rb
spec/models/db_file_spec.rb
View file @
ed0a8a8f
...
...
@@ -39,5 +39,4 @@ RSpec.describe 'DbFile' do
expect
(
db_service
).
to
have_received
(
:remove_file
)
end
end
end
spec/services/db/update_db_spec.rb
View file @
ed0a8a8f
...
...
@@ -164,12 +164,57 @@ describe 'UpdateDb' do
# ...and the service should have a warning
expect
(
@service
.
warnings?
).
to
be
true
end
it
'adds new files'
it
'adds new folders'
it
'adds new files'
do
# create Db with 1 folder and file
update_with_schema
([
helper
.
entry
(
'/folder1/old_file'
)])
@folder
=
@root
.
subfolders
.
first
expect
(
@folder
.
db_files
.
count
).
to
eq
(
1
)
# run update again with a new file added
update_with_schema
([
helper
.
entry
(
'/folder1/old_file'
),
helper
.
entry
(
'/folder1/new_file'
)],
db:
@db
)
expect
(
@folder
.
db_files
.
count
).
to
eq
(
2
)
end
it
'adds new folders'
do
# create Db with 1 folder and file
update_with_schema
([
helper
.
entry
(
'/folder1/old_file'
)])
@folder
=
@root
.
subfolders
.
first
expect
(
@folder
.
subfolders
.
count
).
to
eq
(
0
)
# run update again with a new file added
update_with_schema
([
helper
.
entry
(
'/folder1/old_file'
),
helper
.
entry
(
'/folder1/new_folder/info'
)],
db:
@db
)
expect
(
@folder
.
subfolders
.
count
).
to
eq
(
1
)
end
end
describe
'given changes to remote metadata'
do
it
'updates file info'
it
'updates folder info'
it
'updates file info'
do
# create Db with 1 folder and file
update_with_schema
([
helper
.
entry
(
'/folder1/file1'
,
metadata:
{
name:
'old_name'
})])
file
=
DbFile
.
find_by_name
(
'old_name'
)
expect
(
file
).
to
be_present
# run update again with new metadata
update_with_schema
([
helper
.
entry
(
'/folder1/file1'
,
metadata:
{
name:
'new_name'
})],
db:
@db
)
file
.
reload
expect
(
file
.
name
).
to
eq
(
'new_name'
)
end
it
'updates folder info'
do
# create Db with folder and subfolder
update_with_schema
([
helper
.
entry
(
'/folder1/subfolder/info'
,
metadata:
{
name:
'old_name'
})])
folder
=
DbFolder
.
find_by_name
(
'old_name'
)
expect
(
folder
).
to
be_present
# run update again with new metadata
update_with_schema
([
helper
.
entry
(
'/folder1/subfolder/info'
,
metadata:
{
name:
'new_name'
})],
db:
@db
)
folder
.
reload
expect
(
folder
.
name
).
to
eq
(
'new_name'
)
end
it
'adds new streams'
it
'removes missing streams'
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