Commit baa05c228415deb0890edd715e714f14fab131c3
1 parent
961101be
Exists in
master
and in
29 other branches
Suggested articles are not highlighted by default
(ActionItem1858)
Showing
2 changed files
with
9 additions
and
1 deletions
Show diff stats
app/models/suggest_article.rb
| @@ -15,7 +15,7 @@ class SuggestArticle < Task | @@ -15,7 +15,7 @@ class SuggestArticle < Task | ||
| 15 | settings_items :article_parent_id, :type => String | 15 | settings_items :article_parent_id, :type => String |
| 16 | settings_items :source, :type => String | 16 | settings_items :source, :type => String |
| 17 | settings_items :source_name, :type => String | 17 | settings_items :source_name, :type => String |
| 18 | - settings_items :highlighted, :type => :boolean | 18 | + settings_items :highlighted, :type => :boolean, :default => false |
| 19 | 19 | ||
| 20 | def sender | 20 | def sender |
| 21 | "#{name} (#{email})" | 21 | "#{name} (#{email})" |
test/unit/suggest_article_test.rb
| @@ -113,6 +113,14 @@ class SuggestArticleTest < ActiveSupport::TestCase | @@ -113,6 +113,14 @@ class SuggestArticleTest < ActiveSupport::TestCase | ||
| 113 | assert article.highlighted | 113 | assert article.highlighted |
| 114 | end | 114 | end |
| 115 | 115 | ||
| 116 | + should 'not be highlighted by default' do | ||
| 117 | + t = build(SuggestArticle, :target => @profile) | ||
| 118 | + t.perform | ||
| 119 | + | ||
| 120 | + article = TinyMceArticle.last(:conditions => { :name => t.article_name}) | ||
| 121 | + assert_equal false, article.highlighted | ||
| 122 | + end | ||
| 123 | + | ||
| 116 | should 'override target notification message method from Task' do | 124 | should 'override target notification message method from Task' do |
| 117 | task = build(SuggestArticle, :target => @profile) | 125 | task = build(SuggestArticle, :target => @profile) |
| 118 | assert_nothing_raised NotImplementedError do | 126 | assert_nothing_raised NotImplementedError do |