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
b6ee8455
authored
May 19, 2016
by
John Doe
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
refactored service to agent
parent
1683ca9e
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
5 deletions
app/services/db_folder_service.rb → app/services/db_folder_agent.rb
spec/services/db_folder_service_spec.rb → spec/services/db_folder_agent_spec.rb
app/services/db_folder_
service
.rb
→
app/services/db_folder_
agent
.rb
View file @
b6ee8455
# frozen_string_literal: true
# frozen_string_literal: true
#
Service
class for DbFolders
#
Agent
class for DbFolders
class
DbFolder
Service
class
DbFolder
Agent
attr_accessor
:error_msg
attr_accessor
:error_msg
def
initialize
(
db_service
:,
db_builder
:)
def
initialize
(
db_service
:,
db_builder
:)
...
...
spec/services/db_folder_
service
_spec.rb
→
spec/services/db_folder_
agent
_spec.rb
View file @
b6ee8455
# frozen_string_literal: true
# frozen_string_literal: true
require
'rails_helper'
require
'rails_helper'
RSpec
.
describe
'DbF
ileService
'
do
RSpec
.
describe
'DbF
olderAgent
'
do
describe
'insert_file'
do
describe
'insert_file'
do
# mock the DbService and DbBuilder
# mock the DbService and DbBuilder
let
(
:db_service
)
{
double
(
create_file:
true
)
}
let
(
:db_service
)
{
double
(
create_file:
true
)
}
...
@@ -12,9 +12,9 @@ RSpec.describe 'DbFileService' do
...
@@ -12,9 +12,9 @@ RSpec.describe 'DbFileService' do
let
(
:parent_folder
)
{
FactoryGirl
.
build_stubbed
(
:db_folder
)
}
let
(
:parent_folder
)
{
FactoryGirl
.
build_stubbed
(
:db_folder
)
}
it
'adds the given file to the folder'
do
it
'adds the given file to the folder'
do
db_folder_
service
=
DbFolderService
.
new
(
db_service:
db_service
,
db_folder_
agent
=
DbFolderAgent
.
new
(
db_service:
db_service
,
db_builder:
db_builder
)
db_builder:
db_builder
)
db_folder_
service
.
insert_file
(
folder:
parent_folder
,
file:
new_file
)
db_folder_
agent
.
insert_file
(
folder:
parent_folder
,
file:
new_file
)
expect
(
new_file
.
db_folder
).
to
eq
(
parent_folder
)
expect
(
new_file
.
db_folder
).
to
eq
(
parent_folder
)
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