whimsical-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sam Ruby <ru...@apache.org>
Subject [whimsy.git] [21/50] Commit 1163a84: don't show empty comments
Date Fri, 22 Jan 2016 02:40:54 GMT
Commit 1163a848c3587fd19650a058d9ec8000a846ce9b:
    don't show empty comments


Branch: refs/heads/master
Author: Sam Ruby <rubys@intertwingly.net>
Committer: Sam Ruby <rubys@intertwingly.net>
Pusher: rubys <rubys@apache.org>

------------------------------------------------------------
spec/report_spec.rb                                          | +++ 
views/agenda.js.rb                                           | + -
views/report.js.rb                                           | + -
------------------------------------------------------------
7 changes: 5 additions, 2 deletions.
------------------------------------------------------------


diff --git a/spec/report_spec.rb b/spec/report_spec.rb
index 0361685..025dde7 100644
--- a/spec/report_spec.rb
+++ b/spec/report_spec.rb
@@ -22,6 +22,9 @@
     expect(page).to have_selector 'pre', 
       text: /no issues that require the board's attention/
 
+    # no comments
+    expect(page).not_to have_selector 'h3#comments', text: 'Comments'
+
     # footer
     expect(page).to have_selector '.backlink[href="Attic"]', 
      text: 'Attic'
diff --git a/views/agenda.js.rb b/views/agenda.js.rb
index b930019..55729a9 100644
--- a/views/agenda.js.rb
+++ b/views/agenda.js.rb
@@ -46,7 +46,7 @@ def text
   # return comments as an array of individual comments
   def comments
     results = []
-    return results if @comments === undefined
+    return results unless @comments
 
     comment = ''
     @comments.split("\n").each do |line|
diff --git a/views/report.js.rb b/views/report.js.rb
index aaa41b5..05ae1cf 100644
--- a/views/report.js.rb
+++ b/views/report.js.rb
@@ -8,7 +8,7 @@ def render
         end
       end
 
-      if @@data.comments
+      unless @@data.comments.empty?
         _section do
           _h3.comments! 'Comments'
           @@data.comments.each do |comment|

Mime
View raw message