diff options
Diffstat (limited to 'spec/lib/gitlab/github_import/markdown/attachment_spec.rb')
-rw-r--r-- | spec/lib/gitlab/github_import/markdown/attachment_spec.rb | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/spec/lib/gitlab/github_import/markdown/attachment_spec.rb b/spec/lib/gitlab/github_import/markdown/attachment_spec.rb index 5d29de34141..588a3076f59 100644 --- a/spec/lib/gitlab/github_import/markdown/attachment_spec.rb +++ b/spec/lib/gitlab/github_import/markdown/attachment_spec.rb @@ -35,6 +35,12 @@ RSpec.describe Gitlab::GithubImport::Markdown::Attachment do it { expect(described_class.from_markdown(markdown_node)).to eq nil } end + + context 'when URL is blank' do + let(:url) { nil } + + it { expect(described_class.from_markdown(markdown_node)).to eq nil } + end end context "when it's an image attachment" do @@ -63,6 +69,12 @@ RSpec.describe Gitlab::GithubImport::Markdown::Attachment do it { expect(described_class.from_markdown(markdown_node)).to eq nil } end + + context 'when URL is blank' do + let(:url) { nil } + + it { expect(described_class.from_markdown(markdown_node)).to eq nil } + end end context "when it's an inline html node" do @@ -80,6 +92,12 @@ RSpec.describe Gitlab::GithubImport::Markdown::Attachment do expect(attachment.name).to eq name expect(attachment.url).to eq url end + + context 'when image src is not present' do + let(:img) { "<img width=\"248\" alt=\"#{name}\">" } + + it { expect(described_class.from_markdown(markdown_node)).to eq nil } + end end end |