Spec Activitystreams2BuilderHelper (#3413)

remotes/1727458204337373841/tmp_refs/heads/signup-info-prompt
Akihiko Odaki 2017-05-30 01:03:15 +09:00 committed by Eugen Rochko
parent 5aacd9d4c7
commit 52ae83d008
1 changed files with 15 additions and 0 deletions

View File

@ -0,0 +1,15 @@
# frozen_string_literal: true
require 'rails_helper'
describe Activitystreams2BuilderHelper, type: :helper do
it 'returns display name if present' do
account = Fabricate(:account, display_name: 'display name', username: 'username')
expect(account_name(account)).to eq 'display name'
end
it 'returns username if display name is not present' do
account = Fabricate(:account, display_name: '', username: 'username')
expect(account_name(account)).to eq 'username'
end
end