diff --git a/app/views/debates/show.html.erb b/app/views/debates/show.html.erb index 87b3ffd24..ec8a99422 100644 --- a/app/views/debates/show.html.erb +++ b/app/views/debates/show.html.erb @@ -30,7 +30,7 @@
-

<%= @debate.total_votes %> votos

+

<%= pluralize(@debate.total_votes, 'voto', 'votos') %> votos

diff --git a/app/views/devise/registrations/new.html.erb b/app/views/devise/registrations/new.html.erb index 8c4da21cd..695586600 100644 --- a/app/views/devise/registrations/new.html.erb +++ b/app/views/devise/registrations/new.html.erb @@ -33,7 +33,7 @@
- <%= f.submit "Sign up" %> + <%= f.submit "Registrarse" %>
<% end %> diff --git a/app/views/devise/sessions/new.html.erb b/app/views/devise/sessions/new.html.erb index b261cfd15..ba96a7ecd 100644 --- a/app/views/devise/sessions/new.html.erb +++ b/app/views/devise/sessions/new.html.erb @@ -19,7 +19,7 @@ <% end -%>
- <%= f.submit "Log in" %> + <%= f.submit "Entrar" %>
<% end %> diff --git a/spec/features/debates_spec.rb b/spec/features/debates_spec.rb index df1b8bb3c..f0b5b346b 100644 --- a/spec/features/debates_spec.rb +++ b/spec/features/debates_spec.rb @@ -11,8 +11,8 @@ feature 'Debates' do within first('.debate') do expect(page).to have_content "Debate title" expect(page).to have_content "Debate description" - expect(page).to have_content "Creado el: #{I18n.l Date.today}" - expect(page).to have_content "por: #{Debate.first.author.name}" + expect(page).to have_content "Por #{Debate.first.author.name}" + expect(page).to have_content "el #{I18n.l Date.today}" end end @@ -23,8 +23,8 @@ feature 'Debates' do expect(page).to have_content "Debate title" expect(page).to have_content "Debate description" - expect(page).to have_content "Creado el: #{I18n.l Date.today}" - expect(page).to have_content "por: #{debate.author.name}" + expect(page).to have_content "Por #{debate.author.name}" + expect(page).to have_content "el #{I18n.l Date.today}" end scenario 'Create' do @@ -41,8 +41,8 @@ feature 'Debates' do expect(page).to have_content 'Debate creado correctamente' expect(page).to have_content 'Acabar con los desahucios' expect(page).to have_content 'Esto es un tema muy importante porque...' - expect(page).to have_content "Creado el: #{I18n.l Date.today}" - expect(page).to have_content "por: #{author.name}" + expect(page).to have_content "Por #{author.name}" + expect(page).to have_content "el #{I18n.l Date.today}" end scenario 'Update should not be posible if logged user is not the author' do diff --git a/spec/features/tags_spec.rb b/spec/features/tags_spec.rb index 5df827f52..06d5c1391 100644 --- a/spec/features/tags_spec.rb +++ b/spec/features/tags_spec.rb @@ -9,11 +9,11 @@ feature 'Tags' do visit debates_path within "#debate-#{earth.id}" do - expect(page).to have_content "Temas: Medio Ambiente" + expect(page).to have_content "Medio Ambiente" end within "#debate-#{money.id}" do - expect(page).to have_content "Temas: Economía" + expect(page).to have_content "Economía" end end @@ -24,9 +24,11 @@ feature 'Tags' do visit debates_path first(:link, "Salud").click - expect(page).to have_css('.debate', count: 2) - expect(page).to have_content('Temas: Salud') - expect(page).to_not have_content('Temas: Hacienda') + within('#debates') do + expect(page).to have_css('.debate', count: 2) + expect(page).to have_content('Salud') + expect(page).to_not have_content('Hacienda') + end end scenario 'Show' do @@ -34,7 +36,7 @@ feature 'Tags' do visit debate_path(debate) - expect(page).to have_content "Temas: Economía, Hacienda" + expect(page).to have_content "Economía, Hacienda" end scenario 'Tag Cloud' do @@ -65,7 +67,7 @@ feature 'Tags' do click_button 'Crear Debate' expect(page).to have_content 'Debate creado correctamente' - expect(page).to have_content 'Temas: Economía, Hacienda, Impuestos' + expect(page).to have_content 'Economía, Hacienda, Impuestos' end scenario 'Update' do @@ -80,7 +82,7 @@ feature 'Tags' do click_button 'Actualizar Debate' expect(page).to have_content 'Debate actualizado correctamente' - expect(page).to have_content 'Temas: Economía, Hacienda' + expect(page).to have_content 'Economía, Hacienda' end scenario 'Delete' do @@ -93,7 +95,7 @@ feature 'Tags' do click_button 'Actualizar Debate' expect(page).to have_content 'Debate actualizado correctamente' - expect(page).to_not have_content 'Temas:' + expect(page).to_not have_content 'Economía' end end \ No newline at end of file diff --git a/spec/features/users_spec.rb b/spec/features/users_spec.rb index 30755c56f..e0fbb1edd 100644 --- a/spec/features/users_spec.rb +++ b/spec/features/users_spec.rb @@ -4,8 +4,7 @@ feature 'Users' do scenario 'Sign up' do visit '/' - click_link 'Login' - click_link 'Sign up' + click_link 'Registrarse' fill_in 'user_first_name', with: 'Manuela' fill_in 'user_last_name', with: 'Carmena' @@ -13,7 +12,7 @@ feature 'Users' do fill_in 'user_password', with: 'judgementday' fill_in 'user_password_confirmation', with: 'judgementday' - click_button 'Sign up' + click_button 'Registrarse' expect(page).to have_content '¡Bienvenido! Has sido identificado.' end @@ -22,10 +21,10 @@ feature 'Users' do user = create(:user, email: 'manuela@madrid.es', password: 'judgementday') visit '/' - click_link 'Login' + click_link 'Entrar' fill_in 'user_email', with: 'manuela@madrid.es' fill_in 'user_password', with: 'judgementday' - click_button 'Log in' + click_button 'Entrar' expect(page).to have_content 'Has iniciado sesión correctamente.' end @@ -35,7 +34,7 @@ feature 'Users' do login_as(user) visit "/" - click_link 'Logout' + click_link 'Salir' expect(page).to have_content 'Has cerrado la sesión correctamente.' end diff --git a/spec/features/votes_spec.rb b/spec/features/votes_spec.rb index fb4fc29dd..f5399c9b1 100644 --- a/spec/features/votes_spec.rb +++ b/spec/features/votes_spec.rb @@ -17,7 +17,7 @@ feature 'Votes' do visit debate_path(@debate) - expect(page).to have_content "Votos 2" + expect(page).to have_content "2 votos" within('#in_favor') do expect(page).to have_content "50%" @@ -29,21 +29,21 @@ feature 'Votes' do end scenario 'Create' do - click_link 'up' + find('#in_favor a').click expect(page).to have_content "Gracias por votar" end scenario 'Update' do - click_link 'up' - click_link 'down' + find('#in_favor a').click + find('#against a').click expect(page).to have_content "Gracias por votar" end scenario 'Trying to vote multiple times' do - click_link 'up' - click_link 'up' + find('#in_favor a').click + find('#in_favor a').click expect(page).to have_content "Tu voto ya ha sido registrado" - expect(page).to have_content "Votos 1" + expect(page).to have_content "1 voto" end end \ No newline at end of file