FIX: allow_uppercase_posts didn't work for topic titles
This commit is contained in:
parent
c889c0daee
commit
4881fb028f
|
@ -12,7 +12,7 @@ class TextCleaner
|
||||||
{
|
{
|
||||||
deduplicate_exclamation_marks: SiteSetting.title_prettify,
|
deduplicate_exclamation_marks: SiteSetting.title_prettify,
|
||||||
deduplicate_question_marks: SiteSetting.title_prettify,
|
deduplicate_question_marks: SiteSetting.title_prettify,
|
||||||
replace_all_upper_case: SiteSetting.title_prettify,
|
replace_all_upper_case: SiteSetting.title_prettify && !SiteSetting.allow_uppercase_posts,
|
||||||
capitalize_first_letter: SiteSetting.title_prettify,
|
capitalize_first_letter: SiteSetting.title_prettify,
|
||||||
remove_all_periods_from_the_end: SiteSetting.title_prettify,
|
remove_all_periods_from_the_end: SiteSetting.title_prettify,
|
||||||
remove_extraneous_space: SiteSetting.title_prettify && SiteSetting.default_locale == "en",
|
remove_extraneous_space: SiteSetting.title_prettify && SiteSetting.default_locale == "en",
|
||||||
|
|
|
@ -180,6 +180,11 @@ describe TextCleaner do
|
||||||
expect(TextCleaner.clean_title("HELLO THERE")).to eq("Hello there")
|
expect(TextCleaner.clean_title("HELLO THERE")).to eq("Hello there")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
it "doesn't replace all upper case text when uppercase posts are allowed" do
|
||||||
|
SiteSetting.allow_uppercase_posts = true
|
||||||
|
expect(TextCleaner.clean_title("HELLO THERE")).to eq("HELLO THERE")
|
||||||
|
end
|
||||||
|
|
||||||
it "capitalizes first letter" do
|
it "capitalizes first letter" do
|
||||||
expect(TextCleaner.clean_title("hello there")).to eq("Hello there")
|
expect(TextCleaner.clean_title("hello there")).to eq("Hello there")
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue