summaryrefslogtreecommitdiff
path: root/spec/helpers/stat_anchors_helper_spec.rb
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2021-03-12 16:26:10 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2021-03-12 16:26:10 +0000
commit6653ccc011dec86e5140a5d09ea3b2357eab6714 (patch)
tree897193f37bcd98152a0ac214f80a3c4cfe1047c5 /spec/helpers/stat_anchors_helper_spec.rb
parentbff35a05aed6a31380a73c39113808fd262c2c37 (diff)
downloadgitlab-ce-6653ccc011dec86e5140a5d09ea3b2357eab6714.tar.gz
Add latest changes from gitlab-org/gitlab@13-10-stable-eev13.10.0-rc41
Diffstat (limited to 'spec/helpers/stat_anchors_helper_spec.rb')
-rw-r--r--spec/helpers/stat_anchors_helper_spec.rb18
1 files changed, 17 insertions, 1 deletions
diff --git a/spec/helpers/stat_anchors_helper_spec.rb b/spec/helpers/stat_anchors_helper_spec.rb
index 0615baac3cb..f3830bf4172 100644
--- a/spec/helpers/stat_anchors_helper_spec.rb
+++ b/spec/helpers/stat_anchors_helper_spec.rb
@@ -18,7 +18,7 @@ RSpec.describe StatAnchorsHelper do
context 'when anchor is not a link' do
context 'when class_modifier is set' do
- let(:anchor) { anchor_klass.new(false, nil, nil, 'default') }
+ let(:anchor) { anchor_klass.new(false, nil, nil, 'btn-default') }
it 'returns the proper attributes' do
expect(subject[:class]).to include('gl-button btn btn-default')
@@ -49,5 +49,21 @@ RSpec.describe StatAnchorsHelper do
expect(subject[:itemprop]).to eq true
end
end
+
+ context 'when data is not set' do
+ let(:anchor) { anchor_klass.new(false, nil, nil, nil, nil, nil, nil) }
+
+ it 'returns the data attributes' do
+ expect(subject[:data]).to be_nil
+ end
+ end
+
+ context 'when itemprop is set' do
+ let(:anchor) { anchor_klass.new(false, nil, nil, nil, nil, nil, { 'toggle' => 'modal' }) }
+
+ it 'returns the data attributes' do
+ expect(subject[:data]).to eq({ 'toggle' => 'modal' })
+ end
+ end
end
end