This repository has been archived on 2019-05-14. You can view files and clone it, but cannot push or open issues or pull requests.
mastodon/spec/helpers/activitystreams2_builder_helper_spec.rb
2017-05-29 18:03:15 +02:00

16 lines
495 B
Ruby

# 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