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
774 B

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