allow spaces in account names
This commit is contained in:
@@ -169,6 +169,7 @@ class Domain::Fa::User < ReduxApplicationRecord
|
||||
name = name.strip
|
||||
URL_NAME_EXCEPTIONS[name] || name.
|
||||
delete("_").
|
||||
gsub(/\s/, "").
|
||||
downcase
|
||||
end
|
||||
|
||||
|
||||
@@ -66,6 +66,16 @@ describe Domain::Fa::Parser::Page do
|
||||
assert_match /Not Available/, up.profile_html
|
||||
end
|
||||
|
||||
it "parses special accounts with spaces in the name" do
|
||||
parser = get_parser "user_page_fa_staff.html"
|
||||
assert parser.logged_in?
|
||||
assert_page_type parser, :probably_user_page?
|
||||
up = parser.user_page
|
||||
assert_equal "Fur Affinity Staff", up.name
|
||||
assert_equal 15_962, up.num_pageviews
|
||||
assert_match /placeholder for sending system notices/, up.profile_html
|
||||
end
|
||||
|
||||
it "gallery_is_correct" do
|
||||
parser = get_parser "gallery_page_miles_df.html"
|
||||
assert parser.logged_in?
|
||||
|
||||
@@ -78,6 +78,13 @@ describe Domain::Fa::User do
|
||||
}).errors.full_messages).to_not be_empty
|
||||
end
|
||||
|
||||
it "name can contain whitespace for special accounts" do
|
||||
expect(described_class.create({
|
||||
name: "Fur Affinity Staff",
|
||||
url_name: "furaffinitystaff",
|
||||
}).errors.full_messages).to be_empty
|
||||
end
|
||||
|
||||
it "posts can be moved from one user to another" do
|
||||
user1 = SpecUtil.create_domain_fa_user(name: "Foo", url_name: "foo")
|
||||
user2 = SpecUtil.create_domain_fa_user(name: "Bar", url_name: "bar")
|
||||
|
||||
883
test/fixtures/files/domain/fa/parser/redux/user_page_fa_staff.html
vendored
Normal file
883
test/fixtures/files/domain/fa/parser/redux/user_page_fa_staff.html
vendored
Normal file
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user