mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FIX: Cache url data for failed inline oneboxes
This commit is contained in:
@@ -39,6 +39,21 @@ describe InlineOneboxer do
|
||||
expect(cached[:url]).to eq(topic.url)
|
||||
expect(cached[:title]).to eq(topic.title)
|
||||
end
|
||||
|
||||
it "puts an entry in the cache for failed onebox" do
|
||||
SiteSetting.enable_inline_onebox_on_all_domains = true
|
||||
url = "https://example.com/random-url"
|
||||
|
||||
expect(InlineOneboxer.cache_lookup(url)).to be_blank
|
||||
|
||||
result = InlineOneboxer.lookup(url)
|
||||
expect(result).to be_present
|
||||
|
||||
cached = InlineOneboxer.cache_lookup(url)
|
||||
expect(cached).to be_present
|
||||
expect(cached[:url]).to eq(url)
|
||||
expect(cached[:title]).to be_nil
|
||||
end
|
||||
end
|
||||
|
||||
context ".lookup" do
|
||||
|
||||
Reference in New Issue
Block a user