diff --git a/lib/locomotive/configuration.rb b/lib/locomotive/configuration.rb index 248e93ab..9dc4f361 100644 --- a/lib/locomotive/configuration.rb +++ b/lib/locomotive/configuration.rb @@ -50,7 +50,7 @@ module Locomotive self.manage_subdomain? && self.manage_domains? end - def reserved_domains + def reserved_subdomains if self.multi_sites? if self.multi_sites.reserved_subdomains.blank? @@defaults[:reserved_subdomains] diff --git a/spec/lib/locomotive/configuration_spec.rb b/spec/lib/locomotive/configuration_spec.rb new file mode 100644 index 00000000..8539ada7 --- /dev/null +++ b/spec/lib/locomotive/configuration_spec.rb @@ -0,0 +1,19 @@ +require 'spec_helper' + +describe Locomotive::Configuration do + + before(:each) do + @old_config = Locomotive.config.dup + end + + it 'allows a different value for the reserved subdomains' do + Locomotive.config.reserved_subdomains.include?('www').should be_true # by default + Locomotive.config.multi_sites { |multi_sites| multi_sites.reserved_subdomains = %w(empty) } + Locomotive.config.reserved_subdomains.should == ['empty'] + end + + after(:each) do + Locomotive.config = @old_config + end + +end \ No newline at end of file diff --git a/spec/lib/locomotive/export_spec.rb b/spec/lib/locomotive/export_spec.rb index d7856a89..d2cf4c0f 100644 --- a/spec/lib/locomotive/export_spec.rb +++ b/spec/lib/locomotive/export_spec.rb @@ -5,7 +5,7 @@ describe Locomotive::Export do context '#content_type' do before(:each) do - site = Factory.build(:site) + site = Factory.build('another site') Site.stubs(:find).returns(site) project_type = build_project_type(site) project_type.contents.build(:title => 'Project #1', :description => 'Lorem ipsum', :active => true)