mirror of
https://github.com/discourse/discourse.git
synced 2024-12-02 11:53:40 +08:00
b0c92bb0b9
Follow up to [FIX: Empty backup names with unicode site titles][1]
- Use .presence - "It's cleaner"
- Update spec to use System.system_user so it is more readable
[1]: c8661674d4
20 lines
597 B
Ruby
20 lines
597 B
Ruby
# frozen_string_literal: true
|
|
|
|
require 'rails_helper'
|
|
|
|
describe BackupRestore::Backuper do
|
|
it 'returns a non-empty parameterized title when site title contains unicode' do
|
|
SiteSetting.title = 'Ɣ'
|
|
backuper = BackupRestore::Backuper.new(Discourse.system_user.id)
|
|
|
|
expect(backuper.send(:get_parameterized_title)).to eq("discourse")
|
|
end
|
|
|
|
it 'returns a valid parameterized site title' do
|
|
SiteSetting.title = "Coding Horror"
|
|
backuper = BackupRestore::Backuper.new(Discourse.system_user.id)
|
|
|
|
expect(backuper.send(:get_parameterized_title)).to eq("coding-horror")
|
|
end
|
|
end
|