diff --git a/config/locales/admin.en.yml b/config/locales/admin.en.yml index eb35cdfbf..276e3ca96 100755 --- a/config/locales/admin.en.yml +++ b/config/locales/admin.en.yml @@ -119,13 +119,10 @@ en: level_5: "Level 5" index: title: "Officials" - search_placeholder: "Search user by name or email" - search: "Search" search: title: "Official positions: User search" edit_official: "Edit official" make_official: "Make official" - search: "Search" edit: title: "Officials: Edit user" destroy: "Remove 'Official' status" diff --git a/config/locales/en.yml b/config/locales/en.yml index af0b98d60..3958b474f 100755 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -70,7 +70,7 @@ en: user: "Account" debate: "Debate" proposal: "Proposal" - verification:":sms: Telephone" + verification::sms: "Telephone" application: alert: only_beta_testers: "Sorry: only beta testers have access at this time" @@ -343,9 +343,9 @@ en: title: "Participate" go_to_index: "See proposals and debates" user_permission_info: "With your account you can..." - user_permission_title: "Participation" user_permission_debates: "Participate on debates" user_permission_proposal: "Create new proposals" + user_permission_support_proposal: "Support proposals*" user_permission_votes: "Participate on final voting" user_permission_verify: "To perform all the actions %{verify}." user_permission_verify_url: "verify your account" diff --git a/spec/features/account_spec.rb b/spec/features/account_spec.rb index 029864ec9..938e980c3 100644 --- a/spec/features/account_spec.rb +++ b/spec/features/account_spec.rb @@ -37,7 +37,7 @@ feature 'Account' do check 'account_email_on_comment_reply' click_button 'Save changes' - expect(page).to have_content "Saved" + expect(page).to have_content "Changes saved" visit account_path @@ -55,7 +55,7 @@ feature 'Account' do check 'account_email_on_comment_reply' click_button 'Save changes' - expect(page).to have_content "Saved" + expect(page).to have_content "Changes saved" visit account_path diff --git a/spec/features/admin/activity_spec.rb b/spec/features/admin/activity_spec.rb index d2836b2d1..715c65f55 100644 --- a/spec/features/admin/activity_spec.rb +++ b/spec/features/admin/activity_spec.rb @@ -201,7 +201,7 @@ feature 'Admin activity' do visit proposal_path(proposal) within("#proposal_#{proposal.id}") do - click_link 'Ban author' + click_link 'Hide author' end visit admin_activity_path @@ -221,7 +221,7 @@ feature 'Admin activity' do visit moderation_users_path(name_or_email: user.username) within(".admin-list") do - click_link 'Ban' + click_link 'Block' end visit admin_activity_path diff --git a/spec/features/admin/comments_spec.rb b/spec/features/admin/comments_spec.rb index d6369272a..34768596f 100644 --- a/spec/features/admin/comments_spec.rb +++ b/spec/features/admin/comments_spec.rb @@ -18,7 +18,7 @@ feature 'Admin comments' do visit proposal_path(proposal) within("#proposal_#{proposal.id}") do - click_link 'Ban author' + click_link 'Hide author' end visit admin_comments_path diff --git a/spec/features/admin/officials_spec.rb b/spec/features/admin/officials_spec.rb index 926f6681e..08c7c27a4 100644 --- a/spec/features/admin/officials_spec.rb +++ b/spec/features/admin/officials_spec.rb @@ -32,7 +32,7 @@ feature 'Admin officials' do select '3', from: 'user_official_level', exact: false click_button 'Update User' - expect(page).to have_content 'Official position saved!' + expect(page).to have_content 'Details of official saved' visit admin_officials_path @@ -55,7 +55,7 @@ feature 'Admin officials' do select '4', from: 'user_official_level', exact: false click_button 'Update User' - expect(page).to have_content 'Official position saved!' + expect(page).to have_content 'Details of official saved' visit admin_officials_path @@ -68,9 +68,9 @@ feature 'Admin officials' do scenario 'Destroy' do visit edit_admin_official_path(@official) - click_link "Remove 'Official' condition" + click_link "Remove 'Official' status" - expect(page).to have_content 'User is not an official anymore' + expect(page).to have_content 'Details saved: the user is no longer an official' expect(current_path).to eq(admin_officials_path) expect(page).to_not have_content @citizen.name expect(page).to_not have_content @official.name diff --git a/spec/features/admin/organizations_spec.rb b/spec/features/admin/organizations_spec.rb index 2acce362b..814aa9df2 100644 --- a/spec/features/admin/organizations_spec.rb +++ b/spec/features/admin/organizations_spec.rb @@ -22,7 +22,7 @@ feature 'Admin::Organizations' do expect(page).to have_content(org.user.email) expect(page).to_not have_content("Greentroll") expect(page).to_not have_content("trol@troller.com") - expect(page).to have_content("There is 1 organization without user or with the user banned") + expect(page).to have_content("There is also one organisation with no users or with a hidden user") end end diff --git a/spec/features/admin/settings_spec.rb b/spec/features/admin/settings_spec.rb index db10e0de7..3673ccd4f 100644 --- a/spec/features/admin/settings_spec.rb +++ b/spec/features/admin/settings_spec.rb @@ -25,6 +25,6 @@ feature 'Admin settings' do click_button 'Update' end - expect(page).to have_content 'Setting updated!' + expect(page).to have_content 'Value updated' end end \ No newline at end of file diff --git a/spec/features/admin/tags_spec.rb b/spec/features/admin/tags_spec.rb index a56f10ffa..74579c1b8 100644 --- a/spec/features/admin/tags_spec.rb +++ b/spec/features/admin/tags_spec.rb @@ -54,7 +54,7 @@ feature 'Admin tags' do expect(page).to have_content tag2.name within("#edit_tag_#{tag2.id}") do - click_link 'Delete Topic' + click_link 'Destroy Topic' end visit admin_tags_path @@ -73,7 +73,7 @@ feature 'Admin tags' do expect(page).to have_content tag2.name within("#edit_tag_#{tag2.id}") do - click_link 'Delete Topic' + click_link 'Destroy Topic' end visit admin_tags_path diff --git a/spec/features/admin/verifications_spec.rb b/spec/features/admin/verifications_spec.rb index 975d5c3e2..9ecd39314 100644 --- a/spec/features/admin/verifications_spec.rb +++ b/spec/features/admin/verifications_spec.rb @@ -43,7 +43,7 @@ feature 'Incomplete verifications' do visit admin_verifications_path within "#user_#{incompletely_verified_user.id}" do - expect(page).to have_content "Spanish ID" + expect(page).to have_content "DNI" expect(page).to have_content incompletely_verified_user.document_number expect(page).to have_content Date.new(1900, 1, 1) expect(page).to have_content "28000" diff --git a/spec/features/admin_spec.rb b/spec/features/admin_spec.rb index ec991e388..644c20f9d 100644 --- a/spec/features/admin_spec.rb +++ b/spec/features/admin_spec.rb @@ -17,7 +17,7 @@ feature 'Admin' do expect(current_path).not_to eq(admin_root_path) expect(current_path).to eq(proposals_path) - expect(page).to have_content "not authorized" + expect(page).to have_content "You do not have permission to access this page" end scenario 'Access as a moderator is not authorized' do @@ -26,7 +26,7 @@ feature 'Admin' do expect(current_path).not_to eq(admin_root_path) expect(current_path).to eq(proposals_path) - expect(page).to have_content "not authorized" + expect(page).to have_content "You do not have permission to access this page" end scenario 'Access as an administrator is authorized' do @@ -34,7 +34,7 @@ feature 'Admin' do visit admin_root_path expect(current_path).to eq(admin_root_path) - expect(page).to_not have_content "not authorized" + expect(page).to_not have_content "You do not have permission to access this page" end scenario "Admin access links" do @@ -99,7 +99,7 @@ feature 'Admin' do expect(page).to have_content 'Mi barrio' - click_link 'Delete Topic' + click_link 'Destroy Topic' expect(page).not_to have_content 'Mi barrio' end diff --git a/spec/features/beta_testers_spec.rb b/spec/features/beta_testers_spec.rb deleted file mode 100644 index 66492b219..000000000 --- a/spec/features/beta_testers_spec.rb +++ /dev/null @@ -1,44 +0,0 @@ -require 'rails_helper' - -feature 'Beta testers' do - - background do - allow_any_instance_of(ApplicationController). - to receive(:beta_site?).and_return(true) - - allow_any_instance_of(ApplicationController). - to receive(:beta_testers).and_return(['isabel@example.com']) - end - - scenario 'Beta testers should have access' do - visit root_path - sign_up('isabel@example.com', 'secretpassword') - confirm_email - - fill_in 'user_email', with: 'isabel@example.com' - fill_in 'user_password', with: 'secretpassword' - click_button 'Log in' - - expect(page).to have_content "Signed in successfully." - end - - scenario 'Non beta testers should not have access' do - visit root_path - sign_up('other@example.com', 'secretpassword') - confirm_email - - fill_in 'user_email', with: 'other@example.com' - fill_in 'user_password', with: 'secretpassword' - click_button 'Log in' - - expect(page).to have_content "Sorry only Beta Testers are allowed access at the moment" - end - - scenario "Trying to access site without being logged in" do - visit debates_path - - expect(page).to have_content "Sorry only Beta Testers are allowed access at the moment" - expect(current_path).to eq(new_user_session_path) - end - -end \ No newline at end of file diff --git a/spec/features/comments/debates_spec.rb b/spec/features/comments/debates_spec.rb index 82d9708ad..dc695881c 100644 --- a/spec/features/comments/debates_spec.rb +++ b/spec/features/comments/debates_spec.rb @@ -67,7 +67,7 @@ feature 'Commenting debates' do create(:comment, commentable: debate) visit debate_path(debate) - expect(page).to have_content 'You need to sign in or sign up to comment' + expect(page).to have_content 'You must Sign in or Sign up to leave a comment' within('#comments') do expect(page).to_not have_content 'Write a comment' expect(page).to_not have_content 'Reply' diff --git a/spec/features/comments/proposals_spec.rb b/spec/features/comments/proposals_spec.rb index 751329989..c4aa3a6c7 100644 --- a/spec/features/comments/proposals_spec.rb +++ b/spec/features/comments/proposals_spec.rb @@ -67,7 +67,7 @@ feature 'Commenting proposals' do create(:comment, commentable: proposal) visit proposal_path(proposal) - expect(page).to have_content 'You need to sign in or sign up to comment' + expect(page).to have_content 'You must Sign in or Sign up to leave a comment' within('#comments') do expect(page).to_not have_content 'Write a comment' expect(page).to_not have_content 'Reply' diff --git a/spec/features/debates_spec.rb b/spec/features/debates_spec.rb index 717f02c20..2a32be2a7 100644 --- a/spec/features/debates_spec.rb +++ b/spec/features/debates_spec.rb @@ -56,7 +56,7 @@ feature 'Debates' do visit debates_path(order: :hot_score, page: 1) first(:link, debate.title).click - link_text = find_link('Back')[:href] + link_text = find_link('Go back')[:href] expect(link_text).to include(debates_path order: :hot_score, page: 1) end @@ -74,7 +74,7 @@ feature 'Debates' do click_button 'Start a debate' expect(page).to have_content 'A title for a debate' - expect(page).to have_content 'Debate was successfully created.' + expect(page).to have_content 'Debate created successfully.' expect(page).to have_content 'This is very important because...' expect(page).to have_content author.name expect(page).to have_content I18n.l(Debate.last.created_at.to_date) @@ -91,13 +91,13 @@ feature 'Debates' do click_button "Start a debate" - expect(page).to_not have_content "Debate was successfully created." + expect(page).to_not have_content "Debate created successfully." expect(page).to have_content "1 error" fill_in 'debate_captcha', with: correct_captcha_text click_button "Start a debate" - expect(page).to have_content "Debate was successfully created." + expect(page).to have_content "Debate created successfully." end scenario 'Failed creation goes back to new showing featured tags' do @@ -113,7 +113,7 @@ feature 'Debates' do click_button "Start a debate" - expect(page).to_not have_content "Debate was successfully created." + expect(page).to_not have_content "Debate created successfully." expect(page).to have_content "error" within(".tags") do expect(page).to have_content featured_tag.name @@ -142,7 +142,7 @@ feature 'Debates' do click_button 'Start a debate' - expect(page).to have_content 'Debate was successfully created.' + expect(page).to have_content 'Debate created successfully.' expect(page).to have_content 'Testing an attack' expect(page.html).to include '

