From 2bf66032077467da4617fe830950fffa88a9ed55 Mon Sep 17 00:00:00 2001 From: Alberto Garcia Cabeza Date: Wed, 21 Oct 2015 22:46:59 +0200 Subject: [PATCH] Merges master and fixes conflicts --- config/locales/devise.en.yml | 2 +- config/locales/en.yml | 3 ++- config/locales/es.yml | 2 +- config/locales/verification.en.yml | 2 +- db/schema.rb | 5 ++++- spec/features/account_spec.rb | 2 +- spec/features/comments/debates_spec.rb | 2 +- spec/features/comments/proposals_spec.rb | 2 +- spec/features/debates_spec.rb | 4 ++-- spec/features/emails_spec.rb | 2 +- spec/features/moderation/comments_spec.rb | 4 ++-- spec/features/moderation/debates_spec.rb | 4 ++-- spec/features/moderation/proposals_spec.rb | 4 ++-- spec/features/proposals_spec.rb | 6 +++--- spec/features/users_spec.rb | 4 ++-- spec/features/verification/letter_spec.rb | 12 ++++++------ .../verification/level_three_verification_spec.rb | 2 +- spec/features/verification/residence_spec.rb | 2 +- spec/models/letter_spec.rb | 2 +- 19 files changed, 35 insertions(+), 31 deletions(-) diff --git a/config/locales/devise.en.yml b/config/locales/devise.en.yml index bd27dd2a2..f0432d09b 100755 --- a/config/locales/devise.en.yml +++ b/config/locales/devise.en.yml @@ -31,7 +31,7 @@ en: send_instructions: "In a few minutes, you will receive an email containing instructions on resetting your password." send_paranoid_instructions: "If your email address is in our database, in a few minutes you will receive a link to use to reset your password." updated: "Your password has been changed successfully. Authentication successful." - updated_not_active: "Your password has been changed successfully. " + updated_not_active: "Your password has been changed successfully." registrations: destroyed: "Goodbye! Your account has been cancelled. We hope to see you again soon." signed_up: "Welcome! You have been authenticated." diff --git a/config/locales/en.yml b/config/locales/en.yml index 3958b474f..a48424948 100755 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -71,6 +71,7 @@ en: debate: "Debate" proposal: "Proposal" verification::sms: "Telephone" + verification::letter: "the verification" application: alert: only_beta_testers: "Sorry: only beta testers have access at this time" @@ -309,7 +310,7 @@ en: proposal: "the secret code does not match the image" shared: author_info: - author_deleted: Deleted user + author_deleted: "User deleted" tags_cloud: tags: "Trending" print: diff --git a/config/locales/es.yml b/config/locales/es.yml index a8af44fac..6419f6e5e 100644 --- a/config/locales/es.yml +++ b/config/locales/es.yml @@ -71,7 +71,7 @@ es: debate: "el debate" proposal: "la propuesta" verification::sms: "el teléfono" - verification::letter: la verificación + verification::letter: "la verificación" application: alert: only_beta_testers: "Lo sentimos sólo los usuarios de pruebas tienen acceso de momento" diff --git a/config/locales/verification.en.yml b/config/locales/verification.en.yml index 7d4a0d3ef..97208ec37 100755 --- a/config/locales/verification.en.yml +++ b/config/locales/verification.en.yml @@ -93,7 +93,7 @@ en: alert: unconfirmed_code: "You have not yet entered the confirmation code" errors: - incorect_code: "Verification code incorrect" + incorrect_code: "Verification code incorrect" verified_user: show: title: "Available information" diff --git a/db/schema.rb b/db/schema.rb index 436fe1b7f..1fc4e9cd2 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -14,6 +14,7 @@ ActiveRecord::Schema.define(version: 20151021113348) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" + enable_extension "unaccent" create_table "activities", force: :cascade do |t| t.integer "user_id" @@ -91,10 +92,10 @@ ActiveRecord::Schema.define(version: 20151021113348) do t.string "visit_id" t.datetime "hidden_at" t.integer "flags_count", default: 0 - t.datetime "ignored_flag_at" t.integer "cached_votes_total", default: 0 t.integer "cached_votes_up", default: 0 t.integer "cached_votes_down", default: 0 + t.datetime "ignored_flag_at" t.integer "comments_count", default: 0 t.datetime "confirmed_hide_at" t.integer "cached_anonymous_votes_total", default: 0 @@ -110,6 +111,7 @@ ActiveRecord::Schema.define(version: 20151021113348) do add_index "debates", ["cached_votes_total"], name: "index_debates_on_cached_votes_total", using: :btree add_index "debates", ["cached_votes_up"], name: "index_debates_on_cached_votes_up", using: :btree add_index "debates", ["confidence_score"], name: "index_debates_on_confidence_score", using: :btree + add_index "debates", ["description"], name: "index_debates_on_description", using: :btree add_index "debates", ["hidden_at"], name: "index_debates_on_hidden_at", using: :btree add_index "debates", ["hot_score"], name: "index_debates_on_hot_score", using: :btree add_index "debates", ["title"], name: "index_debates_on_title", using: :btree @@ -215,6 +217,7 @@ ActiveRecord::Schema.define(version: 20151021113348) do add_index "proposals", ["author_id"], name: "index_proposals_on_author_id", using: :btree add_index "proposals", ["cached_votes_up"], name: "index_proposals_on_cached_votes_up", using: :btree add_index "proposals", ["confidence_score"], name: "index_proposals_on_confidence_score", using: :btree + add_index "proposals", ["description"], name: "index_proposals_on_description", using: :btree add_index "proposals", ["hidden_at"], name: "index_proposals_on_hidden_at", using: :btree add_index "proposals", ["hot_score"], name: "index_proposals_on_hot_score", using: :btree add_index "proposals", ["question"], name: "index_proposals_on_question", using: :btree diff --git a/spec/features/account_spec.rb b/spec/features/account_spec.rb index 938e980c3..bc9c38dae 100644 --- a/spec/features/account_spec.rb +++ b/spec/features/account_spec.rb @@ -91,7 +91,7 @@ feature 'Account' do click_button 'Erase my account' - expect(page).to have_content "Your account has been successfully cancelled" + expect(page).to have_content "Goodbye! Your account has been cancelled. We hope to see you again soon." login_through_form_as(@user) diff --git a/spec/features/comments/debates_spec.rb b/spec/features/comments/debates_spec.rb index dc695881c..073e9fa5c 100644 --- a/spec/features/comments/debates_spec.rb +++ b/spec/features/comments/debates_spec.rb @@ -201,7 +201,7 @@ feature 'Commenting debates' do visit debate_path(debate) within "#comment_#{comment.id}" do - expect(page).to have_content('Deleted user') + expect(page).to have_content('User deleted') expect(page).to have_content('this should be visible') end end diff --git a/spec/features/comments/proposals_spec.rb b/spec/features/comments/proposals_spec.rb index c4aa3a6c7..7d51e79e3 100644 --- a/spec/features/comments/proposals_spec.rb +++ b/spec/features/comments/proposals_spec.rb @@ -201,7 +201,7 @@ feature 'Commenting proposals' do visit proposal_path(proposal) within "#comment_#{comment.id}" do - expect(page).to have_content('Deleted user') + expect(page).to have_content('User deleted') expect(page).to have_content('this should be visible') end end diff --git a/spec/features/debates_spec.rb b/spec/features/debates_spec.rb index 2a32be2a7..737b050e7 100644 --- a/spec/features/debates_spec.rb +++ b/spec/features/debates_spec.rb @@ -530,9 +530,9 @@ feature 'Debates' do user.erase visit debates_path - expect(page).to have_content('Deleted user') + expect(page).to have_content('User deleted') visit debate_path(debate) - expect(page).to have_content('Deleted user') + expect(page).to have_content('User deleted') end end diff --git a/spec/features/emails_spec.rb b/spec/features/emails_spec.rb index aeb8e885e..b5052d582 100644 --- a/spec/features/emails_spec.rb +++ b/spec/features/emails_spec.rb @@ -19,7 +19,7 @@ feature 'Emails' do reset_password email = open_last_email - expect(email).to have_subject('Reset password instructions') + expect(email).to have_subject('Instructions for resetting your password') expect(email).to deliver_to('manuela@madrid.es') expect(email).to have_body_text(edit_user_password_path) end diff --git a/spec/features/moderation/comments_spec.rb b/spec/features/moderation/comments_spec.rb index 21e5d7005..1774a1585 100644 --- a/spec/features/moderation/comments_spec.rb +++ b/spec/features/moderation/comments_spec.rb @@ -75,7 +75,7 @@ feature 'Moderate comments' do end scenario 'Ignore the comment' do - click_on "Marked as viewed" + click_on "Mark as viewed" expect(page).to_not have_css("comment_#{@comment.id}") expect(@comment.reload).to be_ignored_flag expect(@comment.reload).to_not be_hidden @@ -106,7 +106,7 @@ feature 'Moderate comments' do visit moderation_comments_path(filter: 'all', page: '2', order: 'created_at') - click_on "Marked as viewed" + click_on "Mark as viewed" expect(page).to have_selector('.js-order-selector[data-order="created_at"]') diff --git a/spec/features/moderation/debates_spec.rb b/spec/features/moderation/debates_spec.rb index b293f4dcd..1f68ee80a 100644 --- a/spec/features/moderation/debates_spec.rb +++ b/spec/features/moderation/debates_spec.rb @@ -74,7 +74,7 @@ feature 'Moderate debates' do end scenario 'Ignore the debate' do - click_on "Marked as viewed" + click_on "Mark as viewed" expect(page).to_not have_css("debate_#{@debate.id}") expect(@debate.reload).to be_ignored_flag expect(@debate.reload).to_not be_hidden @@ -105,7 +105,7 @@ feature 'Moderate debates' do visit moderation_debates_path(filter: 'all', page: '2', order: 'created_at') - click_on "Marked as viewed" + click_on "Mark as viewed" expect(page).to have_selector('.js-order-selector[data-order="created_at"]') diff --git a/spec/features/moderation/proposals_spec.rb b/spec/features/moderation/proposals_spec.rb index c6899ea04..e41a69bb2 100644 --- a/spec/features/moderation/proposals_spec.rb +++ b/spec/features/moderation/proposals_spec.rb @@ -132,13 +132,13 @@ feature 'Moderate proposals' do within('.sub-nav') do expect(page).to have_link('All') expect(page).to_not have_link('Pending') - expect(page).to have_link('Marked as viewed') + expect(page).to have_link('Mark as viewed') end visit moderation_proposals_path(filter: 'with_ignored_flag') within('.sub-nav') do expect(page).to have_link('All') - expect(page).to have_link('Pending') + expect(page).to have_link('Pending review') expect(page).to_not have_link('Marked as viewed') end end diff --git a/spec/features/proposals_spec.rb b/spec/features/proposals_spec.rb index 3cc78229b..5556ed4d8 100644 --- a/spec/features/proposals_spec.rb +++ b/spec/features/proposals_spec.rb @@ -634,14 +634,14 @@ feature 'Proposals' do user.erase visit proposals_path - expect(page).to have_content('Deleted user') + expect(page).to have_content('User deleted') visit proposal_path(proposal) - expect(page).to have_content('Deleted user') + expect(page).to have_content('User deleted') create_featured_proposals visit proposals_path - expect(page).to have_content('Deleted user') + expect(page).to have_content('User deleted') end end diff --git a/spec/features/users_spec.rb b/spec/features/users_spec.rb index e752fa62c..b23d956ac 100644 --- a/spec/features/users_spec.rb +++ b/spec/features/users_spec.rb @@ -178,7 +178,7 @@ feature 'Users' do fill_in 'user_email', with: 'manuela@madrid.es' click_button 'Send instructions' - expect(page).to have_content "You will receive an email with instructions on how to reset your password in a few minutes." + expect(page).to have_content "In a few minutes, you will receive an email containing instructions on resetting your password." sent_token = /.*reset_password_token=(.*)".*/.match(ActionMailer::Base.deliveries.last.body.to_s)[1] visit edit_user_password_path(reset_password_token: sent_token) @@ -187,6 +187,6 @@ feature 'Users' do fill_in 'user_password_confirmation', with: 'new password' click_button 'Change my password' - expect(page).to have_content "Your password has been changed successfully. You are now signed in." + expect(page).to have_content "Your password has been changed successfully." end end diff --git a/spec/features/verification/letter_spec.rb b/spec/features/verification/letter_spec.rb index 3d35e1bb3..273a6d40f 100644 --- a/spec/features/verification/letter_spec.rb +++ b/spec/features/verification/letter_spec.rb @@ -9,9 +9,9 @@ feature 'Verify Letter' do login_as(user) visit new_letter_path - click_link "Request a letter" + click_link "Send me a letter with the code" - expect(page).to have_content "Before voting you'll receive a letter whith the instructions for verify your account." + expect(page).to have_content "Thank you for requesting your maximum security code (only required for the final votes). In a few days we will send it to the address featuring in the data we have on file." user.reload @@ -26,7 +26,7 @@ feature 'Verify Letter' do login_as(user) visit new_letter_path - expect(page).to have_link "Office of Citizen", href: "http://www.madrid.es/portales/munimadrid/es/Inicio/El-Ayuntamiento/Atencion-al-ciudadano/Oficinas-de-Atencion-al-Ciudadano?vgnextfmt=default&vgnextchannel=5b99cde2e09a4310VgnVCM1000000b205a0aRCRD" + expect(page).to have_link "Citizen Support Offices", href: "http://www.madrid.es/portales/munimadrid/es/Inicio/El-Ayuntamiento/Atencion-al-ciudadano/Oficinas-de-Atencion-al-Ciudadano?vgnextfmt=default&vgnextchannel=5b99cde2e09a4310VgnVCM1000000b205a0aRCRD" end scenario "Deny access unless verified residence" do @@ -64,7 +64,7 @@ feature 'Verify Letter' do fill_in "verification_letter_verification_code", with: user.letter_verification_code click_button "Verify my account" - expect(page).to have_content "Your account has been verified" + expect(page).to have_content "Code correct. Your account is now verified" expect(current_path).to eq(account_path) end @@ -97,7 +97,7 @@ feature 'Verify Letter' do fill_in "verification_letter_verification_code", with: user.letter_verification_code click_button "Verify my account" - expect(page).to have_content "Your account has been verified" + expect(page).to have_content "Code correct. Your account is now verified" expect(current_path).to eq(account_path) end @@ -135,7 +135,7 @@ feature 'Verify Letter' do click_button "Verify my account" end - expect(page).to have_content "You have reached the maximum number of verification tries. Please try again later." + expect(page).to have_content "You have reached the maximum number of attempts. Please try again later." expect(current_path).to eq(account_path) end diff --git a/spec/features/verification/level_three_verification_spec.rb b/spec/features/verification/level_three_verification_spec.rb index 492af58d9..9a1cfaa6e 100644 --- a/spec/features/verification/level_three_verification_spec.rb +++ b/spec/features/verification/level_three_verification_spec.rb @@ -85,6 +85,6 @@ feature 'Level three verification' do click_link "Send me a letter with the code" - expect(page).to have_content "Before voting you'll receive a letter whith the instructions for verify your account." + expect(page).to have_content "Thank you for requesting your maximum security code (only required for the final votes). In a few days we will send it to the address featuring in the data we have on file." end end \ No newline at end of file diff --git a/spec/features/verification/residence_spec.rb b/spec/features/verification/residence_spec.rb index 67c652955..447438472 100644 --- a/spec/features/verification/residence_spec.rb +++ b/spec/features/verification/residence_spec.rb @@ -29,7 +29,7 @@ feature 'Residence' do click_button 'Verify residence' - expect(page).to have_content /\d errors? prevented your residence verification/ + expect(page).to have_content /\d errors? prevented the verification of your residence/ end scenario 'Error on postal code not in Madrid census' do diff --git a/spec/models/letter_spec.rb b/spec/models/letter_spec.rb index 48bf05309..fdec7f390 100644 --- a/spec/models/letter_spec.rb +++ b/spec/models/letter_spec.rb @@ -38,7 +38,7 @@ describe 'Verification::Letter' do letter.verification_code = "5555" expect(letter.valid?).to eq(false) - expect(letter.errors[:verification_code].first).to eq("Incorrect confirmation code") + expect(letter.errors[:verification_code].first).to eq("Verification code incorrect") end it "correct code" do