Commit fe0c4489ca34879745fc4bb504f50f1b0c258aa0
Committed by
Joenio Costa
1 parent
bdef49f5
Exists in
master
and in
29 other branches
Not displaying description if it is blank
(ActionItem1547)
Showing
2 changed files
with
19 additions
and
6 deletions
Show diff stats
app/views/profile/index.rhtml
... | ... | @@ -4,12 +4,12 @@ |
4 | 4 | |
5 | 5 | <% if @action %> |
6 | 6 | <%= render :partial => 'private_profile' %> |
7 | -<% end %> | |
8 | - | |
9 | -<% if !@action %> | |
10 | - <div class='public-profile-description'> | |
11 | - <%= profile.description %> | |
12 | - </div> | |
7 | +<% else %> | |
8 | + <% unless profile.description.blank? %> | |
9 | + <div class='public-profile-description'> | |
10 | + <%= profile.description %> | |
11 | + </div> | |
12 | + <% end %> | |
13 | 13 | <% end %> |
14 | 14 | |
15 | 15 | <table class='profile'> | ... | ... |
test/functional/profile_controller_test.rb
... | ... | @@ -683,6 +683,19 @@ class ProfileControllerTest < Test::Unit::TestCase |
683 | 683 | assert_tag :tag => 'div', :attributes => { :class => 'public-profile-description' }, :content => /Person\'s description/ |
684 | 684 | end |
685 | 685 | |
686 | + should 'not show description of orgarnization if not filled' do | |
687 | + login_as(@profile.identifier) | |
688 | + ent = fast_create(Enterprise) | |
689 | + get :index, :profile => ent.identifier | |
690 | + assert_no_tag :tag => 'div', :attributes => { :class => 'public-profile-description' } | |
691 | + end | |
692 | + | |
693 | + should 'not show description of person if not filled' do | |
694 | + login_as(@profile.identifier) | |
695 | + get :index, :profile => @profile.identifier | |
696 | + assert_no_tag :tag => 'div', :attributes => { :class => 'public-profile-description' } | |
697 | + end | |
698 | + | |
686 | 699 | should 'ask for login if user not logged' do |
687 | 700 | enterprise = fast_create(Enterprise) |
688 | 701 | get :unblock, :profile => enterprise.identifier | ... | ... |