summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorBob Van Landuyt <bob@gitlab.com>2017-05-02 15:24:41 +0200
committerBob Van Landuyt <bob@gitlab.com>2017-05-02 15:24:41 +0200
commit3dd2476eb395ca706763210ef1f37978889c595d (patch)
tree298508bd9cf34436c3957376a16fe9b00e20e490 /spec
parentffc486a58547b6984a44a43097183b34592be608 (diff)
downloadgitlab-ce-3dd2476eb395ca706763210ef1f37978889c595d.tar.gz
Refresh the markdown cache if it was `nil`
If the cached html_field for a markdown_field is `nil` while the mfarkdown_field is not, it needs to be refreshed.
Diffstat (limited to 'spec')
-rw-r--r--spec/models/concerns/cache_markdown_field_spec.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/spec/models/concerns/cache_markdown_field_spec.rb b/spec/models/concerns/cache_markdown_field_spec.rb
index 4edafbc4e32..40bbb10eaac 100644
--- a/spec/models/concerns/cache_markdown_field_spec.rb
+++ b/spec/models/concerns/cache_markdown_field_spec.rb
@@ -170,6 +170,12 @@ describe CacheMarkdownField do
is_expected.to be_truthy
end
+
+ it 'returns false if the markdown field is set but the html is not' do
+ thing.foo_html = nil
+
+ is_expected.to be_falsy
+ end
end
describe '#refresh_markdown_cache!' do