From 42fa50c175e5c1b8ee9d4043f5e8aae3080c7572 Mon Sep 17 00:00:00 2001 From: Jeffrey Warren Date: Tue, 6 Oct 2020 19:19:16 -0400 Subject: [PATCH] Remove grey/green checkboxes (#8471) * Remove grey/green checkboxes * remove answered and has_accepted_answers methods * remove answers unit tests --- app/models/node.rb | 8 -------- app/views/grids/_notes.html.erb | 7 ------- test/unit/node_test.rb | 14 -------------- 3 files changed, 29 deletions(-) diff --git a/app/models/node.rb b/app/models/node.rb index 78c28e9fc2..7cf4838715 100644 --- a/app/models/node.rb +++ b/app/models/node.rb @@ -253,14 +253,6 @@ def files drupal_files end - def answered - answers&.size&.positive? - end - - def has_accepted_answers - answers.where(accepted: true).size.positive? - end - # users who like this node def likers node_selections diff --git a/app/views/grids/_notes.html.erb b/app/views/grids/_notes.html.erb index 577beab78b..1011f31303 100644 --- a/app/views/grids/_notes.html.erb +++ b/app/views/grids/_notes.html.erb @@ -41,13 +41,6 @@ <% if node.has_tag("pin:#{tagname}") %> <% elsif node.has_tag("pin:question:#{tagname}") %> <% end %> - <% if node.answered %> - <% if node.has_accepted_answers %> - - <% else %> - - <% end %> - <% end %> <%= node.title %> @<%= node.author.username %> <%=node.author.new_contributor %> diff --git a/test/unit/node_test.rb b/test/unit/node_test.rb index 3e6de75bba..a07125d5fe 100644 --- a/test/unit/node_test.rb +++ b/test/unit/node_test.rb @@ -14,17 +14,11 @@ def setup node = nodes(:about) assert_equal 'page', node.type assert_equal 1, node.status - assert !node.answered assert_equal [], node.location_tags assert node.body assert node.summary end - test 'basic question attributes' do - question = nodes(:question) - assert question.answered - end - test 'basic location attributes' do map = nodes(:map) map.add_tag('lat:123', users(:bob)) @@ -417,14 +411,6 @@ def setup assert_equal 'Jingle Jingle Bells', node.body end - test "question has an accepted answer" do - question2 = nodes(:question2) - assert !question2.has_accepted_answers - - question = nodes(:question) - assert question.has_accepted_answers - end - test "user likes node or not" do node = nodes(:one) user = users(:jeff)