diff --git a/app/models/environment.rb b/app/models/environment.rb index fd9c5c1..fea6b00 100644 --- a/app/models/environment.rb +++ b/app/models/environment.rb @@ -39,6 +39,8 @@ class Environment < ActiveRecord::Base has_many :profiles has_many :organizations + has_many :enterprises + has_many :people has_many :categories has_many :display_categories, :class_name => 'Category', :conditions => 'display_color is not null and parent_id is null', :order => 'display_color' diff --git a/test/test_helper.rb b/test/test_helper.rb index a208b89..35ea43d 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -63,11 +63,14 @@ class Test::Unit::TestCase env end - def create_user(name) - User.create!(:login => name, - :email => name + '@noosfero.org', - :password => name.underscore, - :password_confirmation => name.underscore) + def create_user(name, options = {}) + data = { + :login => name, + :email => name + '@noosfero.org', + :password => name.underscore, + :password_confirmation => name.underscore + }.merge(options) + User.create!(data) end def create_user_with_permission(name, permission, target= nil) diff --git a/test/unit/enterprise_test.rb b/test/unit/enterprise_test.rb index cdf338a..be7b4b3 100644 --- a/test/unit/enterprise_test.rb +++ b/test/unit/enterprise_test.rb @@ -54,8 +54,6 @@ class EnterpriseTest < Test::Unit::TestCase assert_difference Product, :count, -2 do e.destroy end - - end end -- libgit2 0.21.2