Merge pull request #4164 from mcwumbly/add-spec-for-website-name-with-subdomain
Add spec for website name when url has subdomain
This commit is contained in:
commit
b85f41ad67
|
@ -88,16 +88,32 @@ describe UserSerializer do
|
||||||
end
|
end
|
||||||
|
|
||||||
context "with filled out website" do
|
context "with filled out website" do
|
||||||
before do
|
context "when website has a path" do
|
||||||
user.user_profile.website = 'http://example.com/user'
|
before do
|
||||||
|
user.user_profile.website = 'http://example.com/user'
|
||||||
|
end
|
||||||
|
|
||||||
|
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
|
end
|
||||||
|
|
||||||
it "has a website" do
|
context "when website has a subdomain" do
|
||||||
expect(json[:website]).to eq 'http://example.com/user'
|
before do
|
||||||
end
|
user.user_profile.website = 'http://www.example.com/user'
|
||||||
|
end
|
||||||
|
|
||||||
it "returns complete website name with path" do
|
it "has a website with a subdomain" do
|
||||||
expect(json[:website_name]).to eq 'example.com/user'
|
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
|
end
|
||||||
|
|
||||||
context "when website includes query parameters" do
|
context "when website includes query parameters" do
|
||||||
|
|
Loading…
Reference in New Issue