This is alert("an attack");

' expect(page.html).to_not include '' @@ -161,7 +161,7 @@ feature 'Debates' do click_button 'Start a debate' - expect(page).to have_content 'Debate was successfully created.' + expect(page).to have_content 'Debate created successfully.' expect(page).to have_content 'Testing auto link' expect(page).to have_link('www.example.org', href: 'http://www.example.org') end @@ -178,13 +178,13 @@ feature 'Debates' do click_button 'Start a debate' - expect(page).to have_content 'Debate was successfully created.' + expect(page).to have_content 'Debate created successfully.' expect(page).to have_content 'Testing auto link' expect(page).to have_link('http://example.org', href: 'http://example.org') expect(page).not_to have_link('click me') expect(page.html).to_not include "" - click_link 'Edit debate' + click_link 'Edit' expect(current_path).to eq edit_debate_path(Debate.last) expect(page).not_to have_link('click me') @@ -216,7 +216,7 @@ feature 'Debates' do click_button 'Start a debate' - expect(page).to have_content 'Debate was successfully created.' + expect(page).to have_content 'Debate created successfully.' ['Medio Ambiente', 'Ciencia'].each do |tag_name| expect(page).to have_content tag_name end @@ -234,7 +234,7 @@ feature 'Debates' do click_button 'Start a debate' - expect(page).to have_content 'Debate was successfully created.' + expect(page).to have_content 'Debate created successfully.' expect(page).to have_content 'user_id1' expect(page).to have_content 'a3' expect(page).to have_content 'scriptalert("hey");script' @@ -250,7 +250,7 @@ feature 'Debates' do visit edit_debate_path(debate) expect(current_path).not_to eq(edit_debate_path(debate)) expect(current_path).to eq(proposals_path) - expect(page).to have_content 'not authorized' + expect(page).to have_content "You do not have permission to carry out the action 'edit' on debate." end scenario 'Update should not be posible if debate is not editable' do @@ -265,7 +265,7 @@ feature 'Debates' do expect(current_path).not_to eq(edit_debate_path(debate)) expect(current_path).to eq(proposals_path) - expect(page).to have_content 'not authorized' + expect(page).to have_content 'You do not have permission to' end scenario 'Update should be posible for the author of an editable debate' do @@ -281,7 +281,7 @@ feature 'Debates' do click_button "Save changes" - expect(page).to have_content "Debate was successfully updated." + expect(page).to have_content "Debate updated successfully." expect(page).to have_content "End child poverty" expect(page).to have_content "Let's do something to end child poverty" end @@ -308,13 +308,13 @@ feature 'Debates' do fill_in 'debate_captcha', with: "wrong!" click_button "Save changes" - expect(page).to_not have_content "Debate was successfully updated." + expect(page).to_not have_content "Debate updated successfully." expect(page).to have_content "error" fill_in 'debate_captcha', with: correct_captcha_text click_button "Save changes" - expect(page).to have_content "Debate was successfully updated." + expect(page).to have_content "Debate updated successfully." end scenario 'Failed update goes back to edit showing featured tags' do @@ -330,7 +330,7 @@ feature 'Debates' do fill_in 'debate_captcha', with: correct_captcha_text click_button "Save changes" - expect(page).to_not have_content "Debate was successfully updated." + expect(page).to_not have_content "Debate updated successfully." expect(page).to have_content "error" within(".tags") do expect(page).to have_content featured_tag.name @@ -419,7 +419,7 @@ feature 'Debates' do create(:debate, title: 'Medium').update_column(:confidence_score, 5) visit debates_path - select 'best rated', from: 'order-selector' + select 'highest rated', from: 'order-selector' expect(page).to have_selector('.js-order-selector[data-order="confidence_score"]') @@ -518,10 +518,10 @@ feature 'Debates' do conflictive_debate = create(:debate, :conflictive) visit debate_path(conflictive_debate) - expect(page).to have_content "This debate has been flag as innapropiate for some users." + expect(page).to have_content "This debate has been flagged as inappropriate by several users." visit debate_path(good_debate) - expect(page).to_not have_content "This debate has been flag as innapropiate for some users." + expect(page).to_not have_content "This debate has been flagged as inappropriate by several users." end scenario 'Erased author' do diff --git a/spec/features/emails_spec.rb b/spec/features/emails_spec.rb index 3058de44c..aeb8e885e 100644 --- a/spec/features/emails_spec.rb +++ b/spec/features/emails_spec.rb @@ -31,7 +31,7 @@ feature 'Emails' do comment_on(proposal) email = open_last_email - expect(email).to have_subject('Someone has commented on your proposal') + expect(email).to have_subject('Someone has commented on your citizen proposal') expect(email).to deliver_to(proposal.author) expect(email).to have_body_text(proposal_path(proposal)) end @@ -88,7 +88,7 @@ feature 'Emails' do reply_to(user) email = open_last_email - expect(email).to have_subject('Someone has replied to your comment') + expect(email).to have_subject('Someone has responded to your comment') expect(email).to deliver_to(user) expect(email).to have_body_text(debate_path(Comment.first.commentable)) end diff --git a/spec/features/highlights_spec.rb b/spec/features/highlights_spec.rb index 33ade0063..c17ee17ce 100644 --- a/spec/features/highlights_spec.rb +++ b/spec/features/highlights_spec.rb @@ -27,7 +27,7 @@ feature "Highlights" do visit highlights_path - expect(page).to have_link("Start a proposal") + expect(page).to have_link("Create a proposal") expect(page).to have_link("Start a debate") end diff --git a/spec/features/home_spec.rb b/spec/features/home_spec.rb index 0764b353e..f5eec3121 100644 --- a/spec/features/home_spec.rb +++ b/spec/features/home_spec.rb @@ -6,7 +6,7 @@ feature "Home" do scenario 'Welcome message' do visit root_path - expect(page).to have_content "we open this digital Puerta del Sol" + expect(page).to have_content "Love the city, and it will become a city you love" end end diff --git a/spec/features/management/email_verifications_spec.rb b/spec/features/management/email_verifications_spec.rb index cb695a0f7..22987f317 100644 --- a/spec/features/management/email_verifications_spec.rb +++ b/spec/features/management/email_verifications_spec.rb @@ -25,10 +25,10 @@ feature 'EmailVerifications' do sent_token = /.*email_verification_token=(.*)".*/.match(ActionMailer::Base.deliveries.last.body.to_s)[1] visit email_path(email_verification_token: sent_token) - expect(page).to have_content "You are now a verified user" + expect(page).to have_content "You are a verified user" expect(page).to_not have_link "Verify my account" - expect(page).to have_content "Verified account" + expect(page).to have_content "Account verified" expect(user.reload.document_number).to eq('1234') expect(user).to be_level_three_verified diff --git a/spec/features/management/proposals_spec.rb b/spec/features/management/proposals_spec.rb index 2764efca7..f5c3071f5 100644 --- a/spec/features/management/proposals_spec.rb +++ b/spec/features/management/proposals_spec.rb @@ -30,9 +30,9 @@ feature 'Proposals' do fill_in 'proposal_captcha', with: correct_captcha_text check 'proposal_terms_of_service' - click_button 'Start a proposal' + click_button 'Create proposal' - expect(page).to have_content 'Proposal was successfully created.' + expect(page).to have_content 'Proposal created successfully.' expect(page).to have_content 'Help refugees' expect(page).to have_content '¿Would you like to give assistance to war refugees?' @@ -120,7 +120,7 @@ feature 'Proposals' do find('.in-favor a').click expect(page).to have_content "1 support" - expect(page).to have_content "You already supported this proposal" + expect(page).to have_content "You have already supported this proposal. Share it!" end expect(current_path).to eq(management_proposals_path) end diff --git a/spec/features/management/users_spec.rb b/spec/features/management/users_spec.rb index 2e2564df8..31e4bbeeb 100644 --- a/spec/features/management/users_spec.rb +++ b/spec/features/management/users_spec.rb @@ -39,7 +39,7 @@ feature 'users' do expect(user.reload).to be_confirmed - expect(page).to have_content "Your email address has been successfully confirmed." + expect(page).to have_content "Your account has been confirmed." end end \ No newline at end of file diff --git a/spec/features/moderation/comments_spec.rb b/spec/features/moderation/comments_spec.rb index 431e7a31d..21e5d7005 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 "Ignore flags" + click_on "Marked 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 "Ignore flags" + click_on "Marked as viewed" expect(page).to have_selector('.js-order-selector[data-order="created_at"]') @@ -120,27 +120,27 @@ feature 'Moderate comments' do visit moderation_comments_path expect(page).to_not have_link('Pending') expect(page).to have_link('All') - expect(page).to have_link('Ignored') + expect(page).to have_link('Marked as viewed') visit moderation_comments_path(filter: 'all') within('.sub-nav') do expect(page).to_not have_link('All') expect(page).to have_link('Pending') - expect(page).to have_link('Ignored') + expect(page).to have_link('Marked as viewed') end visit moderation_comments_path(filter: 'pending_flag_review') within('.sub-nav') do expect(page).to have_link('All') expect(page).to_not have_link('Pending') - expect(page).to have_link('Ignored') + expect(page).to have_link('Marked as viewed') end visit moderation_comments_path(filter: 'with_ignored_flag') within('.sub-nav') do expect(page).to have_link('All') expect(page).to have_link('Pending') - expect(page).to_not have_link('Ignored') + expect(page).to_not have_link('Marked as viewed') end end diff --git a/spec/features/moderation/debates_spec.rb b/spec/features/moderation/debates_spec.rb index 303950e45..b293f4dcd 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 "Ignore flags" + click_on "Marked 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 "Ignore flags" + click_on "Marked as viewed" expect(page).to have_selector('.js-order-selector[data-order="created_at"]') @@ -119,27 +119,27 @@ feature 'Moderate debates' do visit moderation_debates_path expect(page).to_not have_link('Pending') expect(page).to have_link('All') - expect(page).to have_link('Ignored') + expect(page).to have_link('Marked as viewed') visit moderation_debates_path(filter: 'all') within('.sub-nav') do expect(page).to_not have_link('All') expect(page).to have_link('Pending') - expect(page).to have_link('Ignored') + expect(page).to have_link('Marked as viewed') end visit moderation_debates_path(filter: 'pending_flag_review') within('.sub-nav') do expect(page).to have_link('All') expect(page).to_not have_link('Pending') - expect(page).to have_link('Ignored') + expect(page).to have_link('Marked as viewed') end visit moderation_debates_path(filter: 'with_ignored_flag') within('.sub-nav') do expect(page).to have_link('All') expect(page).to have_link('Pending') - expect(page).to_not have_link('Ignored') + expect(page).to_not have_link('Marked as viewed') end end diff --git a/spec/features/moderation/proposals_spec.rb b/spec/features/moderation/proposals_spec.rb index 81cc319b2..c6899ea04 100644 --- a/spec/features/moderation/proposals_spec.rb +++ b/spec/features/moderation/proposals_spec.rb @@ -74,7 +74,7 @@ feature 'Moderate proposals' do end scenario 'Ignore the proposal' do - click_on "Ignore flags" + click_button "Mark as viewed" expect(page).to_not have_css("proposal_#{@proposal.id}") expect(@proposal.reload).to be_ignored_flag expect(@proposal.reload).to_not be_hidden @@ -105,7 +105,7 @@ feature 'Moderate proposals' do visit moderation_proposals_path(filter: 'all', page: '2', order: 'created_at') - click_on "Ignore flags" + click_button "Mark as viewed" expect(page).to have_selector('.js-order-selector[data-order="created_at"]') @@ -119,27 +119,27 @@ feature 'Moderate proposals' do visit moderation_proposals_path expect(page).to_not have_link('Pending') expect(page).to have_link('All') - expect(page).to have_link('Ignored') + expect(page).to have_link('Mark as viewed') visit moderation_proposals_path(filter: 'all') within('.sub-nav') do expect(page).to_not have_link('All') - expect(page).to have_link('Pending') - expect(page).to have_link('Ignored') + expect(page).to have_link('Pending review') + expect(page).to have_link('Mark as viewed') end visit moderation_proposals_path(filter: 'pending_flag_review') within('.sub-nav') do expect(page).to have_link('All') expect(page).to_not have_link('Pending') - expect(page).to have_link('Ignored') + expect(page).to have_link('Marked 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_not have_link('Ignored') + expect(page).to_not have_link('Marked as viewed') end end diff --git a/spec/features/moderation/users_spec.rb b/spec/features/moderation/users_spec.rb index c30623ee5..46ab7fe2a 100644 --- a/spec/features/moderation/users_spec.rb +++ b/spec/features/moderation/users_spec.rb @@ -25,7 +25,7 @@ feature 'Moderate users' do visit debate_path(debate1) within("#debate_#{debate1.id}") do - click_link 'Ban author' + click_link 'Hide author' end expect(current_path).to eq(debates_path) @@ -37,12 +37,12 @@ feature 'Moderate users' do expect(page).to_not have_content(comment3.body) - click_link("Logout") + click_link("Sign out") - click_link 'Log in' + click_link 'Sign in' fill_in 'user_email', with: citizen.email fill_in 'user_password', with: citizen.password - click_button 'Log in' + click_button 'Enter' expect(page).to have_content 'Invalid email or password' expect(current_path).to eq(new_user_session_path) @@ -62,13 +62,13 @@ feature 'Moderate users' do within(".admin-list") do expect(page).to have_content citizen.name - expect(page).not_to have_content "Banned" - click_link 'Ban' + expect(page).not_to have_content "Blocked" + click_link 'Block' end within(".admin-list") do expect(page).to have_content citizen.name - expect(page).to have_content "Banned" + expect(page).to have_content "Blocked" end end diff --git a/spec/features/moderation_spec.rb b/spec/features/moderation_spec.rb index 9cb2ff19d..c13a23461 100644 --- a/spec/features/moderation_spec.rb +++ b/spec/features/moderation_spec.rb @@ -12,7 +12,7 @@ feature 'Admin' do expect(current_path).not_to eq(moderation_root_path) expect(current_path).to eq(proposals_path) - expect(page).to have_content "not authorized" + expect(page).to have_content "You do not have permission to access this page" end scenario 'Access as a moderator is authorized' do @@ -25,7 +25,7 @@ feature 'Admin' do click_on "Moderation" expect(current_path).to eq(moderation_root_path) - expect(page).to_not have_content "not authorized" + expect(page).to_not have_content "You do not have permission to access this page" end scenario 'Access as an administrator is authorized' do @@ -38,7 +38,7 @@ feature 'Admin' do click_on "Moderation" expect(current_path).to eq(moderation_root_path) - expect(page).to_not have_content "not authorized" + expect(page).to_not have_content "You do not have permission to access this page" end end diff --git a/spec/features/organizations_spec.rb b/spec/features/organizations_spec.rb index a42e78dad..052b3bae5 100644 --- a/spec/features/organizations_spec.rb +++ b/spec/features/organizations_spec.rb @@ -16,7 +16,7 @@ feature 'Organizations' do fill_in 'user_captcha', with: correct_captcha_text check 'user_terms_of_service' - click_button 'Sign up' + click_button 'Register' user = User.organizations.where(email: 'green@peace.com').first expect(user).to be @@ -27,7 +27,7 @@ feature 'Organizations' do scenario 'Errors on create' do visit new_organization_registration_path - click_button 'Sign up' + click_button 'Register' expect(page).to have_content error_message end diff --git a/spec/features/proposals_spec.rb b/spec/features/proposals_spec.rb index 5b83e37b3..3cc78229b 100644 --- a/spec/features/proposals_spec.rb +++ b/spec/features/proposals_spec.rb @@ -87,9 +87,9 @@ feature 'Proposals' do fill_in 'proposal_captcha', with: correct_captcha_text check 'proposal_terms_of_service' - click_button 'Start a proposal' + click_button 'Create proposal' - expect(page).to have_content 'Proposal was successfully created.' + expect(page).to have_content 'Proposal created successfully.' expect(page).to have_content 'Help refugees' expect(page).to have_content '¿Would you like to give assistance to war refugees?' expect(page).to have_content 'In summary, what we want is...' @@ -115,9 +115,9 @@ feature 'Proposals' do fill_in 'proposal_responsible_name', with: 'Isabel Garcia' check 'proposal_terms_of_service' - click_button 'Start a proposal' + click_button 'Create proposal' - expect(page).to have_content 'Proposal was successfully created.' + expect(page).to have_content 'Proposal created successfully.' expect(Proposal.last.responsible_name).to eq('Isabel Garcia') end @@ -136,9 +136,9 @@ feature 'Proposals' do fill_in 'proposal_captcha', with: correct_captcha_text check 'proposal_terms_of_service' - click_button 'Start a proposal' + click_button 'Create proposal' - expect(page).to have_content 'Proposal was successfully created.' + expect(page).to have_content 'Proposal created successfully.' end scenario 'Captcha is required for proposal creation' do @@ -154,15 +154,15 @@ feature 'Proposals' do fill_in 'proposal_captcha', with: "wrongText!" check 'proposal_terms_of_service' - click_button "Start a proposal" + click_button "Create proposal" - expect(page).to_not have_content "Proposal was successfully created." + expect(page).to_not have_content "Proposal created successfully." expect(page).to have_content "1 error" fill_in 'proposal_captcha', with: correct_captcha_text - click_button "Start a proposal" + click_button "Create proposal" - expect(page).to have_content "Proposal was successfully created." + expect(page).to have_content "Proposal created successfully." end scenario 'Failed creation goes back to new showing featured tags' do @@ -180,9 +180,9 @@ feature 'Proposals' do fill_in 'proposal_captcha', with: correct_captcha_text check 'proposal_terms_of_service' - click_button "Start a proposal" + click_button "Create proposal" - expect(page).to_not have_content "Proposal was successfully created." + expect(page).to_not have_content "Proposal created successfully." expect(page).to have_content "error" within(".tags") do expect(page).to have_content featured_tag.name @@ -195,7 +195,7 @@ feature 'Proposals' do login_as(author) visit new_proposal_path - click_button 'Start a proposal' + click_button 'Create proposal' expect(page).to have_content error_message end @@ -213,9 +213,9 @@ feature 'Proposals' do fill_in 'proposal_captcha', with: correct_captcha_text check 'proposal_terms_of_service' - click_button 'Start a proposal' + click_button 'Create proposal' - expect(page).to have_content 'Proposal was successfully created.' + expect(page).to have_content 'Proposal created successfully.' expect(page).to have_content 'Testing an attack' expect(page.html).to include '

