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
Jérome Perrin
gitlab-ce
Commits
8c4c40d0
Commit
8c4c40d0
authored
May 05, 2017
by
blackst0ne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updated specs
parent
cca09bbb
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
19 additions
and
71 deletions
+19
-71
spec/features/issuables/system_notes_spec.rb
spec/features/issuables/system_notes_spec.rb
+0
-30
spec/features/issues_spec.rb
spec/features/issues_spec.rb
+0
-22
spec/features/merge_requests/edit_mr_spec.rb
spec/features/merge_requests/edit_mr_spec.rb
+0
-18
spec/services/issues/update_service_spec.rb
spec/services/issues/update_service_spec.rb
+11
-0
spec/services/merge_requests/update_service_spec.rb
spec/services/merge_requests/update_service_spec.rb
+7
-0
spec/services/system_note_service_spec.rb
spec/services/system_note_service_spec.rb
+1
-1
No files found.
spec/features/issuables/system_notes_spec.rb
deleted
100644 → 0
View file @
cca09bbb
require
'spec_helper'
describe
'issuable system notes'
,
feature:
true
do
let
(
:issue
)
{
create
(
:issue
,
project:
project
,
author:
user
)
}
let
(
:merge_request
)
{
create
(
:merge_request
,
:simple
,
source_project:
project
)
}
let
(
:project
)
{
create
(
:project
,
:public
)
}
let
(
:user
)
{
create
(
:user
)
}
before
do
project
.
add_user
(
user
,
:master
)
login_as
(
user
)
end
[
:issue
,
:merge_request
].
each
do
|
issuable_type
|
context
"when
#{
issuable_type
}
"
do
before
do
issuable
=
issuable_type
==
:issue
?
issue
:
merge_request
visit
(
edit_polymorphic_path
([
project
.
namespace
.
becomes
(
Namespace
),
project
,
issuable
]))
end
it
'adds system note "description changed"'
do
fill_in
(
"
#{
issuable_type
}
_description"
,
with:
'hello world'
)
click_button
(
'Save changes'
)
expect
(
page
).
to
have_content
(
"
#{
user
.
name
}
#{
user
.
to_reference
}
changed the description"
)
end
end
end
end
spec/features/issues_spec.rb
View file @
8c4c40d0
...
...
@@ -714,26 +714,4 @@ describe 'Issues', feature: true do
expect
(
page
).
to
have_text
(
"updated title"
)
end
end
describe
'"edited by" message'
,
js:
true
do
let
(
:issue
)
{
create
(
:issue
,
project:
project
,
author:
@user
)
}
context
'when issue is updated'
do
before
{
visit
edit_namespace_project_issue_path
(
project
.
namespace
,
project
,
issue
)
}
it
'shows "edited by" mesage on title update'
do
fill_in
'issue_title'
,
with:
'hello world'
click_button
'Save changes'
expect
(
page
).
to
have_content
(
"Edited less than a minute ago by
#{
@user
.
name
}
"
)
end
it
'shows "edited by" mesage on description update'
do
fill_in
'issue_description'
,
with:
'hello world'
click_button
'Save changes'
expect
(
page
).
to
have_content
(
"Edited less than a minute ago by
#{
@user
.
name
}
"
)
end
end
end
end
spec/features/merge_requests/edit_mr_spec.rb
View file @
8c4c40d0
...
...
@@ -67,23 +67,5 @@ feature 'Edit Merge Request', feature: true do
def
get_textarea_height
page
.
evaluate_script
(
'document.getElementById("merge_request_description").offsetHeight'
)
end
describe
'"edited by" message'
,
js:
true
do
context
'when merge request is updated'
do
it
'shows "edited by" mesage on title update'
do
fill_in
'merge_request_title'
,
with:
'hello world'
click_button
'Save changes'
expect
(
page
).
to
have_content
(
"Edited less than a minute ago by
#{
user
.
name
}
"
)
end
it
'shows "edited by" mesage on description update'
do
fill_in
'merge_request_description'
,
with:
'hello world'
click_button
'Save changes'
expect
(
page
).
to
have_content
(
"Edited less than a minute ago by
#{
user
.
name
}
"
)
end
end
end
end
end
spec/services/issues/update_service_spec.rb
View file @
8c4c40d0
...
...
@@ -132,6 +132,17 @@ describe Issues::UpdateService, services: true do
end
end
context
'when description changed'
do
it
'creates system note about description change'
do
update_issue
(
description:
'Changed description'
)
note
=
find_note
(
'changed the description'
)
expect
(
note
).
not_to
be_nil
expect
(
note
.
note
).
to
eq
(
'changed the description'
)
end
end
context
'when issue turns confidential'
do
let
(
:opts
)
do
{
...
...
spec/services/merge_requests/update_service_spec.rb
View file @
8c4c40d0
...
...
@@ -102,6 +102,13 @@ describe MergeRequests::UpdateService, services: true do
expect
(
note
.
note
).
to
eq
'changed title from **{-Old-} title** to **{+New+} title**'
end
it
'creates system note about description change'
do
note
=
find_note
(
'changed the description'
)
expect
(
note
).
not_to
be_nil
expect
(
note
.
note
).
to
eq
(
'changed the description'
)
end
it
'creates system note about branch change'
do
note
=
find_note
(
'changed target'
)
...
...
spec/services/system_note_service_spec.rb
View file @
8c4c40d0
...
...
@@ -301,7 +301,7 @@ describe SystemNoteService, services: true do
end
it
'sets the note text'
do
expect
(
subject
.
note
).
to
eq
'changed the description'
expect
(
subject
.
note
).
to
eq
(
'changed the description'
)
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