Commit 2e5585ac authored by Kassio Borges's avatar Kassio Borges
parent 9a767309
......@@ -13,7 +13,7 @@ module Gitlab
# author - An instance of `Gitlab::GithubImport::Representation::User`
# exists - Boolean that indicates the user exists in the GitLab database.
def initialize(text, author, exists = false)
@text = text
@text = text.to_s
@author = author
@exists = exists
end
......
......@@ -27,6 +27,13 @@ RSpec.describe Gitlab::GithubImport::MarkdownText do
expect(text.to_s).to eq('Hello')
end
it 'returns empty text when it receives nil' do
author = double(:author, login: nil)
text = described_class.new(nil, author, true)
expect(text.to_s).to eq('')
end
it 'returns the text with an extra header when the author was not found' do
author = double(:author, login: 'Alice')
text = described_class.new('Hello', author)
......
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