Skip to content

Commit

Permalink
Merge pull request #9 from choonkeat/master
Browse files Browse the repository at this point in the history
Fix #winston/rails_utils/7 do not render flash[:timedout]
  • Loading branch information
winston committed Nov 5, 2014
2 parents 44951ef + dd05551 commit 239a13f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/rails_utils.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ def javascript_initialization
def flash_messages(options = {})
flash.collect do |key, message|
next if message.blank?
next if key.to_s == 'timedout'

content_tag(:div, content_tag(:button, options[:button_html] || "x", type: "button", class: options[:button_class] || "close", "data-dismiss" => "alert") + message, class: "#{flash_class(key)} fade in #{options[:class]}")
end.join("\n").html_safe
Expand Down
5 changes: 5 additions & 0 deletions test/rails_utils_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -206,5 +206,10 @@ def set_flash(key, message)
end
end

it "should skip flash[:timedout]" do
set_flash :timedout, "not important"
view.flash_messages.must_equal ""
end

end
end

0 comments on commit 239a13f

Please sign in to comment.