diff options
author | Lin Jen-Shin <godfat@godfat.org> | 2018-02-09 18:12:20 +0800 |
---|---|---|
committer | Lin Jen-Shin <godfat@godfat.org> | 2018-02-09 18:12:20 +0800 |
commit | 09a3b8fb655ac673a5d706548d13c26cdb53aa9f (patch) | |
tree | 1de0f5552cf1235587cc36f59c1ddc92c1a50752 /spec/support/matchers/markdown_matchers.rb | |
parent | 1264e2b6e8ce53f578255e9296875947845431bf (diff) | |
parent | 7534f7a892d6e8c50475720e387b8689c94582da (diff) | |
download | gitlab-ce-09a3b8fb655ac673a5d706548d13c26cdb53aa9f.tar.gz |
Merge remote-tracking branch 'upstream/master' into qa-clone-with-deploy-key
* upstream/master: (466 commits)
Set initial password for instance in LDAP QA test
Backport EE changes to some hashed storage documentation to CE
Remove allow_n_plus_1 from Git::Repository#branches_filter
Bumps Gitlab Shell version to 6.0.3
Make resetting column information overridable in EE
Added 'clear' button to ci lint editor
Issues and merge requests in subgroups docs
Update docs labels CE
Refactored merge_requests/show path in dispatcher.js
wording
don't check against a hardcoded user name
10.5 Update the dependencies license list
10.5 Update the .gitignore, .gitlab-ci.yml, and Dockerfile templates
Create update guide for 10.5
Update 10.5 source install guide
Add docs for MR link in commit page
Add groups to OpenID Connect claims
Replaced $.get with axois.get
Memoize MergeRequest#rebase_in_progress? to prevent N+1 queries in Gitaly
Update style_guide_scss.md
...
Diffstat (limited to 'spec/support/matchers/markdown_matchers.rb')
-rw-r--r-- | spec/support/matchers/markdown_matchers.rb | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/spec/support/matchers/markdown_matchers.rb b/spec/support/matchers/markdown_matchers.rb index d12b2757427..ec4ec6f4038 100644 --- a/spec/support/matchers/markdown_matchers.rb +++ b/spec/support/matchers/markdown_matchers.rb @@ -190,6 +190,27 @@ module MarkdownMatchers expect(video['src']).to end_with('/assets/videos/gitlab-demo.mp4') end end + + # ColorFilter + matcher :parse_colors do + set_default_markdown_messages + + match do |actual| + color_chips = actual.css('code > span.gfm-color_chip > span') + + expect(color_chips.count).to eq(9) + + [ + '#F00', '#F00A', '#FF0000', '#FF0000AA', 'RGB(0,255,0)', + 'RGB(0%,100%,0%)', 'RGBA(0,255,0,0.7)', 'HSL(540,70%,50%)', + 'HSLA(540,70%,50%,0.7)' + ].each_with_index do |color, i| + parsed_color = Banzai::ColorParser.parse(color) + expect(color_chips[i]['style']).to match("background-color: #{parsed_color};") + expect(color_chips[i].parent.parent.content).to match(color) + end + end + end end # Monkeypatch the matcher DSL so that we can reduce some noisy duplication for |