BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
b4faa597
Commit
b4faa597
authored
Jan 20, 2016
by
Douwe Maan
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'issue_3749' into 'master'
Update Issues/MRs updated_at field when notes are generated Closes #3749 and #9130 See merge request !2493
parents
f8f96994
c26816f7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
56 additions
and
5 deletions
+56
-5
note.rb
app/models/note.rb
+1
-1
issues.feature
features/project/issues/issues.feature
+8
-0
merge_requests.feature
features/project/merge_requests.feature
+19
-0
issues.rb
features/steps/project/issues/issues.rb
+5
-0
merge_requests.rb
features/steps/project/merge_requests.rb
+8
-0
note.rb
features/steps/shared/note.rb
+7
-0
note_data_builder_spec.rb
spec/lib/gitlab/note_data_builder_spec.rb
+8
-4
No files found.
app/models/note.rb
View file @
b4faa597
...
...
@@ -33,7 +33,7 @@ class Note < ActiveRecord::Base
participant
:author
belongs_to
:project
belongs_to
:noteable
,
polymorphic:
true
belongs_to
:noteable
,
polymorphic:
true
,
touch:
true
belongs_to
:author
,
class_name:
"User"
belongs_to
:updated_by
,
class_name:
"User"
...
...
features/project/issues/issues.feature
View file @
b4faa597
...
...
@@ -52,6 +52,14 @@ Feature: Project Issues
And
I should see an error alert section within the comment form
@javascript
Scenario
:
Visiting Issues after leaving a comment
Given
I visit issue page
"Release 0.4"
And
I leave a comment like
"XML attached"
And
I visit project
"Shop"
issues page
And
I sort the list by
"Last updated"
Then
I should see
"Release 0.4"
at the top
@javascript
Scenario
:
I
search issue
Given
I fill in issue search with
"Re"
Then
I should see
"Release 0.4"
in issues
...
...
features/project/merge_requests.feature
View file @
b4faa597
...
...
@@ -76,6 +76,25 @@ Feature: Project Merge Requests
Then
I should see comment
"XML attached"
@javascript
Scenario
:
Visiting Merge Requests after leaving a comment
Given
project
"Shop"
have
"Bug NS-05"
open merge request with diffs inside
And
I visit merge request page
"Bug NS-04"
And
I leave a comment like
"XML attached"
And
I visit project
"Shop"
merge requests page
And
I sort the list by
"Last updated"
Then
I should see
"Bug NS-04"
at the top
@javascript
Scenario
:
Visiting Merge Requests after commenting on diffs
Given
project
"Shop"
have
"Bug NS-05"
open merge request with diffs inside
And
I visit merge request page
"Bug NS-05"
And
I click on the Changes tab
And
I leave a comment like
"Line is wrong"
on diff
And
I visit project
"Shop"
merge requests page
And
I sort the list by
"Last updated"
Then
I should see
"Bug NS-05"
at the top
@javascript
Scenario
:
I
comment on a merge request diff
Given
project
"Shop"
have
"Bug NS-05"
open merge request with diffs inside
And
I visit merge request page
"Bug NS-05"
...
...
features/steps/project/issues/issues.rb
View file @
b4faa597
...
...
@@ -293,6 +293,11 @@ class Spinach::Features::ProjectIssues < Spinach::FeatureSteps
expect
(
page
).
to
have_content
(
'Yay!'
)
end
end
step
'I should see "Release 0.4" at the top'
do
expect
(
page
.
find
(
'ul.content-list.issues-list li.issue:first-child'
)).
to
have_content
(
"Release 0.4"
)
end
def
filter_issue
(
text
)
fill_in
'issue_search'
,
with:
text
end
...
...
features/steps/project/merge_requests.rb
View file @
b4faa597
...
...
@@ -415,6 +415,14 @@ class Spinach::Features::ProjectMergeRequests < Spinach::FeatureSteps
end
end
step
'I should see "Bug NS-05" at the top'
do
expect
(
page
.
find
(
'ul.content-list.mr-list li.merge-request:first-child'
)).
to
have_content
(
"Bug NS-05"
)
end
step
'I should see "Bug NS-04" at the top'
do
expect
(
page
.
find
(
'ul.content-list.mr-list li.merge-request:first-child'
)).
to
have_content
(
"Bug NS-04"
)
end
def
merge_request
@merge_request
||=
MergeRequest
.
find_by!
(
title:
"Bug NS-05"
)
end
...
...
features/steps/shared/note.rb
View file @
b4faa597
...
...
@@ -144,4 +144,11 @@ module SharedNote
expect
(
page
).
to
have_content
(
"+1 Awesome!"
)
end
end
step
'I sort the list by "Last updated"'
do
find
(
'button.dropdown-toggle.btn'
).
click
page
.
within
(
'ul.dropdown-menu.dropdown-menu-align-right li'
)
do
click_link
"Last updated"
end
end
end
spec/lib/gitlab/note_data_builder_spec.rb
View file @
b4faa597
...
...
@@ -37,7 +37,8 @@ describe 'Gitlab::NoteDataBuilder', lib: true do
it
'returns the note and issue-specific data'
do
expect
(
data
).
to
have_key
(
:issue
)
expect
(
data
[
:issue
]).
to
eq
(
issue
.
hook_attrs
)
expect
(
data
[
:issue
].
except
(
'updated_at'
)).
to
eq
(
issue
.
hook_attrs
.
except
(
'updated_at'
))
expect
(
data
[
:issue
][
'updated_at'
]).
to
be
>
issue
.
hook_attrs
[
'updated_at'
]
end
end
...
...
@@ -47,7 +48,8 @@ describe 'Gitlab::NoteDataBuilder', lib: true do
it
'returns the note and merge request data'
do
expect
(
data
).
to
have_key
(
:merge_request
)
expect
(
data
[
:merge_request
]).
to
eq
(
merge_request
.
hook_attrs
)
expect
(
data
[
:merge_request
].
except
(
'updated_at'
)).
to
eq
(
merge_request
.
hook_attrs
.
except
(
'updated_at'
))
expect
(
data
[
:merge_request
][
'updated_at'
]).
to
be
>
merge_request
.
hook_attrs
[
'updated_at'
]
end
end
...
...
@@ -57,7 +59,8 @@ describe 'Gitlab::NoteDataBuilder', lib: true do
it
'returns the note and merge request diff data'
do
expect
(
data
).
to
have_key
(
:merge_request
)
expect
(
data
[
:merge_request
]).
to
eq
(
merge_request
.
hook_attrs
)
expect
(
data
[
:merge_request
].
except
(
'updated_at'
)).
to
eq
(
merge_request
.
hook_attrs
.
except
(
'updated_at'
))
expect
(
data
[
:merge_request
][
'updated_at'
]).
to
be
>
merge_request
.
hook_attrs
[
'updated_at'
]
end
end
...
...
@@ -67,7 +70,8 @@ describe 'Gitlab::NoteDataBuilder', lib: true do
it
'returns the note and project snippet data'
do
expect
(
data
).
to
have_key
(
:snippet
)
expect
(
data
[
:snippet
]).
to
eq
(
snippet
.
hook_attrs
)
expect
(
data
[
:snippet
].
except
(
'updated_at'
)).
to
eq
(
snippet
.
hook_attrs
.
except
(
'updated_at'
))
expect
(
data
[
:snippet
][
'updated_at'
]).
to
be
>
snippet
.
hook_attrs
[
'updated_at'
]
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