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
0
Merge Requests
0
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
Léo-Paul Géneau
gitlab-ce
Commits
81331fa7
Commit
81331fa7
authored
Dec 13, 2017
by
Rubén Dávila
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add some initial specs for Files::MultiService class
parent
5b880f0d
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
54 additions
and
0 deletions
+54
-0
spec/services/files/multi_service_spec.rb
spec/services/files/multi_service_spec.rb
+54
-0
No files found.
spec/services/files/multi_service_spec.rb
0 → 100644
View file @
81331fa7
require
"spec_helper"
describe
Files
::
MultiService
do
subject
{
described_class
.
new
(
project
,
user
,
commit_params
)
}
let
(
:project
)
{
create
(
:project
,
:repository
)
}
let
(
:user
)
{
create
(
:user
)
}
let
(
:branch_name
)
{
project
.
default_branch
}
let
(
:action
)
{
'update'
}
let
(
:actions
)
do
[
{
action:
action
,
file_path:
'files/ruby/popen.rb'
,
content:
'New content'
}
]
end
let
(
:commit_params
)
do
{
commit_message:
"Update File"
,
branch_name:
branch_name
,
start_branch:
branch_name
,
actions:
actions
}
end
before
do
project
.
team
<<
[
user
,
:master
]
end
describe
'#execute'
do
context
'with a valid action'
do
it
'returns a hash with the :success status '
do
results
=
subject
.
execute
expect
(
results
[
:status
]).
to
eq
(
:success
)
end
end
context
'with an invalid action'
do
let
(
:action
)
{
'rename'
}
it
'returns a hash with the :error status '
do
results
=
subject
.
execute
expect
(
results
[
:status
]).
to
eq
(
:error
)
expect
(
results
[
:message
]).
to
match
(
/Unknown action/
)
end
end
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