[Git][noosfero/noosfero][master] 2 commits: assert_equivalent: fix typo (enum -> norm)

Bráulio Bhavamitra gitlab at mg.gitlab.com
Sat Dec 12 15:57:45 BRST 2015


Bráulio Bhavamitra pushed to branch master at Noosfero / noosfero


Commits:
6f2734cd by Braulio Bhavamitra at 2015-12-12T14:45:39Z
assert_equivalent: fix typo (enum -> norm)

See https://travis-ci.org/noosfero/noosfero/jobs/96468167

- - - - -
9c680ef2 by Braulio Bhavamitra at 2015-12-12T14:46:34Z
enterprise: Use has_many for #product_categories

- - - - -


2 changed files:

- app/models/enterprise.rb
- test/test_helper.rb


Changes:

=====================================
app/models/enterprise.rb
=====================================
--- a/app/models/enterprise.rb
+++ b/app/models/enterprise.rb
@@ -25,10 +25,6 @@ class Enterprise < Organization
   has_many :favorite_enterprise_people
   has_many :fans, source: :person, through: :favorite_enterprise_people
 
-  def product_categories
-    ProductCategory.by_enterprise(self)
-  end
-
   N_('Organization website'); N_('Historic and current context'); N_('Activities short description'); N_('City'); N_('State'); N_('Country'); N_('ZIP code')
 
   settings_items :organization_website, :historic_and_current_context, :activities_short_description


=====================================
test/test_helper.rb
=====================================
--- a/test/test_helper.rb
+++ b/test/test_helper.rb
@@ -89,9 +89,9 @@ class ActiveSupport::TestCase
   def assert_equivalent(enum1, enum2)
     norm1 = enum1.to_a
     norm2 = enum2.to_a
+    assert_equal norm1.size, norm2.size, "Size mismatch: #{enum1.inspect} vs #{enum2.inspect}"
     assert_equal [], norm1 - norm2
     assert_equal [], norm2 - norm1
-    assert_equal norm1.size, enum2.size, "Size mismatch: #{enum1.inspect} vs #{enum2.inspect}"
   end
 
   def assert_mandatory(object, attribute, test_value = 'some random string')



View it on GitLab: https://gitlab.com/noosfero/noosfero/compare/9a00026461eff6fbbd5d1b7a96b28a4cfe1904a0...9c680ef2f09e55cfb25909f61943502ac96caaed
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listas.softwarelivre.org/pipermail/noosfero-dev/attachments/20151212/9bdd4d05/attachment.html>


More information about the Noosfero-dev mailing list