Specs now correctly use a multisite test app.

This commit is contained in:
Mario Visic 2011-11-25 23:59:44 +11:00
parent 915a28dc0a
commit 2a5861e8a7
10 changed files with 7 additions and 47 deletions

View File

@ -181,9 +181,4 @@ describe 'Bushido support' do
load 'site.rb' load 'site.rb'
end end
end end
after(:all) do
Locomotive.configure_for_test(true)
end
end end

View File

@ -172,9 +172,4 @@ describe 'Heroku support' do
load 'site.rb' load 'site.rb'
end end
end end
after(:all) do
Locomotive.configure_for_test(true)
end
end end

View File

@ -182,10 +182,4 @@ describe 'Locomotive rendering system' do
end end
end end
after(:all) do
ENV['APP_TLD'] = nil
Locomotive.configure_for_test(true)
end
end end

View File

@ -247,13 +247,6 @@ describe Locomotive::Routing::SiteDispatcher do
it 'returns false' do it 'returns false' do
@controller.send(:validate_site_membership).should be_false @controller.send(:validate_site_membership).should be_false
end end
end end
end end
# after(:all) do
# Locomotive.configure_for_test(true)
# end
end end

View File

@ -90,10 +90,4 @@ describe Locomotive::Account do
end end
end end
after(:all) do
ENV['APP_TLD'] = nil
Locomotive.configure_for_test(true)
end
end end

View File

@ -177,11 +177,6 @@ describe Locomotive::ContentInstance do
end end
end end
after(:all) do
ENV['APP_TLD'] = nil
Locomotive.configure_for_test(true)
end
def build_content(options = {}) def build_content(options = {})
@content_type.contents.build({ :title => 'Locomotive', :description => 'Lorem ipsum....' }.merge(options)) @content_type.contents.build({ :title => 'Locomotive', :description => 'Lorem ipsum....' }.merge(options))
end end

View File

@ -260,11 +260,6 @@ describe Locomotive::ContentType do
end end
after(:all) do
ENV['APP_TLD'] = nil
Locomotive.configure_for_test(true)
end
def build_content(content_type) def build_content(content_type)
content_type.contents.build(:name => 'Asset on steroids', :description => 'Lorem ipsum', :active => true) content_type.contents.build(:name => 'Asset on steroids', :description => 'Lorem ipsum', :active => true)
end end

View File

@ -231,9 +231,4 @@ describe Locomotive::Page do
@page.errors[:redirect_url].should == ["is invalid"] @page.errors[:redirect_url].should == ["is invalid"]
end end
end end
after(:all) do
ENV['APP_TLD'] = nil
Locomotive.configure_for_test(true)
end
end end

View File

@ -17,6 +17,10 @@ RSpec.configure do |config|
config.mock_with :mocha config.mock_with :mocha
config.before(:suite) do
Locomotive.configure_for_test(true)
end
config.before(:each) do config.before(:each) do
Locomotive.config.heroku = false Locomotive.config.heroku = false
end end

View File

@ -3,12 +3,12 @@ FactoryGirl.define do
## Site ## ## Site ##
factory :site, :class => Locomotive::Site do factory :site, :class => Locomotive::Site do
name 'Acme Website' name 'Acme Website'
# subdomain 'acme' subdomain 'acme'
created_at Time.now created_at Time.now
factory "test site" do factory "test site" do
name 'Locomotive test website' name 'Locomotive test website'
# subdomain 'test' subdomain 'test'
after_build do |site_test| after_build do |site_test|
site_test.memberships.build :account => Locomotive::Account.where(:name => "Admin").first || Factory("admin user"), :role => 'admin' site_test.memberships.build :account => Locomotive::Account.where(:name => "Admin").first || Factory("admin user"), :role => 'admin'
@ -16,7 +16,7 @@ FactoryGirl.define do
factory "another site" do factory "another site" do
name "Locomotive test website #2" name "Locomotive test website #2"
# subdomain "test2" subdomain "test2"
end end
end end