Commit ffbfbfa307e5389ab8179ecd61a75366f3eab2c7
1 parent
de19d380
Exists in
master
and in
29 other branches
ActionItem480: message for disabled enterprise is displayed for
non-enterprises git-svn-id: https://svn.colivre.coop.br/svn/noosfero/trunk@2088 3f533792-8f58-4932-b0fe-aaf55b0a4547
Showing
4 changed files
with
17 additions
and
3 deletions
Show diff stats
app/views/content_viewer/view_page.rhtml
app/views/profile/index.rhtml
test/functional/content_viewer_controller_test.rb
... | ... | @@ -266,4 +266,11 @@ class ContentViewerControllerTest < Test::Unit::TestCase |
266 | 266 | assert_tag :tag => 'div', :attributes => { :id => 'profile-disabled' }, :content => Environment.default.message_for_disabled_enterprise |
267 | 267 | end |
268 | 268 | |
269 | + should 'not show message for disabled enterprise to non-enterprises' do | |
270 | + login_as(@profile.identifier) | |
271 | + @profile.enabled = false; @profile.save! | |
272 | + get :view_page, :profile => @profile.identifier, :page => [] | |
273 | + assert_no_tag :tag => 'div', :attributes => { :id => 'profile-disabled' }, :content => Environment.default.message_for_disabled_enterprise | |
274 | + end | |
275 | + | |
269 | 276 | end | ... | ... |
test/functional/profile_controller_test.rb
... | ... | @@ -213,13 +213,20 @@ class ProfileControllerTest < Test::Unit::TestCase |
213 | 213 | assert_no_tag :tag => 'a', :content => 'Add friend' |
214 | 214 | end |
215 | 215 | |
216 | - should 'show message for disabled enterprises' do | |
216 | + should 'show message for disabled enterprise' do | |
217 | 217 | login_as(@profile.identifier) |
218 | 218 | ent = Enterprise.create!(:name => 'my test enterprise', :identifier => 'my-test-enterprise', :enabled => false) |
219 | 219 | get :index, :profile => ent.identifier |
220 | 220 | assert_tag :tag => 'div', :attributes => { :id => 'profile-disabled' }, :content => Environment.default.message_for_disabled_enterprise |
221 | 221 | end |
222 | 222 | |
223 | + should 'not show message for disabled enterprise to non-enterprises' do | |
224 | + login_as(@profile.identifier) | |
225 | + @profile.enabled = false; @profile.save! | |
226 | + get :index, :profile => @profile.identifier | |
227 | + assert_no_tag :tag => 'div', :attributes => { :id => 'profile-disabled' }, :content => Environment.default.message_for_disabled_enterprise | |
228 | + end | |
229 | + | |
223 | 230 | should 'display "Products" link for enterprise' do |
224 | 231 | ent = Enterprise.create!(:name => 'my test enterprise', :identifier => 'my-test-enterprise', :enabled => false) |
225 | 232 | ... | ... |