Forces UTF-8 encoding when enumerating usernames - Fixes #801
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh-CN">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="renderer" content="webkit">
|
||||
<title>一路疯下去</title>
|
||||
<link rel="profile" href="http://gmpg.org/xfn/11" />
|
||||
<link rel="pingback" href="http://wp.lab/xmlrpc.php" />
|
||||
<link rel="canonical" href="http://wp.lab/author/一路疯下去/">
|
||||
<body class="archive author author-78">
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
shared_examples 'WpUser::Existable' do
|
||||
let(:mod) { WpUser::Existable }
|
||||
let(:fixtures_dir) { MODELS_FIXTURES + '/wp_user/existable' }
|
||||
let(:fixtures_dir) { File.join(MODELS_FIXTURES, 'wp_user', 'existable') }
|
||||
|
||||
describe '::login_from_author_pattern' do
|
||||
after do
|
||||
@@ -145,7 +145,7 @@ shared_examples 'WpUser::Existable' do
|
||||
end
|
||||
|
||||
context 'with a 200' do
|
||||
let(:resp_opt) { { code: 200, body: File.new(fixtures_dir + '/admin.html').read } }
|
||||
let(:resp_opt) { { code: 200, body: File.read(File.join(fixtures_dir, 'admin.html')) } }
|
||||
|
||||
it 'loads the correct values' do
|
||||
@login = 'admin'
|
||||
@@ -153,6 +153,15 @@ shared_examples 'WpUser::Existable' do
|
||||
end
|
||||
end
|
||||
|
||||
context 'when chinese chars' do
|
||||
let(:resp_opt) { { code: 200, body: File.read(File.join(fixtures_dir, 'chinese_chars.html')) } }
|
||||
|
||||
it 'loads the correct values' do
|
||||
@login = '一路疯下去'
|
||||
@display_name = nil
|
||||
end
|
||||
end
|
||||
|
||||
context 'otherwise' do
|
||||
it 'does not do anything' do
|
||||
@resp_opt = { code: 404 }
|
||||
|
||||
Reference in New Issue
Block a user