Commit f7932a0db2be91c3fca1f7ac293cf5ea667a0d07

Authored by AntonioTerceiro
1 parent 5a6724e7

ActionItem153: adding needed relationships to Environment


git-svn-id: https://svn.colivre.coop.br/svn/noosfero/trunk@1274 3f533792-8f58-4932-b0fe-aaf55b0a4547
app/models/environment.rb
... ... @@ -39,6 +39,8 @@ class Environment < ActiveRecord::Base
39 39 has_many :profiles
40 40  
41 41 has_many :organizations
  42 + has_many :enterprises
  43 + has_many :people
42 44  
43 45 has_many :categories
44 46 has_many :display_categories, :class_name => 'Category', :conditions => 'display_color is not null and parent_id is null', :order => 'display_color'
... ...
test/test_helper.rb
... ... @@ -63,11 +63,14 @@ class Test::Unit::TestCase
63 63 env
64 64 end
65 65  
66   - def create_user(name)
67   - User.create!(:login => name,
68   - :email => name + '@noosfero.org',
69   - :password => name.underscore,
70   - :password_confirmation => name.underscore)
  66 + def create_user(name, options = {})
  67 + data = {
  68 + :login => name,
  69 + :email => name + '@noosfero.org',
  70 + :password => name.underscore,
  71 + :password_confirmation => name.underscore
  72 + }.merge(options)
  73 + User.create!(data)
71 74 end
72 75  
73 76 def create_user_with_permission(name, permission, target= nil)
... ...
test/unit/enterprise_test.rb
... ... @@ -54,8 +54,6 @@ class EnterpriseTest < Test::Unit::TestCase
54 54 assert_difference Product, :count, -2 do
55 55 e.destroy
56 56 end
57   -
58   -
59 57 end
60 58  
61 59 end
... ...