Commit d635f8bb authored by Luke "Jared" Bennett's avatar Luke "Jared" Bennett

Improve discussion_line_code set and update notes_controller_spec

parent 3176eb83
...@@ -107,8 +107,9 @@ module NotesActions ...@@ -107,8 +107,9 @@ module NotesActions
diff_discussion_html: diff_discussion_html(discussion), diff_discussion_html: diff_discussion_html(discussion),
discussion_html: discussion_html(discussion), discussion_html: discussion_html(discussion),
discussion_line_code: discussion.line_code,
) )
attrs[:discussion_line_code] = discussion.line_code if discussion.is_a?(DiffDiscussion)
end end
end end
else else
......
...@@ -59,6 +59,7 @@ describe Projects::NotesController do ...@@ -59,6 +59,7 @@ describe Projects::NotesController do
expect(note_json[:id]).to eq(note.id) expect(note_json[:id]).to eq(note.id)
expect(note_json[:discussion_html]).not_to be_nil expect(note_json[:discussion_html]).not_to be_nil
expect(note_json[:diff_discussion_html]).to be_nil expect(note_json[:diff_discussion_html]).to be_nil
expect(note_json[:discussion_line_code]).to be_nil
end end
end end
...@@ -74,6 +75,7 @@ describe Projects::NotesController do ...@@ -74,6 +75,7 @@ describe Projects::NotesController do
expect(note_json[:id]).to eq(note.id) expect(note_json[:id]).to eq(note.id)
expect(note_json[:discussion_html]).not_to be_nil expect(note_json[:discussion_html]).not_to be_nil
expect(note_json[:diff_discussion_html]).not_to be_nil expect(note_json[:diff_discussion_html]).not_to be_nil
expect(note_json[:discussion_line_code]).not_to be_nil
end end
end end
...@@ -92,6 +94,7 @@ describe Projects::NotesController do ...@@ -92,6 +94,7 @@ describe Projects::NotesController do
expect(note_json[:id]).to eq(note.id) expect(note_json[:id]).to eq(note.id)
expect(note_json[:discussion_html]).not_to be_nil expect(note_json[:discussion_html]).not_to be_nil
expect(note_json[:diff_discussion_html]).to be_nil expect(note_json[:diff_discussion_html]).to be_nil
expect(note_json[:discussion_line_code]).to be_nil
end end
end end
...@@ -104,6 +107,7 @@ describe Projects::NotesController do ...@@ -104,6 +107,7 @@ describe Projects::NotesController do
expect(note_json[:id]).to eq(note.id) expect(note_json[:id]).to eq(note.id)
expect(note_json[:discussion_html]).to be_nil expect(note_json[:discussion_html]).to be_nil
expect(note_json[:diff_discussion_html]).to be_nil expect(note_json[:diff_discussion_html]).to be_nil
expect(note_json[:discussion_line_code]).to be_nil
end end
end end
end end
...@@ -120,6 +124,7 @@ describe Projects::NotesController do ...@@ -120,6 +124,7 @@ describe Projects::NotesController do
expect(note_json[:html]).not_to be_nil expect(note_json[:html]).not_to be_nil
expect(note_json[:discussion_html]).to be_nil expect(note_json[:discussion_html]).to be_nil
expect(note_json[:diff_discussion_html]).to be_nil expect(note_json[:diff_discussion_html]).to be_nil
expect(note_json[:discussion_line_code]).to be_nil
end end
end end
......
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