diff --git a/app/helpers/comments_helper.rb b/app/helpers/comments_helper.rb index 8e8aae90c..5c41b3432 100644 --- a/app/helpers/comments_helper.rb +++ b/app/helpers/comments_helper.rb @@ -1,11 +1,11 @@ module CommentsHelper def comment_link_text(parent) - parent.class == Debate ? "Comentar" : "Responder" + parent.class == Debate ? t("comments_helper.comment_link") : t("comments_helper.reply_link") end def comment_button_text(parent) - parent.class == Debate ? "Publicar comentario" : "Publicar respuesta" + parent.class == Debate ? t("comments_helper.comment_button") : t("comments_helper.reply_button") end end \ No newline at end of file diff --git a/config/locales/en.yml b/config/locales/en.yml index 9bcc65400..7842b7e0b 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -39,6 +39,11 @@ en: new: publish_new: Publish new debate back_link: Back + comments_helper: + comment_link: Comment + comment_button: Publish comment + reply_link: Reply + reply_button: Publish reply votes: notice_thanks: "Thanks for voting." notice_already_registered: "Your vote is already registered." diff --git a/config/locales/es.yml b/config/locales/es.yml index b702eb1fd..eb36d241a 100644 --- a/config/locales/es.yml +++ b/config/locales/es.yml @@ -39,6 +39,11 @@ es: new: publish_new: Publicar debate nuevo back_link: Volver + comments_helper: + comment_link: Comentar + comment_button: Publicar comentario + reply_link: Responder + reply_button: Publicar respuesta votes: notice_thanks: "Gracias por votar." notice_already_registered: "Tu voto ya ha sido registrado." diff --git a/spec/features/comments_spec.rb b/spec/features/comments_spec.rb index 624ac5b7e..b5293afa0 100644 --- a/spec/features/comments_spec.rb +++ b/spec/features/comments_spec.rb @@ -26,10 +26,10 @@ feature 'Comments' do login_as(user) visit debate_path(debate) - click_on 'Comentar' + click_on 'Comment' fill_in 'comment_body', with: '¿Has pensado en esto...?' - click_button 'Publicar comentario' + click_button 'Publish comment' within "#comments" do expect(page).to have_content '¿Has pensado en esto...?' @@ -45,10 +45,10 @@ feature 'Comments' do login_as(manuela) visit debate_path(debate) - click_link "Responder" + click_link "Reply" within "#js-comment-form-comment_#{comment.id}" do fill_in 'comment_body', with: 'La semana que viene está hecho.' - click_button 'Publicar respuesta' + click_button 'Publish reply' end within "#comment-#{comment.id}" do