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

33 lines
793 B

  1. # frozen_string_literal: true
  2. require 'rails_helper'
  3. describe InstanceHelper do
  4. describe 'site_title' do
  5. it 'Uses the Setting.site_title value when it exists' do
  6. Setting.site_title = 'New site title'
  7. expect(helper.site_title).to eq 'New site title'
  8. end
  9. it 'returns empty string when Setting.site_title is nil' do
  10. Setting.site_title = nil
  11. expect(helper.site_title).to eq ''
  12. end
  13. end
  14. describe 'site_hostname' do
  15. around(:each) do |example|
  16. before = Rails.configuration.x.local_domain
  17. example.run
  18. Rails.configuration.x.local_domain = before
  19. end
  20. it 'returns the local domain value' do
  21. Rails.configuration.x.local_domain = 'example.com'
  22. expect(helper.site_hostname).to eq 'example.com'
  23. end
  24. end
  25. end