mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-23 15:48:43 -05:00
Add spec for website name when url has subdomain
This commit is contained in:
parent
c6f6b17f71
commit
9d34289d08
1 changed files with 23 additions and 7 deletions
|
@ -88,17 +88,33 @@ describe UserSerializer do
|
|||
end
|
||||
|
||||
context "with filled out website" do
|
||||
context "when website has a path" do
|
||||
before do
|
||||
user.user_profile.website = 'http://example.com/user'
|
||||
end
|
||||
|
||||
it "has a website" do
|
||||
it "has a website with a path" do
|
||||
expect(json[:website]).to eq 'http://example.com/user'
|
||||
end
|
||||
|
||||
it "returns complete website name with path" do
|
||||
expect(json[:website_name]).to eq 'example.com/user'
|
||||
end
|
||||
end
|
||||
|
||||
context "when website has a subdomain" do
|
||||
before do
|
||||
user.user_profile.website = 'http://www.example.com/user'
|
||||
end
|
||||
|
||||
it "has a website with a subdomain" do
|
||||
expect(json[:website]).to eq 'http://www.example.com/user'
|
||||
end
|
||||
|
||||
it "returns website name with the subdomain" do
|
||||
expect(json[:website_name]).to eq 'www.example.com/user'
|
||||
end
|
||||
end
|
||||
|
||||
context "when website includes query parameters" do
|
||||
before do
|
||||
|
|
Loading…
Reference in a new issue