mirror of
https://github.com/discourse/discourse.git
synced 2025-05-28 13:11:45 +08:00
FEATURE: Permalinks for users (#25552)
This commit is contained in:
@ -31,6 +31,7 @@ RSpec.describe Permalink do
|
||||
let(:post) { Fabricate(:post, topic: topic) }
|
||||
let(:category) { Fabricate(:category) }
|
||||
let(:tag) { Fabricate(:tag) }
|
||||
let(:user) { Fabricate(:user) }
|
||||
|
||||
it "returns a topic url when topic_id is set" do
|
||||
permalink.topic_id = topic.id
|
||||
@ -96,5 +97,15 @@ RSpec.describe Permalink do
|
||||
it "returns nil when nothing is set" do
|
||||
expect(target_url).to eq(nil)
|
||||
end
|
||||
|
||||
it "returns a user url when user_id is set" do
|
||||
permalink.user_id = user.id
|
||||
expect(target_url).to eq(user.full_url)
|
||||
end
|
||||
|
||||
it "returns nil when user_id is set but user is not found" do
|
||||
permalink.user_id = 99_999
|
||||
expect(target_url).to eq(nil)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
Reference in New Issue
Block a user