diff --git a/app/models/comment.rb b/app/models/comment.rb index cac51a482..f298c67c3 100644 --- a/app/models/comment.rb +++ b/app/models/comment.rb @@ -38,4 +38,8 @@ class Comment < ActiveRecord::Base def children_count children.count end + + def descendants_count + descendants.count + end end diff --git a/config/locales/en.yml b/config/locales/en.yml index 1b64977ff..5a60019aa 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -25,8 +25,8 @@ en: other: "%{count} Comments" votes: zero: No votes - one: 1 Vote - other: "%{count} Votes" + one: 1 vote + other: "%{count} votes" comment: responses: zero: No Responses @@ -34,8 +34,8 @@ en: other: "%{count} Responses" votes: zero: No votes - one: 1 Vote - other: "%{count} Votes" + one: 1 vote + other: "%{count} votes" votes_weighted_score: "Total: %{score}" form: error: error diff --git a/config/locales/es.yml b/config/locales/es.yml index 0b8701f18..32fd051c3 100644 --- a/config/locales/es.yml +++ b/config/locales/es.yml @@ -25,8 +25,8 @@ es: other: "%{count} Comentarios" votes: zero: Sin votos - one: 1 Voto - other: "%{count} Votos" + one: 1 voto + other: "%{count} votos" comment: responses: zero: Sin respuestas @@ -34,8 +34,8 @@ es: other: "%{count} Respuestas" votes: zero: Sin votos - one: 1 Voto - other: "%{count} Votos" + one: 1 voto + other: "%{count} votos" votes_weighted_score: "Total: %{score}" form: error: error diff --git a/spec/features/comments_spec.rb b/spec/features/comments_spec.rb index 7025ae57e..d1763b6cd 100644 --- a/spec/features/comments_spec.rb +++ b/spec/features/comments_spec.rb @@ -88,7 +88,7 @@ feature 'Comments' do expect(page).to have_content I18n.t('debates.debate.comments', count: 8) within first('.comment') do - expect(page).to have_content I18n.t('debates.comment.responses', count: 7) + expect(page).to have_content I18n.t('debates.comment.responses', count: 1) end end diff --git a/spec/features/votes_spec.rb b/spec/features/votes_spec.rb index 606dc3c74..3c7bf6fb4 100644 --- a/spec/features/votes_spec.rb +++ b/spec/features/votes_spec.rb @@ -112,7 +112,7 @@ feature 'Votes' do scenario 'Show no votes' do visit debate_path(@debate) - expect(page).to have_content "0 votes" + expect(page).to have_content "No votes" within('.in-favor') do expect(page).to have_content "0%" @@ -263,6 +263,8 @@ feature 'Votes' do within(".against") do expect(page).to have_content "1" end + + expect(page).to have_content "2 votes" end end @@ -277,6 +279,8 @@ feature 'Votes' do within(".against") do expect(page).to have_content "0" end + + expect(page).to have_content "1 vote" end end @@ -292,6 +296,8 @@ feature 'Votes' do within('.against') do expect(page).to have_content "1" end + + expect(page).to have_content "1 vote" end end @@ -307,6 +313,8 @@ feature 'Votes' do within('.against') do expect(page).to have_content "0" end + + expect(page).to have_content "1 vote" end end