闭社主体 forked from https://github.com/tootsuite/mastodon
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

15 lines
495 B

  1. # frozen_string_literal: true
  2. require 'rails_helper'
  3. describe Activitystreams2BuilderHelper, type: :helper do
  4. it 'returns display name if present' do
  5. account = Fabricate(:account, display_name: 'display name', username: 'username')
  6. expect(account_name(account)).to eq 'display name'
  7. end
  8. it 'returns username if display name is not present' do
  9. account = Fabricate(:account, display_name: '', username: 'username')
  10. expect(account_name(account)).to eq 'username'
  11. end
  12. end