instance_helper_spec.rb 774 B

123456789101112131415161718192021222324252627282930313233
  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