diff --git a/test/functional/account_controller_test.rb b/test/functional/account_controller_test.rb index af994aa..65a7864 100644 --- a/test/functional/account_controller_test.rb +++ b/test/functional/account_controller_test.rb @@ -574,6 +574,7 @@ class AccountControllerTest < ActionController::TestCase should 'use the current environment for the template of user' do template = create_user('test_template', :email => 'test@bli.com', :password => 'pass', :password_confirmation => 'pass').person + template.is_template = true template.boxes.destroy_all template.boxes << Box.new template.boxes[0].blocks << Block.new diff --git a/test/functional/memberships_controller_test.rb b/test/functional/memberships_controller_test.rb index dff587f..bb24c14 100644 --- a/test/functional/memberships_controller_test.rb +++ b/test/functional/memberships_controller_test.rb @@ -134,7 +134,7 @@ class MembershipsControllerTest < ActionController::TestCase end should 'use the current environment for the template of user' do - template = Community.create!(:identifier => 'test_template', :name => 'test@bli.com') + template = Community.create!(:identifier => 'test_template', :name => 'test@bli.com', :is_template => true) template.boxes.destroy_all template.boxes << Box.new template.boxes[0].blocks << Block.new diff --git a/test/unit/enterprise_test.rb b/test/unit/enterprise_test.rb index 2ae1089..4c16231 100644 --- a/test/unit/enterprise_test.rb +++ b/test/unit/enterprise_test.rb @@ -157,7 +157,7 @@ class EnterpriseTest < ActiveSupport::TestCase end should 'replace template if environment allows' do - template = fast_create(Enterprise, :name => 'template enteprise', :identifier => 'template_enterprise', :enabled => false) + template = fast_create(Enterprise, :name => 'template enteprise', :identifier => 'template_enterprise', :enabled => false, :is_template => true) template.boxes.destroy_all template.boxes << Box.new template.boxes[0].blocks << Block.new @@ -178,7 +178,7 @@ class EnterpriseTest < ActiveSupport::TestCase end should 'not replace template if environment doesnt allow' do - inactive_template = fast_create(Enterprise, :name => 'inactive enteprise template', :identifier => 'inactive_enterprise_template') + inactive_template = fast_create(Enterprise, :name => 'inactive enteprise template', :identifier => 'inactive_enterprise_template', :is_template => true) inactive_template.boxes.destroy_all inactive_template.boxes << Box.new inactive_template.save! @@ -358,7 +358,7 @@ class EnterpriseTest < ActiveSupport::TestCase end should 'have inactive_template when creating enterprise and feature is enabled' do - inactive_template = fast_create(Enterprise, :name => 'inactive enteprise template', :identifier => 'inactive_enterprise_template') + inactive_template = fast_create(Enterprise, :name => 'inactive enteprise template', :identifier => 'inactive_enterprise_template', :is_template => true) inactive_template.boxes.destroy_all inactive_template.boxes << Box.new inactive_template.save! @@ -373,7 +373,7 @@ class EnterpriseTest < ActiveSupport::TestCase end should 'have active_template when creating enterprise and feature is disabled' do - inactive_template = fast_create(Enterprise, :name => 'inactive enteprise template', :identifier => 'inactive_enterprise_template') + inactive_template = fast_create(Enterprise, :name => 'inactive enteprise template', :identifier => 'inactive_enterprise_template', :is_template => true) inactive_template.boxes.destroy_all inactive_template.boxes << Box.new inactive_template.save! diff --git a/test/unit/environment_test.rb b/test/unit/environment_test.rb index 38a5e34..d7ba64c 100644 --- a/test/unit/environment_test.rb +++ b/test/unit/environment_test.rb @@ -500,15 +500,15 @@ class EnvironmentTest < ActiveSupport::TestCase should 'set templates' do e = fast_create(Environment) - comm = fast_create(Community) + comm = fast_create(Community, :is_template => true) e.community_template = comm assert_equal comm, e.community_template - person = fast_create(Person) + person = fast_create(Person, :is_template => true) e.person_template = person assert_equal person, e.person_template - enterprise = fast_create(Enterprise) + enterprise = fast_create(Enterprise, :is_template => true) e.enterprise_template = enterprise assert_equal enterprise, e.enterprise_template end -- libgit2 0.21.2