[Git][noosfero/noosfero][master] 2 commits: environment: list regions on top level categories

Rodrigo Souto gitlab at mg.gitlab.com
Wed Aug 8 07:43:38 BRT 2018


Rodrigo Souto pushed to branch master at Noosfero / noosfero


Commits:
80d24d77 by Rodrigo Souto at 2018-08-07T21:23:38Z
environment: list regions on top level categories

- - - - -
7e778d2d by Rodrigo Souto at 2018-08-08T10:43:34Z
Merge branch 'article-show-regions' into 'master'

Article show regions

See merge request noosfero/noosfero!1596
- - - - -


2 changed files:

- app/models/environment.rb
- test/functional/profile_editor_controller_test.rb


Changes:

=====================================
app/models/environment.rb
=====================================
@@ -751,7 +751,7 @@ class Environment < ApplicationRecord
 
   # returns an array with the top level categories for this environment.
   def top_level_categories
-    Category.top_level_for(self).where(type: 'Category')
+		Category.top_level_for(self).where("type = ? or type = ?", "Category", "Region")
   end
 
   # returns an array with the top level regions for this environment.


=====================================
test/functional/profile_editor_controller_test.rb
=====================================
@@ -85,9 +85,9 @@ class ProfileEditorControllerTest < ActionController::TestCase
     profile.update_attributes(category_ids: [region.id, category.id])
 
     get :categories, :profile => profile.identifier
-    assert_no_tag :tag => 'div', :content => profile_region.name,
+    assert_tag :tag => 'div', :content => profile_region.name,
                :ancestor => { :tag => 'div', :attributes => { :id => 'category-ajax-selector'}}
-    assert_no_tag :tag => 'div', :content => region.name,
+    assert_tag :tag => 'div', :content => region.name,
                :ancestor => { :tag => 'div', :attributes => { :id => 'category-ajax-selector'}}
     assert_tag :tag => 'div', :content => category.name,
                :ancestor => { :tag => 'div', :attributes => { :id => 'category-ajax-selector'}}



View it on GitLab: https://gitlab.com/noosfero/noosfero/compare/41262e98dc1cd162410a0520865c69bb21ea0a6c...7e778d2dcf38a6338f43aafcfd4c0eb88eb8ab32

-- 
View it on GitLab: https://gitlab.com/noosfero/noosfero/compare/41262e98dc1cd162410a0520865c69bb21ea0a6c...7e778d2dcf38a6338f43aafcfd4c0eb88eb8ab32
You're receiving this email because of your account on gitlab.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listas.softwarelivre.org/pipermail/noosfero-dev/attachments/20180808/d7d061d4/attachment-0001.html>


More information about the Noosfero-dev mailing list