adding a few tests
This commit is contained in:
@@ -38,4 +38,8 @@ class Comment < ActiveRecord::Base
|
||||
def children_count
|
||||
children.count
|
||||
end
|
||||
|
||||
def descendants_count
|
||||
descendants.count
|
||||
end
|
||||
end
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user