Commit dff795a8 authored by Valery Sizov's avatar Valery Sizov

[CE->EE] Fix ES related specs

parent b3713af2
...@@ -30,23 +30,26 @@ describe "Note", elastic: true do ...@@ -30,23 +30,26 @@ describe "Note", elastic: true do
it "returns json with all needed elements" do it "returns json with all needed elements" do
note = create :note note = create :note
expected_hash = note.attributes.extract!( expected_hash_keys = [
'id', 'id',
'note', 'note',
'project_id', 'project_id',
'created_at' 'created_at',
) 'issue',
'updated_at_sort'
]
expected_hash['updated_at_sort'] = note.updated_at expect(note.as_indexed_json.keys).to eq(expected_hash_keys)
expect(note.as_indexed_json).to eq(expected_hash)
end end
it "does not create ElasticIndexerWorker job for award or system messages" do it "does not create ElasticIndexerWorker job for award or system messages" do
project = create :empty_project project = create :project
expect(ElasticIndexerWorker).not_to receive(:perform_async) issue = create :issue, project: project
create :note, :system, project: project
create :note, :award, project: project # Only issue should be updated
expect(ElasticIndexerWorker).to receive(:perform_async).twice.with(:update, 'Issue', anything, anything)
create :note, :system, project: project, noteable: issue
create :note, :award, project: project, noteable: issue
end end
context 'notes to confidential issues' do context 'notes to confidential issues' do
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment