mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
DEV: Add test for link watched words (#13251)
This commit is contained in:
@@ -90,5 +90,16 @@ describe WatchedWord do
|
||||
expect(w.id).to eq(existing.id)
|
||||
}.to_not change { described_class.count }
|
||||
end
|
||||
|
||||
it "replaces link with absolute URL" do
|
||||
word = Fabricate(:watched_word, action: described_class.actions[:link], word: "meta1")
|
||||
expect(word.replacement).to eq("http://test.localhost/")
|
||||
|
||||
word = Fabricate(:watched_word, action: described_class.actions[:link], word: "meta2", replacement: "test")
|
||||
expect(word.replacement).to eq("http://test.localhost/test")
|
||||
|
||||
word = Fabricate(:watched_word, action: described_class.actions[:link], word: "meta3", replacement: "/test")
|
||||
expect(word.replacement).to eq("http://test.localhost/test")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user