about summary refs log tree commit diff
path: root/spec/helpers/activitystreams2_builder_helper_spec.rb
blob: 612ce6ad29307229d0bdfaf065afbdcddbddb946 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
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