闭社主体 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.

17 lines
503 B

  1. require 'rails_helper'
  2. RSpec.describe StreamEntriesHelper, type: :helper do
  3. describe '#display_name' do
  4. it 'uses the display name when it exists' do
  5. account = Account.new(display_name: "Display", username: "Username")
  6. expect(helper.display_name(account)).to eq "Display"
  7. end
  8. it 'uses the username when display name is nil' do
  9. account = Account.new(display_name: nil, username: "Username")
  10. expect(helper.display_name(account)).to eq "Username"
  11. end
  12. end
  13. end