From f7932a0db2be91c3fca1f7ac293cf5ea667a0d07 Mon Sep 17 00:00:00 2001 From: AntonioTerceiro Date: Mon, 28 Jan 2008 15:11:55 +0000 Subject: [PATCH] ActionItem153: adding needed relationships to Environment --- app/models/environment.rb | 2 ++ test/test_helper.rb | 13 ++++++++----- test/unit/enterprise_test.rb | 2 -- 3 files changed, 10 insertions(+), 7 deletions(-) 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