adds i18n to debates' interface

This commit is contained in:
Juanjo Bazán
2015-07-28 16:45:00 +02:00
parent d5710c8dc6
commit e9c1910d7d
10 changed files with 105 additions and 43 deletions

View File

@@ -72,14 +72,14 @@ feature 'Debates' do
visit debate_path(debate)
click_link 'Edit'
fill_in 'debate_title', with: 'Dimisión Rajoy'
fill_in 'debate_description', with: 'Podríamos...'
fill_in 'debate_title', with: "Go home Rajoy"
fill_in 'debate_description', with: "Let's..."
click_button 'Update Debate'
click_button "Update Debate"
expect(page).to have_content 'Debate was successfully updated.'
expect(page).to have_content 'Dimisión Rajoy'
expect(page).to have_content 'Podríamos...'
expect(page).to have_content "Debate was successfully updated."
expect(page).to have_content "Go home Rajoy"
expect(page).to have_content "Let's..."
end
end

View File

@@ -17,33 +17,33 @@ feature 'Votes' do
visit debate_path(@debate)
expect(page).to have_content "2 votos"
within('#in_favor') do
expect(page).to have_content "50%"
expect(page).to have_content "2 votes"
within('#in_favor') do
expect(page).to have_content "50%"
end
within('#against') do
expect(page).to have_content "50%"
within('#against') do
expect(page).to have_content "50%"
end
end
scenario 'Create' do
find('#in_favor a').click
expect(page).to have_content "Gracias por votar"
expect(page).to have_content "Thanks for voting."
end
scenario 'Update' do
find('#in_favor a').click
find('#against a').click
expect(page).to have_content "Gracias por votar"
expect(page).to have_content "Thanks for voting."
end
scenario 'Trying to vote multiple times' do
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 "1 voto"
expect(page).to have_content "Your vote is already registered."
expect(page).to have_content "1 vote"
end
end