Commit 80516055f3996901804be7e579da5193d6312abc
1 parent
1dd1cd53
Exists in
master
and in
29 other branches
ActionItem11: some tests added to the profile and the enterprise controller
git-svn-id: https://svn.colivre.coop.br/svn/noosfero/trunk@331 3f533792-8f58-4932-b0fe-aaf55b0a4547
Showing
8 changed files
with
20 additions
and
4 deletions
Show diff stats
app/controllers/manage_tags_controller.rb
app/views/enterprise/_form.rhtml
... | ... | @@ -26,7 +26,7 @@ |
26 | 26 | <%= text_area 'organization_info', 'management_information', 'cols' => 40, 'rows' => 20 %></p> |
27 | 27 | |
28 | 28 | <p><label for="validation_entity"><%= _('Validation Entity') %></label><br/> |
29 | -<%= select 'validation_entity', 'id', @validation_entities.map{|v| [v.name, v.id] } %></p> | |
29 | +<%= select 'validation_entity', 'id', @validation_entities.map{|v| [v.name, v.id]}, :include_blank => true %></p> | |
30 | 30 | |
31 | 31 | <p><label for="tag_list"><%= _('Tags') %></label><br/> |
32 | 32 | <%= text_field 'enterprise', 'tag_list', 'size' => 20 %></p> | ... | ... |
config/environment.rb
lib/extended_tag.rb
test/fixtures/profiles.yml
test/functional/enterprise_controller_test.rb
test/unit/profile_test.rb
... | ... | @@ -63,4 +63,17 @@ class ProfileTest < Test::Unit::TestCase |
63 | 63 | assert !p.errors.invalid?(:name) |
64 | 64 | end |
65 | 65 | |
66 | + def test_can_be_tagged | |
67 | + p = Profile.create(:name => 'tagged_profile', :identifier => 'tagged') | |
68 | + p.tags << Tag.create(:name => 'a_tag') | |
69 | + assert Profile.find_tagged_with('a_tag').include?(p) | |
70 | + end | |
71 | + | |
72 | + def test_can_have_affiliated_people | |
73 | + pr = Profile.create(:name => 'composite_profile', :identifier => 'composite') | |
74 | + pe = User.create(:login => 'aff', :email => 'aff@pr.coop', :password => 'blih', :password_confirmation => 'blih').person | |
75 | + pr.people << pe | |
76 | + | |
77 | + assert pe.profiles.include?(pr) | |
78 | + end | |
66 | 79 | end | ... | ... |