diff options
author | Rémy Coutable <remy@rymai.me> | 2017-02-22 16:03:39 +0300 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2017-02-22 16:03:39 +0300 |
commit | 7813ceddf7bb175510c9be03ec182d2514d583a2 (patch) | |
tree | 6a075fef81d93328dac6e87690161f1e9af9b304 /spec | |
parent | 90eb2b92a05e7b2c24f68c9a6b9fed7d9e0945dd (diff) | |
parent | 95ed01749e0ffe55a979acb246ca8e0ae663bffb (diff) |
Merge branch '26087-asciidoc-cicd-badges-snippet' into 'master'
Add AsciiDoc snippet for CI/CD Badges
Closes #26087
See merge request !9164
Diffstat (limited to 'spec')
-rw-r--r-- | spec/features/projects/badges/list_spec.rb | 6 | ||||
-rw-r--r-- | spec/lib/gitlab/badge/shared/metadata.rb | 10 |
2 files changed, 14 insertions, 2 deletions
diff --git a/spec/features/projects/badges/list_spec.rb b/spec/features/projects/badges/list_spec.rb index 67a4a5d1ab1..ae9db0c0d6e 100644 --- a/spec/features/projects/badges/list_spec.rb +++ b/spec/features/projects/badges/list_spec.rb @@ -14,7 +14,8 @@ feature 'list of badges' do expect(page).to have_content 'build status' expect(page).to have_content 'Markdown' expect(page).to have_content 'HTML' - expect(page).to have_css('.highlight', count: 2) + expect(page).to have_content 'AsciiDoc' + expect(page).to have_css('.highlight', count: 3) expect(page).to have_xpath("//img[@alt='build status']") page.within('.highlight', match: :first) do @@ -28,7 +29,8 @@ feature 'list of badges' do expect(page).to have_content 'coverage report' expect(page).to have_content 'Markdown' expect(page).to have_content 'HTML' - expect(page).to have_css('.highlight', count: 2) + expect(page).to have_content 'AsciiDoc' + expect(page).to have_css('.highlight', count: 3) expect(page).to have_xpath("//img[@alt='coverage report']") page.within('.highlight', match: :first) do diff --git a/spec/lib/gitlab/badge/shared/metadata.rb b/spec/lib/gitlab/badge/shared/metadata.rb index 0cf18514251..63c7ca5a915 100644 --- a/spec/lib/gitlab/badge/shared/metadata.rb +++ b/spec/lib/gitlab/badge/shared/metadata.rb @@ -18,4 +18,14 @@ shared_examples 'badge metadata' do it { is_expected.to include metadata.image_url } it { is_expected.to include metadata.link_url } end + + describe '#to_asciidoc' do + subject { metadata.to_asciidoc } + + it { is_expected.to include metadata.image_url } + it { is_expected.to include metadata.link_url } + it { is_expected.to include 'image:' } + it { is_expected.to include 'link=' } + it { is_expected.to include 'title=' } + end end |