Commit 0367bb22149231c15379dbc130d3d754df461976
Exists in
master
and in
29 other branches
Merge branch 'stable'
Showing
5 changed files
with
16 additions
and
2 deletions
Show diff stats
app/controllers/application.rb
... | ... | @@ -131,6 +131,7 @@ class ApplicationController < ActionController::Base |
131 | 131 | @path ||= request.path |
132 | 132 | render :template => 'shared/not_found.rhtml', :status => 404, :layout => get_layout |
133 | 133 | end |
134 | + alias :render_404 :render_not_found | |
134 | 135 | |
135 | 136 | def render_access_denied(message = nil, title = nil) |
136 | 137 | @no_design_blocks = true | ... | ... |
app/models/suggest_article.rb
... | ... | @@ -15,7 +15,7 @@ class SuggestArticle < Task |
15 | 15 | settings_items :article_parent_id, :type => String |
16 | 16 | settings_items :source, :type => String |
17 | 17 | settings_items :source_name, :type => String |
18 | - settings_items :highlighted, :type => :boolean | |
18 | + settings_items :highlighted, :type => :boolean, :default => false | |
19 | 19 | |
20 | 20 | def sender |
21 | 21 | "#{name} (#{email})" | ... | ... |
db/schema.rb
... | ... | @@ -31,8 +31,8 @@ ActiveRecord::Schema.define(:version => 20110203160153) do |
31 | 31 | t.integer "profile_id" |
32 | 32 | end |
33 | 33 | |
34 | - add_index "action_tracker_notifications", ["action_tracker_id", "profile_id"], :name => "index_action_tracker_notifications_on_profile_id_and_action_tra", :unique => true | |
35 | 34 | add_index "action_tracker_notifications", ["action_tracker_id"], :name => "index_action_tracker_notifications_on_action_tracker_id" |
35 | + add_index "action_tracker_notifications", ["profile_id", "action_tracker_id"], :name => "index_action_tracker_notifications_on_profile_id_and_action_tracker_id", :unique => true | |
36 | 36 | add_index "action_tracker_notifications", ["profile_id"], :name => "index_action_tracker_notifications_on_profile_id" |
37 | 37 | |
38 | 38 | create_table "article_versions", :force => true do |t| | ... | ... |
test/integration/exception_notification_test.rb
... | ... | @@ -25,4 +25,9 @@ class ExceptionNotificationTest < ActionController::IntegrationTest |
25 | 25 | assert_includes ActionMailer::Base.deliveries.map(&:to).flatten, 'admin@example.com' |
26 | 26 | assert_includes ActionMailer::Base.deliveries.map(&:to).flatten, 'user@example.com' |
27 | 27 | end |
28 | + | |
29 | + should 'render not found when try to access invalid url' do | |
30 | + get '/profile/ze/tag/notexists' | |
31 | + assert_template 'not_found.rhtml' | |
32 | + end | |
28 | 33 | end | ... | ... |
test/unit/suggest_article_test.rb
... | ... | @@ -113,6 +113,14 @@ class SuggestArticleTest < ActiveSupport::TestCase |
113 | 113 | assert article.highlighted |
114 | 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 | 124 | should 'override target notification message method from Task' do |
117 | 125 | task = build(SuggestArticle, :target => @profile) |
118 | 126 | assert_nothing_raised NotImplementedError do | ... | ... |