This commit is contained in:
did 2011-07-09 00:47:05 +02:00
parent 0ea5275504
commit 2236b43222
3 changed files with 21 additions and 2 deletions

View File

@ -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]

View File

@ -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

View File

@ -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)