Permalink
Browse files

fix specs

  • Loading branch information...
1 parent 45c5561 commit dbc47e57e3095848fbfd71a5de693eb0de245991 @plukevdh plukevdh committed Apr 23, 2012
Showing with 11 additions and 6 deletions.
  1. +4 −1 app/models/arturo/feature.rb
  2. +7 −5 test/dummy_app/test/unit/features_helper_test.rb
@@ -29,8 +29,11 @@ def self.to_feature(feature_or_symbol)
end
# Create a new Feature
+ # @param [Hash, nil] attribute hash to set on new object
+ # @param [Hash, nil]
+ # @return [Arturo::Feature] newly initialized feature
def initialize(attributes = {}, options = {})
- super(DEFAULT_ATTRIBUTES.merge(attributes), options)
+ super(DEFAULT_ATTRIBUTES.merge(attributes || {}), options)
end
# @param [Object] feature_recipient a User, Account,
@@ -15,13 +15,13 @@ def initialize
end
def bad_feature
- feature = Factory(:feature)
+ feature = Factory(:feature)
feature.deployment_percentage = 101
feature.valid?
return feature
end
end
-
+
def test_error_messages_for
output = "<ul class=\"errors\"><li class=\"error\">must be less than or equal to 100</li></ul>"
@@ -32,8 +32,10 @@ def test_error_messages_for
:virtual_path => "partial"
)
- assert_equal output, template_result.render( Context.new, {} )
- assert template_result.render( Context.new, {} ).html_safe?
-
+ result = template_result.render( Context.new, {} )
+
+ assert_equal output, result
+ assert result.html_safe?
+
end
end

0 comments on commit dbc47e5

Please sign in to comment.