This is alert("an attack");

' expect(page.html).to_not include '' @@ -235,9 +235,9 @@ feature 'Proposals' do fill_in 'proposal_captcha', with: correct_captcha_text check 'proposal_terms_of_service' - click_button 'Start a proposal' + click_button 'Create proposal' - expect(page).to have_content 'Proposal was successfully created.' + expect(page).to have_content 'Proposal created successfully.' expect(page).to have_content 'Testing auto link' expect(page).to have_link('www.example.org', href: 'http://www.example.org') end @@ -255,15 +255,15 @@ feature 'Proposals' do fill_in 'proposal_captcha', with: correct_captcha_text check 'proposal_terms_of_service' - click_button 'Start a proposal' + click_button 'Create proposal' - expect(page).to have_content 'Proposal was successfully created.' + expect(page).to have_content 'Proposal created successfully.' expect(page).to have_content 'Testing auto link' expect(page).to have_link('http://example.org', href: 'http://example.org') expect(page).not_to have_link('click me') expect(page.html).to_not include "" - click_link 'Edit proposal' + click_link 'Edit' expect(current_path).to eq edit_proposal_path(Proposal.last) expect(page).not_to have_link('click me') @@ -297,9 +297,9 @@ feature 'Proposals' do find('.js-add-tag-link', text: tag_name).click end - click_button 'Start a proposal' + click_button 'Create proposal' - expect(page).to have_content 'Proposal was successfully created.' + expect(page).to have_content 'Proposal created successfully.' ['Medio Ambiente', 'Ciencia'].each do |tag_name| expect(page).to have_content tag_name end @@ -319,9 +319,9 @@ feature 'Proposals' do fill_in 'proposal_tag_list', with: 'user_id=1, &a=3, ' - click_button 'Start a proposal' + click_button 'Create proposal' - expect(page).to have_content 'Proposal was successfully created.' + expect(page).to have_content 'Proposal created successfully.' expect(page).to have_content 'user_id1' expect(page).to have_content 'a3' expect(page).to have_content 'scriptalert("hey");script' @@ -337,7 +337,7 @@ feature 'Proposals' do visit edit_proposal_path(proposal) expect(current_path).not_to eq(edit_proposal_path(proposal)) expect(current_path).to eq(proposals_path) - expect(page).to have_content 'not authorized' + expect(page).to have_content 'You do not have permission' end scenario 'Update should not be posible if proposal is not editable' do @@ -352,7 +352,7 @@ feature 'Proposals' do expect(current_path).not_to eq(edit_proposal_path(proposal)) expect(current_path).to eq(proposals_path) - expect(page).to have_content 'not authorized' + expect(page).to have_content 'You do not have permission' end scenario 'Update should be posible for the author of an editable proposal' do @@ -372,7 +372,7 @@ feature 'Proposals' do click_button "Save changes" - expect(page).to have_content "Proposal was successfully updated." + expect(page).to have_content "Proposal updated successfully." expect(page).to have_content "Basically..." expect(page).to have_content "End child poverty" expect(page).to have_content "Let's do something to end child poverty" @@ -400,13 +400,13 @@ feature 'Proposals' do fill_in 'proposal_captcha', with: "wrong!" click_button "Save changes" - expect(page).to_not have_content "Proposal was successfully updated." + expect(page).to_not have_content "Proposal updated successfully." expect(page).to have_content "error" fill_in 'proposal_captcha', with: correct_captcha_text click_button "Save changes" - expect(page).to have_content "Proposal was successfully updated." + expect(page).to have_content "Proposal updated successfully." end scenario 'Failed update goes back to edit showing featured tags' do @@ -422,7 +422,7 @@ feature 'Proposals' do fill_in 'proposal_captcha', with: correct_captcha_text click_button "Save changes" - expect(page).to_not have_content "Proposal was successfully updated." + expect(page).to_not have_content "Proposal updated successfully." expect(page).to have_content "error" within(".tags") do expect(page).to have_content featured_tag.name @@ -482,7 +482,7 @@ feature 'Proposals' do create(:proposal, title: 'Medium proposal').update_column(:confidence_score, 5) visit proposals_path - select 'most supported', from: 'order-selector' + select 'highest rated', from: 'order-selector' expect(page).to have_selector('.js-order-selector[data-order="confidence_score"]') @@ -587,10 +587,10 @@ feature 'Proposals' do conflictive_proposal = create(:proposal, :conflictive) visit proposal_path(conflictive_proposal) - expect(page).to have_content "This proposal has been flag as innapropiate for some users." + expect(page).to have_content "This proposal has been flagged as inappropriate by several users." visit proposal_path(good_proposal) - expect(page).to_not have_content "This proposal has been flag as innapropiate for some users." + expect(page).to_not have_content "This proposal has been flagged as inappropriate by several users." end scenario "Flagging", :js do diff --git a/spec/features/tags_spec.rb b/spec/features/tags_spec.rb index 3f310071e..2bd729448 100644 --- a/spec/features/tags_spec.rb +++ b/spec/features/tags_spec.rb @@ -84,7 +84,7 @@ feature 'Tags' do click_button 'Start a debate' - expect(page).to have_content 'Debate was successfully created.' + expect(page).to have_content 'Debate created successfully.' expect(page).to have_content 'Economía' expect(page).to have_content 'Hacienda' expect(page).to have_content 'Impuestos' @@ -104,7 +104,7 @@ feature 'Tags' do click_button 'Start a debate' - expect(page).to have_content '1 error prohibited this debate from being saved:' + expect(page).to have_content error_message expect(page).to have_content 'tags must be less than or equal to 6' end @@ -120,7 +120,7 @@ feature 'Tags' do fill_in 'debate_captcha', with: correct_captcha_text click_button 'Save changes' - expect(page).to have_content 'Debate was successfully updated.' + expect(page).to have_content 'Debate updated successfully.' within('.tags') do expect(page).to have_css('a', text: 'Economía') expect(page).to have_css('a', text: 'Hacienda') @@ -137,7 +137,7 @@ feature 'Tags' do fill_in 'debate_captcha', with: correct_captcha_text click_button 'Save changes' - expect(page).to have_content 'Debate was successfully updated.' + expect(page).to have_content 'Debate updated successfully.' expect(page).to_not have_content 'Economía' end diff --git a/spec/features/users_spec.rb b/spec/features/users_spec.rb index 2a3b19b5d..e752fa62c 100644 --- a/spec/features/users_spec.rb +++ b/spec/features/users_spec.rb @@ -5,7 +5,7 @@ feature 'Users' do context 'Regular authentication' do scenario 'Sign up' do visit '/' - click_link 'Sign up' + click_link 'Register' fill_in 'user_username', with: 'Manuela Carmena' fill_in 'user_email', with: 'manuela@madrid.es' @@ -14,20 +14,20 @@ feature 'Users' do fill_in 'user_captcha', with: correct_captcha_text check 'user_terms_of_service' - click_button 'Sign up' + click_button 'Register' - expect(page).to have_content "A message with a confirmation link has been sent to your email address. Please follow the link to activate your account." + expect(page).to have_content "You have been sent a message containing a verification link. Please click on this link to activate your account." sent_token = /.*confirmation_token=(.*)".*/.match(ActionMailer::Base.deliveries.last.body.to_s)[1] visit user_confirmation_path(confirmation_token: sent_token) - expect(page).to have_content "Your email address has been successfully confirmed" + expect(page).to have_content "Your account has been confirmed." end scenario 'Errors on sign up' do visit '/' - click_link 'Sign up' - click_button 'Sign up' + click_link 'Register' + click_button 'Register' expect(page).to have_content error_message end @@ -36,12 +36,12 @@ feature 'Users' do create(:user, email: 'manuela@madrid.es', password: 'judgementday') visit '/' - click_link 'Log in' + click_link 'Sign in' fill_in 'user_email', with: 'manuela@madrid.es' fill_in 'user_password', with: 'judgementday' - click_button 'Log in' + click_button 'Enter' - expect(page).to have_content 'Signed in successfully.' + expect(page).to have_content 'You have been signed in successfully.' end end @@ -70,7 +70,7 @@ feature 'Users' do OmniAuth.config.add_mock(:twitter, omniauth_twitter_hash) visit '/' - click_link 'Sign up' + click_link 'Register' expect do expect do @@ -105,7 +105,7 @@ feature 'Users' do OmniAuth.config.add_mock(:twitter, omniauth_twitter_hash) visit '/' - click_link 'Sign up' + click_link 'Register' expect do expect do @@ -122,7 +122,7 @@ feature 'Users' do expect(user.email).to eq("omniauth@participacion-12345-twitter.com") fill_in 'user_email', with: 'manueladelascarmenas@example.com' - click_button 'Sign up' + click_button 'Register' sent_token = /.*confirmation_token=(.*)".*/.match(ActionMailer::Base.deliveries.last.body.to_s)[1] visit user_confirmation_path(confirmation_token: sent_token) @@ -145,7 +145,7 @@ feature 'Users' do OmniAuth.config.add_mock(:twitter, omniauth_twitter_hash) visit '/' - click_link 'Log in' + click_link 'Sign in' expect do expect do @@ -163,20 +163,20 @@ feature 'Users' do login_as(user) visit "/" - click_link 'Logout' + click_link 'Sign out' - expect(page).to have_content 'Signed out successfully.' + expect(page).to have_content 'You have been signed out successfully.' end scenario 'Reset password' do create(:user, email: 'manuela@madrid.es') visit '/' - click_link 'Log in' - click_link 'Forgot your password?' + click_link 'Sign in' + click_link 'Forgotten your password?' fill_in 'user_email', with: 'manuela@madrid.es' - click_button 'Send me reset password' + 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." diff --git a/spec/features/verification/email_spec.rb b/spec/features/verification/email_spec.rb index 95f6360c5..58a3f71fb 100644 --- a/spec/features/verification/email_spec.rb +++ b/spec/features/verification/email_spec.rb @@ -22,15 +22,15 @@ feature 'Verify email' do click_button "Send code" end - expect(page).to have_content 'We have send you a confirmation email to your email account: rock@example.com' + expect(page).to have_content 'We have sent a confirmation email to your account: rock@example.com' sent_token = /.*email_verification_token=(.*)".*/.match(ActionMailer::Base.deliveries.last.body.to_s)[1] visit email_path(email_verification_token: sent_token) - expect(page).to have_content "You are now a verified user" + expect(page).to have_content "You are a verified user" expect(page).to_not have_link "Verify my account" - expect(page).to have_content "Verified account" + expect(page).to have_content "Account verified" end scenario "Errors on token verification" do @@ -39,7 +39,7 @@ feature 'Verify email' do login_as(user) visit email_path(email_verification_token: "1234") - expect(page).to have_content "Incorrect verification code" + expect(page).to have_content "Verification code incorrect" end scenario "Errors on sending confirmation email" do @@ -60,6 +60,6 @@ feature 'Verify email' do verified_user.destroy click_button "Send code" - expect(page).to have_content "There was a problem sending you an email to your account" + expect(page).to have_content "There was a problem with sending an email to your account" end end \ No newline at end of file diff --git a/spec/features/verification/letter_spec.rb b/spec/features/verification/letter_spec.rb index bd98dd6cc..3d35e1bb3 100644 --- a/spec/features/verification/letter_spec.rb +++ b/spec/features/verification/letter_spec.rb @@ -35,7 +35,7 @@ feature 'Verify Letter' do login_as(user) visit new_letter_path - expect(page).to have_content 'You have not yet confirmed your residence' + expect(page).to have_content 'You have not yet confirmed your residency' expect(current_path).to eq(new_residence_path) end @@ -45,7 +45,7 @@ feature 'Verify Letter' do login_as(user) visit new_letter_path - expect(page).to have_content 'You have not yet enter the confirmation code' + expect(page).to have_content 'You have not yet entered the confirmation code' expect(current_path).to eq(new_sms_path) end diff --git a/spec/features/verification/level_three_verification_spec.rb b/spec/features/verification/level_three_verification_spec.rb index b03741f42..492af58d9 100644 --- a/spec/features/verification/level_three_verification_spec.rb +++ b/spec/features/verification/level_three_verification_spec.rb @@ -20,16 +20,16 @@ feature 'Level three verification' do click_button "Send code" end - expect(page).to have_content 'Phone confirmation' + expect(page).to have_content 'Security code confirmation' user = user.reload fill_in 'sms_confirmation_code', with: user.sms_confirmation_code click_button 'Send' - expect(page).to have_content "Correct code. Your account is verified" + expect(page).to have_content "Code correct. Your account is now verified" expect(page).to_not have_link "Verify my account" - expect(page).to have_content "Verified account" + expect(page).to have_content "Account verified" end scenario 'Verification with residency and verified email' do @@ -51,15 +51,15 @@ feature 'Level three verification' do click_button "Send code" end - expect(page).to have_content 'We have send you a confirmation email to your email account: rock@example.com' + expect(page).to have_content 'We have sent a confirmation email to your account: rock@example.com' sent_token = /.*email_verification_token=(.*)".*/.match(ActionMailer::Base.deliveries.last.body.to_s)[1] visit email_path(email_verification_token: sent_token) - expect(page).to have_content "You are now a verified user" + expect(page).to have_content "You are a verified user" expect(page).to_not have_link "Verify my account" - expect(page).to have_content "Verified account" + expect(page).to have_content "Account verified" end scenario 'Verification with residency and sms and letter' do @@ -75,15 +75,15 @@ feature 'Level three verification' do fill_in 'sms_phone', with: "611111111" click_button 'Send' - expect(page).to have_content 'Phone confirmation' + expect(page).to have_content 'Security code confirmation' user = user.reload fill_in 'sms_confirmation_code', with: user.sms_confirmation_code click_button 'Send' - expect(page).to have_content 'Correct code' + expect(page).to have_content 'Code correct' - 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." end diff --git a/spec/features/verification/level_two_verification_spec.rb b/spec/features/verification/level_two_verification_spec.rb index ac0bf1a2f..e0374825f 100644 --- a/spec/features/verification/level_two_verification_spec.rb +++ b/spec/features/verification/level_two_verification_spec.rb @@ -14,13 +14,13 @@ feature 'Level two verification' do fill_in 'sms_phone', with: "611111111" click_button 'Send' - expect(page).to have_content 'Phone confirmation' + expect(page).to have_content 'Security code confirmation' user = user.reload fill_in 'sms_confirmation_code', with: user.sms_confirmation_code click_button 'Send' - expect(page).to have_content 'Correct code' + expect(page).to have_content 'Code correct' 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 29e20ea5a..67c652955 100644 --- a/spec/features/verification/residence_spec.rb +++ b/spec/features/verification/residence_spec.rb @@ -10,7 +10,7 @@ feature 'Residence' do click_link 'Verify my account' fill_in 'residence_document_number', with: "12345678Z" - select 'Spanish ID', from: 'residence_document_type' + select 'DNI', from: 'residence_document_type' select_date '31-December-1980', from: 'residence_date_of_birth' fill_in 'residence_postal_code', with: '28013' check 'residence_terms_of_service' @@ -40,7 +40,7 @@ feature 'Residence' do click_link 'Verify my account' fill_in 'residence_document_number', with: "12345678Z" - select 'Spanish ID', from: 'residence_document_type' + select 'DNI', from: 'residence_document_type' select '1997', from: 'residence_date_of_birth_1i' select 'January', from: 'residence_date_of_birth_2i' select '1', from: 'residence_date_of_birth_3i' @@ -49,7 +49,7 @@ feature 'Residence' do click_button 'Verify residence' - expect(page).to have_content 'To verify your account you need to be in the census of the Madrid town.' + expect(page).to have_content 'In order to be verified, you must be registered in the municipality of Madrid' end scenario 'Error on Madrid census' do @@ -60,7 +60,7 @@ feature 'Residence' do click_link 'Verify my account' fill_in 'residence_document_number', with: "12345678Z" - select 'Spanish ID', from: 'residence_document_type' + select 'DNI', from: 'residence_document_type' select '1997', from: 'residence_date_of_birth_1i' select 'January', from: 'residence_date_of_birth_2i' select '1', from: 'residence_date_of_birth_3i' @@ -69,7 +69,7 @@ feature 'Residence' do click_button 'Verify residence' - expect(page).to have_content 'The census of the city of Madrid could not verify your information' + expect(page).to have_content 'The Madrid Census was unable to verify your information' end scenario '5 tries allowed' do @@ -81,7 +81,7 @@ feature 'Residence' do 5.times do fill_in 'residence_document_number', with: "12345678Z" - select 'Spanish ID', from: 'residence_document_type' + select 'DNI', from: 'residence_document_type' select '1997', from: 'residence_date_of_birth_1i' select 'January', from: 'residence_date_of_birth_2i' select '1', from: 'residence_date_of_birth_3i' @@ -89,15 +89,15 @@ feature 'Residence' do check 'residence_terms_of_service' click_button 'Verify residence' - expect(page).to have_content 'The census of the city of Madrid could not verify your information' + expect(page).to have_content 'The Madrid Census was unable to verify your information' end click_button 'Verify residence' - 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) visit new_residence_path - 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 end \ No newline at end of file diff --git a/spec/features/verification/sms_spec.rb b/spec/features/verification/sms_spec.rb index 1d8026b81..97e5917f7 100644 --- a/spec/features/verification/sms_spec.rb +++ b/spec/features/verification/sms_spec.rb @@ -11,13 +11,13 @@ feature 'SMS Verification' do fill_in 'sms_phone', with: "611111111" click_button 'Send' - expect(page).to have_content 'Phone confirmation' + expect(page).to have_content 'Security code confirmation' user = user.reload fill_in 'sms_confirmation_code', with: user.sms_confirmation_code click_button 'Send' - expect(page).to have_content 'Correct code' + expect(page).to have_content 'Code correct' end scenario 'Errors on phone number' do @@ -40,7 +40,7 @@ feature 'SMS Verification' do fill_in 'sms_phone', with: "611111111" click_button 'Send' - expect(page).to have_content 'Phone confirmation' + expect(page).to have_content 'Security code confirmation' click_button 'Send' @@ -53,7 +53,7 @@ feature 'SMS Verification' do visit new_sms_path - expect(page).to have_content 'You have not yet confirmed your residence' + expect(page).to have_content 'You have not yet confirmed your residency' expect(current_path).to eq(new_residence_path) end @@ -66,14 +66,14 @@ feature 'SMS Verification' do 5.times do fill_in 'sms_phone', with: "611111111" click_button 'Send' - click_link 'Request a new code' + click_link 'Click here to send it again' 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) visit new_sms_path - 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/verification_path_spec.rb b/spec/features/verification/verification_path_spec.rb index 7ec9fa8ff..c6da931df 100644 --- a/spec/features/verification/verification_path_spec.rb +++ b/spec/features/verification/verification_path_spec.rb @@ -19,7 +19,7 @@ feature 'Verification path' do visit verification_path expect(current_path).to eq account_path - expect(page).to have_content 'You are a verified user!' + expect(page).to have_content 'Your account is already verified' end scenario "User requested a letter" do @@ -95,7 +95,7 @@ feature 'Verification path' do visit step_path expect(current_path).to eq account_path - expect(page).to have_content 'You are a verified user!' + expect(page).to have_content 'Your account is already verified' end end end \ No newline at end of file diff --git a/spec/features/verification/verified_user_spec.rb b/spec/features/verification/verified_user_spec.rb index 032136b84..38097004e 100644 --- a/spec/features/verification/verified_user_spec.rb +++ b/spec/features/verification/verified_user_spec.rb @@ -86,7 +86,7 @@ feature 'Verified users' do click_button "Send code" end - expect(page).to have_content 'We have send you a confirmation email to your email account: rock@example.com' + expect(page).to have_content 'We have sent a confirmation email to your account: rock@example.com' expect(current_path).to eq(account_path) end @@ -121,7 +121,7 @@ feature 'Verified users' do login_as(user) visit verified_user_path - click_link "Use another phone" + click_link "Use other phone" expect(current_path).to eq(new_sms_path) end diff --git a/spec/features/votes_spec.rb b/spec/features/votes_spec.rb index 31498191a..a894c8ab4 100644 --- a/spec/features/votes_spec.rb +++ b/spec/features/votes_spec.rb @@ -177,8 +177,6 @@ feature 'Votes' do expect(current_path).to eq(debates_path) end end - - end feature 'Proposals' do @@ -194,15 +192,15 @@ feature 'Votes' do within("#proposals") do within("#proposal_#{proposal1.id}_votes") do - expect(page).to have_content "You already supported this proposal, share it!" + expect(page).to have_content "You have already supported this proposal. Share it!" end within("#proposal_#{proposal2.id}_votes") do - expect(page).to_not have_content "You already supported this proposal, share it!" + expect(page).to_not have_content "You have already supported this proposal. Share it!" end within("#proposal_#{proposal3.id}_votes") do - expect(page).to_not have_content "You already supported this proposal, share it!" + expect(page).to_not have_content "You have already supported this proposal. Share it!" end end end @@ -246,7 +244,7 @@ feature 'Votes' do find('.in-favor a').click expect(page).to have_content "1 support" - expect(page).to have_content "You already supported this proposal, share it!" + expect(page).to have_content "You have already supported this proposal. Share it!" end end @@ -258,7 +256,7 @@ feature 'Votes' do find('.in-favor a').click expect(page).to have_content "1 support" - expect(page).to have_content "You already supported this proposal, share it!" + expect(page).to have_content "You have already supported this proposal. Share it!" end expect(current_path).to eq(proposals_path) end @@ -284,12 +282,6 @@ feature 'Votes' do find("div.votes").hover expect_message_you_need_to_sign_in end - - visit debate_path(debate) - within("#debate_#{debate.id}") do - find("div.votes").hover - expect_message_you_need_to_sign_in - end end scenario 'Not logged user trying to vote proposals', :js do diff --git a/spec/features/welcome_spec.rb b/spec/features/welcome_spec.rb index f75eadd0c..a98ff6e43 100644 --- a/spec/features/welcome_spec.rb +++ b/spec/features/welcome_spec.rb @@ -21,9 +21,9 @@ feature "Welcome screen" do fill_in 'user_email', with: user.email fill_in 'user_password', with: user.password - click_button 'Log in' + click_button 'Enter' - expect(page).to have_content("You are now a verified user") + expect(page).to have_content("You are a verified user") expect(current_path).to eq(account_path) end diff --git a/spec/helpers/user_helper_spec.rb b/spec/helpers/user_helper_spec.rb index bb0df0de5..a30b2eecf 100644 --- a/spec/helpers/user_helper_spec.rb +++ b/spec/helpers/user_helper_spec.rb @@ -4,7 +4,7 @@ describe UserHelper do describe '#humanize_document_type' do it "should return a humanized document type" do - expect(humanize_document_type("1")).to eq "Spanish ID" + expect(humanize_document_type("1")).to eq "DNI" expect(humanize_document_type("2")).to eq "Passport" expect(humanize_document_type("3")).to eq "Residence card" end diff --git a/spec/models/residence_spec.rb b/spec/models/residence_spec.rb index 5396aacd3..33f339012 100644 --- a/spec/models/residence_spec.rb +++ b/spec/models/residence_spec.rb @@ -26,7 +26,7 @@ describe Verification::Residence do it "should validate user has allowed age" do residence = Verification::Residence.new({"date_of_birth(3i)"=>"1", "date_of_birth(2i)"=>"1", "date_of_birth(1i)"=>"#{5.year.ago.year}"}) expect(residence).to_not be_valid - expect(residence.errors[:date_of_birth]).to include("You need yo be at least 16 years old") + expect(residence.errors[:date_of_birth]).to include("You must be at least 16 years old") end describe "postal code" do @@ -48,7 +48,7 @@ describe Verification::Residence do residence.postal_code = "13280" residence.valid? expect(residence.errors[:postal_code].size).to eq(1) - expect(residence.errors[:postal_code]).to include("To verify your account you need to be in the census of the Madrid town.") + expect(residence.errors[:postal_code]).to include("In order to be verified, you must be registered in the municipality of Madrid.") end end diff --git a/spec/support/common_actions.rb b/spec/support/common_actions.rb index 5a3f2d7e5..ecb8a6f10 100644 --- a/spec/support/common_actions.rb +++ b/spec/support/common_actions.rb @@ -2,7 +2,8 @@ module CommonActions def sign_up(email='manuela@madrid.es', password='judgementday') visit '/' - click_link 'Sign up' + + click_link 'Register' fill_in 'user_username', with: "Manuela Carmena #{rand(99999)}" fill_in 'user_email', with: email @@ -11,17 +12,17 @@ module CommonActions fill_in 'user_captcha', with: correct_captcha_text check 'user_terms_of_service' - click_button 'Sign up' + click_button 'Register' end def login_through_form_as(user) visit root_path - click_link 'Log in' + click_link 'Sign in' fill_in 'user_email', with: user.email fill_in 'user_password', with: user.password - click_button 'Log in' + click_button 'Enter' end def login_as_manager @@ -47,11 +48,11 @@ module CommonActions create(:user, email: 'manuela@madrid.es') visit '/' - click_link 'Log in' - click_link 'Forgot your password?' + click_link 'Sign in' + click_link 'Forgotten your password?' fill_in 'user_email', with: 'manuela@madrid.es' - click_button 'Send me reset password' + click_button 'Send instructions' end def comment_on(commentable, user = nil) @@ -107,7 +108,7 @@ module CommonActions end def error_message - /\d errors? prohibited this (.*) from being saved:/ + /\d errors? prevented this (.*) from being saved:/ end def expect_to_be_signed_in @@ -123,7 +124,7 @@ module CommonActions end def verify_residence - select 'Spanish ID', from: 'residence_document_type' + select 'DNI', from: 'residence_document_type' fill_in 'residence_document_number', with: "12345678Z" select_date '31-December-1980', from: 'residence_date_of_birth' fill_in 'residence_postal_code', with: '28013' @@ -137,27 +138,27 @@ module CommonActions fill_in 'sms_phone', with: "611111111" click_button 'Send' - expect(page).to have_content 'Phone confirmation' + expect(page).to have_content 'Enter the confirmation code sent to you by text message' user = User.last.reload fill_in 'sms_confirmation_code', with: user.sms_confirmation_code click_button 'Send' - expect(page).to have_content 'Correct code' + expect(page).to have_content 'Code correct' end def expect_message_you_need_to_sign_in - expect(page).to have_content 'You need to sign in or sign up before continuing' + expect(page).to have_content 'You must Sign in or Sign up to continue' expect(page).to have_selector('.in-favor a', visible: false) end def expect_message_to_many_anonymous_votes - expect(page).to have_content 'Too many anonymous votes, verify your account to vote.' + expect(page).to have_content 'Too many anonymous votes to admit vote' expect(page).to have_selector('.in-favor a', visible: false) end def expect_message_only_verified_can_vote_proposals - expect(page).to have_content 'Proposals can only be voted by verified users, verify your account.' + expect(page).to have_content 'Only verified users can vote on proposals' expect(page).to have_selector('.in-favor a', visible: false) end