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
49bd4172
Commit
49bd4172
authored
Jun 05, 2016
by
Valery Sizov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
CE->EE fix Elastic related specs
parent
a2eb6591
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
4 additions
and
12 deletions
+4
-12
app/models/note.rb
app/models/note.rb
+2
-4
spec/factories/notes.rb
spec/factories/notes.rb
+0
-5
spec/models/concerns/elastic/note_spec.rb
spec/models/concerns/elastic/note_spec.rb
+2
-3
No files found.
app/models/note.rb
View file @
49bd4172
...
...
@@ -41,9 +41,7 @@ class Note < ActiveRecord::Base
mount_uploader
:attachment
,
AttachmentUploader
# Scopes
scope
:awards
,
->
{
where
(
is_award:
true
)
}
scope
:nonawards
,
->
{
where
(
is_award:
false
)
}
scope
:searchable
,
->
{
where
(
"is_award IS FALSE AND system IS FALSE"
)
}
scope
:searchable
,
->
{
where
(
system:
false
)
}
scope
:for_commit_id
,
->
(
commit_id
)
{
where
(
noteable_type:
"Commit"
,
commit_id:
commit_id
)
}
scope
:system
,
->
{
where
(
system:
true
)
}
scope
:user
,
->
{
where
(
system:
false
)
}
...
...
@@ -111,7 +109,7 @@ class Note < ActiveRecord::Base
end
def
searchable?
!
is_award
&&
!
system
!
system
end
def
cross_reference?
...
...
spec/factories/notes.rb
View file @
49bd4172
...
...
@@ -44,11 +44,6 @@ FactoryGirl.define do
system
true
end
trait
:award
do
is_award
true
note
Emoji
.
emojis_names
.
sample
end
trait
:downvote
do
note
"thumbsdown"
end
...
...
spec/models/concerns/elastic/note_spec.rb
View file @
49bd4172
...
...
@@ -42,14 +42,13 @@ describe "Note", elastic: true do
expect
(
note
.
as_indexed_json
.
keys
).
to
eq
(
expected_hash_keys
)
end
it
"does not create ElasticIndexerWorker job for
award or
system messages"
do
it
"does not create ElasticIndexerWorker job for system messages"
do
project
=
create
:project
issue
=
create
:issue
,
project:
project
# Only issue should be updated
expect
(
ElasticIndexerWorker
).
to
receive
(
:perform_async
).
twice
.
with
(
:update
,
'Issue'
,
anything
,
anything
)
expect
(
ElasticIndexerWorker
).
to
receive
(
:perform_async
).
with
(
:update
,
'Issue'
,
anything
,
anything
)
create
:note
,
:system
,
project:
project
,
noteable:
issue
create
:note
,
:award
,
project:
project
,
noteable:
issue
end
context
'notes to confidential issues'
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