Commit ca91bfe73db3c28191cc769e7e0606bf8299021d
1 parent
90b02139
Exists in
master
and in
22 other branches
test if category is nil before try to get color
(ActionItem2915)
Showing
2 changed files
with
7 additions
and
1 deletions
Show diff stats
app/helpers/categories_helper.rb
test/unit/categories_helper_test.rb
| ... | ... | @@ -31,4 +31,10 @@ class CategoriesHelperTest < ActiveSupport::TestCase |
| 31 | 31 | assert_equal '', category_color_style(category2) |
| 32 | 32 | end |
| 33 | 33 | |
| 34 | + should 'not return category parent color if category is nil' do | |
| 35 | + assert_nothing_raised do | |
| 36 | + assert_equal '', category_color_style(nil) | |
| 37 | + end | |
| 38 | + end | |
| 39 | + | |
| 34 | 40 | end | ... | ... |