[Git][noosfero/noosfero][master] 3 commits: removing test helpers that already in Rails core

Bráulio Bhavamitra gitlab at gitlab.com
Mon Aug 10 20:46:15 BRT 2015


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


Commits:
b8070448 by Joenio Costa at 2015-07-31T12:26:33Z
removing test helpers that already in Rails core

- - - - -
54127654 by Joenio Costa at 2015-07-31T12:34:42Z
removing helper that can be simulated by Rails core assertions

- - - - -
cff14440 by Braulio Bhavamitra at 2015-08-10T20:45:41Z
Merge branch 'removing-unusefull-code' into noosfero

- - - - -


2 changed files:

- test/test_helper.rb
- test/unit/tiny_mce_article_test.rb


Changes:

=====================================
test/test_helper.rb
=====================================
--- a/test/test_helper.rb
+++ b/test/test_helper.rb
@@ -88,14 +88,6 @@ class ActiveSupport::TestCase
     assert( ((enum1 - enum2) == []) && ((enum2 - enum1) == []), "<#{enum1.inspect}> expected to be equivalent to <#{enum2.inspect}>")
   end
 
-  def assert_includes(array, element)
-    assert(array.include?(element), "<#{array.inspect}> expected to include <#{element.inspect}>")
-  end
-
-  def assert_not_includes(array, element)
-    assert(!array.include?(element), "<#{array.inspect}> expected to NOT include <#{element.inspect}>")
-  end
-
   def assert_mandatory(object, attribute, test_value = 'some random string')
     object.send("#{attribute}=", nil)
     object.valid?
@@ -111,10 +103,6 @@ class ActiveSupport::TestCase
     assert !object.errors[attribute.to_s].present?
   end
 
-  def assert_subclass(parent, child)
-    assert_equal parent, child.superclass, "Class #{child} expected to be a subclass of #{parent}"
-  end
-
   # this check only if text has html tag
   def assert_sanitized(text)
     assert !text.index('<'), "Text '#{text}' expected to be sanitized"


=====================================
test/unit/tiny_mce_article_test.rb
=====================================
--- a/test/unit/tiny_mce_article_test.rb
+++ b/test/unit/tiny_mce_article_test.rb
@@ -11,7 +11,7 @@ class TinyMceArticleTest < ActiveSupport::TestCase
 
   # this test can be removed when we get real tests for TinyMceArticle
   should 'be an article' do
-    assert_subclass TextArticle, TinyMceArticle
+    assert_kind_of TextArticle, TinyMceArticle.new
   end
 
   should 'define description' do



View it on GitLab: https://gitlab.com/noosfero/noosfero/compare/088c792e86414670f5dad67dad6def42add07acc...cff1444052b81d7281a6e6a4254d05510e5a7201
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listas.softwarelivre.org/pipermail/noosfero-dev/attachments/20150810/404e87ab/attachment.html>


More information about the Noosfero-dev mailing list