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
703d62a5
Commit
703d62a5
authored
Apr 03, 2019
by
Felipe Artur
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Extract EE specific files/lines for Discussion spec/services
This is part of moving GitLab to single codebase
parent
ee72dc1b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
23 deletions
+26
-23
spec/services/system_note_service_spec.rb
spec/services/system_note_service_spec.rb
+26
-23
No files found.
spec/services/system_note_service_spec.rb
View file @
703d62a5
# frozen_string_literal: true
require
'spec_helper'
describe
SystemNoteService
do
include
ProjectForksHelper
include
Gitlab
::
Routing
include
RepoHelpers
include
AssetsHelpers
...
...
@@ -619,7 +622,7 @@ describe SystemNoteService do
context
'commit with cross-reference from fork'
do
let
(
:author2
)
{
create
(
:project_member
,
:reporter
,
user:
create
(
:user
),
project:
project
).
user
}
let
(
:forked_project
)
{
Projects
::
ForkService
.
new
(
project
,
author2
).
execute
}
let
(
:forked_project
)
{
fork_project
(
project
,
author2
,
repository:
true
)
}
let
(
:commit2
)
{
forked_project
.
commit
}
before
do
...
...
@@ -896,6 +899,28 @@ describe SystemNoteService do
end
end
describe
'.change_time_estimate'
do
subject
{
described_class
.
change_time_estimate
(
noteable
,
project
,
author
)
}
it_behaves_like
'a system note'
do
let
(
:action
)
{
'time_tracking'
}
end
context
'with a time estimate'
do
it
'sets the note text'
do
noteable
.
update_attribute
(
:time_estimate
,
277200
)
expect
(
subject
.
note
).
to
eq
"changed time estimate to 1w 4d 5h"
end
end
context
'without a time estimate'
do
it
'sets the note text'
do
expect
(
subject
.
note
).
to
eq
"removed time estimate"
end
end
end
describe
'.discussion_continued_in_issue'
do
let
(
:discussion
)
{
create
(
:diff_note_on_merge_request
,
project:
project
).
to_discussion
}
let
(
:merge_request
)
{
discussion
.
noteable
}
...
...
@@ -922,28 +947,6 @@ describe SystemNoteService do
end
end
describe
'.change_time_estimate'
do
subject
{
described_class
.
change_time_estimate
(
noteable
,
project
,
author
)
}
it_behaves_like
'a system note'
do
let
(
:action
)
{
'time_tracking'
}
end
context
'with a time estimate'
do
it
'sets the note text'
do
noteable
.
update_attribute
(
:time_estimate
,
277200
)
expect
(
subject
.
note
).
to
eq
"changed time estimate to 1w 4d 5h"
end
end
context
'without a time estimate'
do
it
'sets the note text'
do
expect
(
subject
.
note
).
to
eq
"removed time estimate"
end
end
end
describe
'.change_time_spent'
do
# We need a custom noteable in order to the shared examples to be green.
let
(
:noteable
)
do
...
...
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