diff options
author | Robert Speicher <rspeicher@gmail.com> | 2019-01-28 17:19:23 +0000 |
---|---|---|
committer | Robert Speicher <rspeicher@gmail.com> | 2019-01-28 17:19:23 +0000 |
commit | a24551964180614bb9b19417763996043edba25f (patch) | |
tree | 543fd1d2b641ab19d2d5c72264c57efbfd737915 /spec/models/concerns | |
parent | 4f8bdb01c7e5f02a0ae79cd2641465e45350faf6 (diff) | |
parent | 7bc0fbe22f0dd2c96b596b591ef5dbf3eaae8dd3 (diff) | |
download | gitlab-ce-a24551964180614bb9b19417763996043edba25f.tar.gz |
Merge branch 'bw-enable-sourcepos' into 'master'
Enable CommonMark source line position information
See merge request gitlab-org/gitlab-ce!23971
Diffstat (limited to 'spec/models/concerns')
-rw-r--r-- | spec/models/concerns/cache_markdown_field_spec.rb | 8 | ||||
-rw-r--r-- | spec/models/concerns/cacheable_attributes_spec.rb | 4 | ||||
-rw-r--r-- | spec/models/concerns/redactable_spec.rb | 4 |
3 files changed, 14 insertions, 2 deletions
diff --git a/spec/models/concerns/cache_markdown_field_spec.rb b/spec/models/concerns/cache_markdown_field_spec.rb index f8d50e89d40..ef6af232999 100644 --- a/spec/models/concerns/cache_markdown_field_spec.rb +++ b/spec/models/concerns/cache_markdown_field_spec.rb @@ -67,13 +67,17 @@ describe CacheMarkdownField do end let(:markdown) { '`Foo`' } - let(:html) { '<p dir="auto"><code>Foo</code></p>' } + let(:html) { '<p dir="auto"><code>Foo</code></p>' } let(:updated_markdown) { '`Bar`' } - let(:updated_html) { '<p dir="auto"><code>Bar</code></p>' } + let(:updated_html) { '<p dir="auto"><code>Bar</code></p>' } let(:thing) { ThingWithMarkdownFields.new(foo: markdown, foo_html: html, cached_markdown_version: CacheMarkdownField::CACHE_COMMONMARK_VERSION) } + before do + stub_commonmark_sourcepos_disabled + end + describe '.attributes' do it 'excludes cache attributes' do expect(thing.attributes.keys.sort).to eq(%w[bar baz foo]) diff --git a/spec/models/concerns/cacheable_attributes_spec.rb b/spec/models/concerns/cacheable_attributes_spec.rb index 689e7d3058f..43a544cfe26 100644 --- a/spec/models/concerns/cacheable_attributes_spec.rb +++ b/spec/models/concerns/cacheable_attributes_spec.rb @@ -159,6 +159,10 @@ describe CacheableAttributes do describe 'edge cases' do describe 'caching behavior', :use_clean_rails_memory_store_caching do + before do + stub_commonmark_sourcepos_disabled + end + it 'retrieves upload fields properly' do ar_record = create(:appearance, :with_logo) ar_record.cache! diff --git a/spec/models/concerns/redactable_spec.rb b/spec/models/concerns/redactable_spec.rb index 7d320edd492..7feeaa54069 100644 --- a/spec/models/concerns/redactable_spec.rb +++ b/spec/models/concerns/redactable_spec.rb @@ -1,6 +1,10 @@ require 'spec_helper' describe Redactable do + before do + stub_commonmark_sourcepos_disabled + end + shared_examples 'model with redactable field' do it 'redacts unsubscribe token' do model[field] = 'some text /sent_notifications/00000000000000000000000000000000/unsubscribe more text' |