fixes specs

This commit is contained in:
rgarcia
2015-07-27 23:21:15 +02:00
parent c0a5200c10
commit 137267887c
7 changed files with 32 additions and 31 deletions

View File

@@ -30,7 +30,7 @@
</div>
<div class="small-12 column text-center">
<p class="total-votes"><%= @debate.total_votes %> votos</p>
<p class="total-votes"><%= pluralize(@debate.total_votes, 'voto', 'votos') %> votos</p>
</div>
</div>
</div>

View File

@@ -33,7 +33,7 @@
</div>
<div class="actions">
<%= f.submit "Sign up" %>
<%= f.submit "Registrarse" %>
</div>
<% end %>

View File

@@ -19,7 +19,7 @@
<% end -%>
<div class="actions">
<%= f.submit "Log in" %>
<%= f.submit "Entrar" %>
</div>
<% end %>

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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