diff --git a/Gemfile b/Gemfile index 7a00911fe..392aa2bfd 100644 --- a/Gemfile +++ b/Gemfile @@ -49,6 +49,7 @@ gem 'daemons' gem 'devise-async' gem 'newrelic_rpm', '~> 3.14' gem 'whenever', require: false +gem 'pg_search' gem 'ahoy_matey', '~> 1.2.1' gem 'groupdate' # group temporary data diff --git a/Gemfile.lock b/Gemfile.lock index 4721ee9de..6ec99b1a7 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -263,6 +263,10 @@ GEM paranoia (2.1.3) activerecord (~> 4.0) pg (0.18.3) + pg_search (1.0.5) + activerecord (>= 3.1) + activesupport (>= 3.1) + arel poltergeist (1.7.0) capybara (~> 2.1) cliver (~> 0.3.1) @@ -455,6 +459,7 @@ DEPENDENCIES omniauth-twitter paranoia pg + pg_search poltergeist quiet_assets rails (= 4.2.4) diff --git a/app/assets/images/header_print_proposals.jpg b/app/assets/images/header_print_proposals.jpg new file mode 100644 index 000000000..4d2eb18a5 Binary files /dev/null and b/app/assets/images/header_print_proposals.jpg differ diff --git a/app/assets/stylesheets/admin.scss b/app/assets/stylesheets/admin.scss index 2f6b1f0c6..66adef5de 100644 --- a/app/assets/stylesheets/admin.scss +++ b/app/assets/stylesheets/admin.scss @@ -92,6 +92,10 @@ body.admin { } } +.for-print-only { + display: none; +} + // 02. Sidebar // - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/app/assets/stylesheets/layout.scss b/app/assets/stylesheets/layout.scss index e9429a495..2a78d3cc7 100644 --- a/app/assets/stylesheets/layout.scss +++ b/app/assets/stylesheets/layout.scss @@ -687,6 +687,7 @@ header { line-height: $line-height*3; margin-left: rem-calc(12); margin-right: rem-calc(36); + margin-right: 12px\9; } &:after { @@ -898,6 +899,13 @@ form.locale-form { select { background-image: image-url("language_select.png"); + option { + background: white; + color: $text; + border: 0; + outline: none; + } + &.locale-switcher { background-color: transparent; border: 0; @@ -916,6 +924,19 @@ form { line-height: $line-height; } + input, textarea { + height: 48px\9; + line-height: 48px\9; + margin-bottom: 24px\9; + width: 100%\9; + } + + input[type="checkbox"] { + height: auto\9; + line-height: inherit\9; + width: auto\9; + } + input[type]:not([type=submit]):not([type=file]):not([type=checkbox]) { background: $input-bg; height: rem-calc(48); diff --git a/app/assets/stylesheets/print.css b/app/assets/stylesheets/print.css index 0c67035c8..ef76f607e 100644 --- a/app/assets/stylesheets/print.css +++ b/app/assets/stylesheets/print.css @@ -2,6 +2,8 @@ /* Print proposals */ +.admin-content { margin-top: 0 !important; } + .tags a { display: none !important; } .supports { display: none !important; } @@ -24,7 +26,7 @@ img.left { display: none !important; } .captcha { display: none !important; } -li.name span { display: none !important; } +li.name { display: none !important; } p.proposal-info span:nth-child(3) { display: none !important; } @@ -36,11 +38,22 @@ p.proposal-info span:nth-child(3) { display: none !important; } input[type="submit"] { display: none !important; } +.filters h2 { margin: 0 !important; font-size: 20px !important; line-height: 20px !important; width: auto !important; } + +.search-results h2 { margin: 0 !important; font-size: 20px !important; line-height: 20px !important; } + +.admin h2 { font-size: 20px !important; line-height: 20px !important; } + .select-order { - border: 0; - font-size: 24px; - font-weight: bold; - margin-left: -6px; + border: 0 !important; + font-size: 20px !important; + font-weight: bold !important; + line-height: 20px !important; + margin-left: 10px !important; + margin-top: 0 !important; + margin-bottom: 0 !important; + margin-right: 0 !important; + padding: 0 !important; } p.proposal-info { margin-left: -6px; } @@ -49,16 +62,26 @@ a { text-decoration: none !important; } a:after { content: none !important; } -.proposal .panel { min-height: auto !important; } +.proposal .panel { min-height: auto !important; margin: 0 !important; padding-bottom: 0 !important; padding-left: 0 !important; } .proposal .panel .proposal-content { min-height: auto !important; } -.proposal .panel h3 { min-height: auto !important; } +.proposal .panel h3 { min-height: auto !important; font-size: 16px !important; } -.proposal .panel .proposal-description { height: auto; } +.proposal .panel .proposal-description { height: auto !important; margin-bottom: 0 !important; } .proposal .panel { border-left: 0 !important; border-right: 0 !important; border-top: 0 !important; } + +.for-print-only { display: block !important; } + +.for-print-only p { font-size: 14px !important; line-height: 24px !important; } + +.not-print { display: none !important; } + +.date-for-print { font-size: 14px !important; line-height: 20px !important; } + +.filters { height: 48px !important;} diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index d97d59a98..ecd057d14 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -6,8 +6,6 @@ class ApplicationController < ActionController::Base include HasOrders before_action :authenticate_http_basic, if: :http_basic_auth_site? - before_action :authenticate_user!, unless: :devise_controller?, if: :beta_site? - before_action :authenticate_beta_tester!, unless: :devise_controller?, if: :beta_site? before_action :ensure_signup_complete before_action :set_locale @@ -33,21 +31,6 @@ class ApplicationController < ActionController::Base end end - def authenticate_beta_tester! - unless signed_in? && beta_testers.include?(current_user.email) - sign_out(current_user) - redirect_to new_user_session_path, alert: t('application.alert.only_beta_testers') - end - end - - def beta_testers - File.readlines('config/beta-testers.txt').map {|email| email.strip } - end - - def beta_site? - Rails.application.secrets.beta_site - end - def http_basic_auth_site? Rails.application.secrets.http_basic_auth end diff --git a/app/controllers/proposals_controller.rb b/app/controllers/proposals_controller.rb index f91e65b8a..50b436e58 100644 --- a/app/controllers/proposals_controller.rb +++ b/app/controllers/proposals_controller.rb @@ -13,7 +13,7 @@ class ProposalsController < ApplicationController respond_to :html, :js def index_customization - @featured_proposals = Proposal.all.sort_by_confidence_score.limit(3) if @search_terms.blank? + @featured_proposals = Proposal.all.sort_by_confidence_score.limit(3) if (@search_terms.blank? && @tag_filter.blank?) if @featured_proposals.present? set_featured_proposal_votes(@featured_proposals) @resources = @resources.where('proposals.id NOT IN (?)', @featured_proposals.map(&:id)) diff --git a/app/models/debate.rb b/app/models/debate.rb index 0b64b7b1e..74403139c 100644 --- a/app/models/debate.rb +++ b/app/models/debate.rb @@ -5,6 +5,7 @@ class Debate < ActiveRecord::Base include Conflictable include Measurable include Sanitizable + include PgSearch apply_simple_captcha acts_as_votable @@ -36,6 +37,22 @@ class Debate < ActiveRecord::Base # Ahoy setup visitable # Ahoy will automatically assign visit_id on create + pg_search_scope :pg_search, { + against: { + title: 'A', + description: 'B' + }, + associated_against: { + tags: :name + }, + using: { + tsearch: { dictionary: "spanish" }, + trigram: { threshold: 0.1 }, + }, + ranked_by: '(:tsearch + debates.cached_votes_up)', + order_within_rank: "debates.created_at DESC" + } + def description super.try :html_safe end diff --git a/app/models/proposal.rb b/app/models/proposal.rb index 7d5a5bb17..dd2560ba1 100644 --- a/app/models/proposal.rb +++ b/app/models/proposal.rb @@ -4,6 +4,7 @@ class Proposal < ActiveRecord::Base include Conflictable include Measurable include Sanitizable + include PgSearch apply_simple_captcha acts_as_votable @@ -38,12 +39,30 @@ class Proposal < ActiveRecord::Base scope :sort_by_random, -> { order("RANDOM()") } scope :sort_by_flags, -> { order(flags_count: :desc, updated_at: :desc) } + pg_search_scope :pg_search, { + against: { + title: 'A', + question: 'B', + summary: 'C', + description: 'D' + }, + associated_against: { + tags: :name + }, + using: { + tsearch: { dictionary: "spanish" }, + trigram: { threshold: 0.1 }, + }, + ranked_by: '(:tsearch + proposals.cached_votes_up)', + order_within_rank: "proposals.created_at DESC" + } + def description super.try :html_safe end def total_votes - cached_votes_up + cached_votes_up + physical_votes end def editable? @@ -74,14 +93,13 @@ class Proposal < ActiveRecord::Base def calculate_hot_score self.hot_score = ScoreCalculator.hot_score(created_at, - cached_votes_up, - cached_votes_up, + total_votes, + total_votes, comments_count) end def calculate_confidence_score - self.confidence_score = ScoreCalculator.confidence_score(cached_votes_up, - cached_votes_up) + self.confidence_score = ScoreCalculator.confidence_score(total_votes, total_votes) end def after_hide @@ -93,7 +111,7 @@ class Proposal < ActiveRecord::Base end def self.search(terms) - terms.present? ? where("title ILIKE ? OR description ILIKE ? OR question ILIKE ?", "%#{terms}%", "%#{terms}%", "%#{terms}%") : none + self.pg_search(terms) end def self.votes_needed_for_success diff --git a/app/views/layouts/_header.html.erb b/app/views/layouts/_header.html.erb index 2cb65d162..8ca4e1022 100644 --- a/app/views/layouts/_header.html.erb +++ b/app/views/layouts/_header.html.erb @@ -60,7 +60,6 @@
diff --git a/config/deploy.rb b/config/deploy.rb index 5d4b15960..e62d65160 100644 --- a/config/deploy.rb +++ b/config/deploy.rb @@ -57,7 +57,6 @@ namespace :deploy do # Custom compile and rsync of assets - works, but it is very slow #after 'deploy:symlink:shared', 'deploy:compile_assets_locally' - after :finishing, 'deploy:beta_testers' after :finishing, 'deploy:cleanup' # Restart unicorn after 'deploy:publishing', 'deploy:restart' diff --git a/config/locales/activemodel.en.yml b/config/locales/activemodel.en.yml index ad43d1516..f62fd1ec6 100644 --- a/config/locales/activemodel.en.yml +++ b/config/locales/activemodel.en.yml @@ -2,17 +2,17 @@ en: activemodel: models: verification: - residence: Residence - sms: SMS + residence: "Residence" + sms: "SMS" attributes: verification: residence: - document_type: Document type - document_number: Document number(including letter) - date_of_birth: Date of birth - postal_code: Postal code + document_type: "Document type" + document_number: "Document number (including letters)" + date_of_birth: "Date of birth" + postal_code: "Postcode" sms: - phone: 'Phone' - confirmation_code: 'Confirmation code' + phone: "Telephone" + confirmation_code: "Confirmation code" email: - recipient: 'Email' \ No newline at end of file + recipient: "Email" \ No newline at end of file diff --git a/config/locales/activemodel.es.yml b/config/locales/activemodel.es.yml index 9bda561cf..e45eade16 100644 --- a/config/locales/activemodel.es.yml +++ b/config/locales/activemodel.es.yml @@ -2,17 +2,17 @@ es: activemodel: models: verification: - residence: Residencia - sms: SMS + residence: "Residencia" + sms: "SMS" attributes: verification: residence: - document_type: Tipo documento - document_number: Numero de documento (incluida letra) - date_of_birth: Fecha de nacimiento - postal_code: 'Código postal' + document_type: "Tipo documento" + document_number: "Numero de documento (incluida letra)" + date_of_birth: "Fecha de nacimiento" + postal_code: "Código postal" sms: - phone: 'Teléfono' - confirmation_code: 'Código de confirmación' + phone: "Teléfono" + confirmation_code: "Código de confirmación" email: - recipient: 'Email' \ No newline at end of file + recipient: "Email" \ No newline at end of file diff --git a/config/locales/activerecord.en.yml b/config/locales/activerecord.en.yml index 3bf203bc5..4e9cd5931 100644 --- a/config/locales/activerecord.en.yml +++ b/config/locales/activerecord.en.yml @@ -7,46 +7,68 @@ en: email: password_already_set: "This user already has a password" models: - activity: Activity - comment: Comment - debate: Debate - proposal: Proposal - tag: Topic - user: User - vote: Vote - organization: Organization + activity: + one: "activity" + other: "activities" + comment: + one: "Comment" + other: "Comments" + debate: + one: "Debate" + other: "Debates" + tag: + one: "Tag" + other: "Tags" + user: + one: "User" + other: "Users" + moderator: + one: "Moderator" + other: "Moderators" + administrator: + one: "Administrator" + other: "Administrators" + vote: + one: "Vote" + other: "Votes" + organization: + one: "Organisation" + other: "Organisations" + proposal: + one: "Citizen proposal" + other: "Citizen proposals" attributes: comment: - body: Comment - user: User + body: "Comment" + user: "User" debate: - author: Author - description: Opinion - terms_of_service: Terms of service - title: Title + author: "Author" + description: "Opinion" + terms_of_service: "Terms of service" + title: "Title" proposal: - author: Author - title: Title - question: Question - description: Description - terms_of_service: Terms of service + author: "Author" + title: "Title" + question: "Question" + description: "Description" + terms_of_service: "Terms of service" user: - email: Email - username: Username - password: Password - phone_number: Phone number - official_position: Official position - official_level: Official level + email: "Email" + username: "Username" + password: "Password" + phone_number: "Phone number" + official_position: "Official position" + official_level: "Official level" organization: - name: Organization name - responsible_name: Person in charge + name: "Name of organisation" + responsible_name: "Person responsible for the group" errors: models: debate: attributes: tag_list: - less_than_or_equal_to: tags must be less than or equal to %{count} + less_than_or_equal_to: "tags must be less than or equal to %{count}" proposal: attributes: tag_list: - less_than_or_equal_to: tags must be less than or equal to %{count} \ No newline at end of file + less_than_or_equal_to: "tags must be less than or equal to %{count}" diff --git a/config/locales/activerecord.es.yml b/config/locales/activerecord.es.yml index b5db2f3ab..998bc4fb6 100644 --- a/config/locales/activerecord.es.yml +++ b/config/locales/activerecord.es.yml @@ -8,67 +8,67 @@ es: password_already_set: "Este usuario ya tiene una clave asociada" models: activity: - one: actividad - other: actividades + one: "actividad" + other: "actividades" comment: - one: Comentario - other: Comentarios + one: "Comentario" + other: "Comentarios" debate: - one: Debate - other: Debates + one: "Debate" + other: "Debates" tag: - one: Tema - other: Temas + one: "Tema" + other: "Temas" user: - one: Usuario - other: Usuarios + one: "Usuario" + other: "Usuarios" moderator: - one: Moderador - other: Moderadores + one: "Moderador" + other: "Moderadores" administrator: - one: Administrador - other: Administradores + one: "Administrador" + other: "Administradores" vote: - one: Voto - other: Voto + one: "Voto" + other: "Votos" organization: - one: Organización - other: Organizaciones + one: "Organización" + other: "Organizaciones" proposal: - one: Propuesta ciudadana - other: Propuestas ciudadanas + one: "Propuesta ciudadana" + other: "Propuestas ciudadanas" attributes: comment: - body: Comentario - user: Usuario + body: "Comentario" + user: "Usuario" debate: - author: Autor - description: Opinión - terms_of_service: Términos de servicio - title: Título + author: "Autor" + description: "Opinión" + terms_of_service: "Términos de servicio" + title: "Título" proposal: - author: Autor - title: Título - question: Pregunta - description: Descripción - terms_of_service: Términos de servicio + author: "Autor" + title: "Título" + question: "Pregunta" + description: "Descripción" + terms_of_service: "Términos de servicio" user: - email: Correo electrónico - username: Nombre de usuario - password: Contraseña - phone_number: Teléfono - official_position: Cargo público - official_level: Nivel del cargo + email: "Correo electrónico" + username: "Nombre de usuario" + password: "Contraseña" + phone_number: "Teléfono" + official_position: "Cargo público" + official_level: "Nivel del cargo" organization: - name: Nombre de organización - responsible_name: Persona responsable del colectivo + name: "Nombre de organización" + responsible_name: "Persona responsable del colectivo" errors: models: debate: attributes: tag_list: - less_than_or_equal_to: los temas deben ser menor o igual que %{count} + less_than_or_equal_to: "los temas deben ser menor o igual que %{count}" proposal: attributes: tag_list: - less_than_or_equal_to: los temas deben ser menor o igual que %{count} + less_than_or_equal_to: "los temas deben ser menor o igual que %{count}" diff --git a/config/locales/admin.en.yml b/config/locales/admin.en.yml old mode 100644 new mode 100755 index a70329132..276e3ca96 --- a/config/locales/admin.en.yml +++ b/config/locales/admin.en.yml @@ -2,177 +2,177 @@ en: admin: settings: index: - title: Global settings - update_setting: Update + title: "General settings" + update_setting: "Update" flash: - updated: 'Setting updated!' + updated: "Value updated" dashboard: index: - title: Administration + title: "Administration" menu: - settings: Global settings - debate_topics: Debate topics - hidden_proposals: Hidden proposals - hidden_debates: Hidden debates - hidden_comments: Hidden comments - hidden_users: Blocked users - incomplete_verifications: Incomplete verifications - organizations: Organizations - officials: Officials - moderators: Moderators - stats: Statistics - activity: Moderation Activity + settings: "General settings" + debate_topics: "Debate topics" + hidden_proposals: "Hidden proposals" + hidden_debates: "Hidden debates" + hidden_comments: "Hidden comments" + hidden_users: "Hidden users" + incomplete_verifications: "Incomplete verifications" + organizations: "Organisations" + officials: "Officials" + moderators: "Moderators" + stats: "Statistics" + activity: "Moderator activity" shared: user_search: - placeholder: 'Search user by name or email' - button: 'Search' + placeholder: "Search user by name or email'" + button: "Search" proposal_search: - placeholder: 'Search proposals by title, description or question' - button: 'Search' + placeholder: "Search proposals by title, description or question" + button: "Search" organizations: index: - title: Organizations - search_placeholder: "Name, email or phone" - search: Search - verify: Verify - reject: Reject - verified: Verified - rejected: Rejected - filter: Filter + title: "Organisations" + search_placeholder: "Name, email or phone number" + search: "Search" + verify: "Verify" + reject: "Reject" + verified: "Verified" + rejected: "Rejected" + filter: "Filter" filters: - all: All - pending: Pending - verified: Verified - rejected: Rejected + all: "All" + pending: "Pending" + verified: "Verified" + rejected: "Rejected" hidden_count: - one: "There is %{count} organization without user or with the user banned" - other: "There is %{count} organizations without user or with the user banned" + one: "There is also one organisation with no users or with a hidden user" + other: "There are %{count} organisations with no users or with a hidden user" search: - title: "Search Organizations" + title: "Search Organisations" actions: - hide: Hide - hide_author: Ban author - restore: Restore - confirm: 'Are you sure?' - confirm_hide: Confirm + hide: "Hide" + hide_author: "Hide author" + restore: "Restore" + confirm: "Are you sure?" + confirm_hide: "Confirm" tags: index: - title: 'Debate topics' - add_tag: 'Add a new debate topic' - mark_as_featured: 'Propose topic to create debate' + title: "Debate topics" + add_tag: "Add a new debate topic" + mark_as_featured: "Propose topic upon creating debate" name: - placeholder: 'Write a topic' - create: Create Topic - update: Update Topic - destroy: Delete Topic + placeholder: "Type the name of the topic" + create: "Create Topic" + update: "Update Topic" + destroy: "Destroy Topic" comments: index: - title: Hidden comments + title: "Hidden comments" hidden_proposal: "Hidden proposal" hidden_debate: "Hidden debate" - filter: Filter + filter: "Filter" filters: - all: All - with_confirmed_hide: Confirmed - without_confirmed_hide: Pending + all: "All" + with_confirmed_hide: "Confirmed" + without_confirmed_hide: "Pending" debates: index: - title: Hidden debates - filter: Filter + title: "Hidden debates" + filter: "Filter" filters: - all: All - with_confirmed_hide: Confirmed - without_confirmed_hide: Pending + all: "All" + with_confirmed_hide: "Confirmed" + without_confirmed_hide: "Pending" proposals: index: - title: Hidden proposals - filter: Filter + title: "Hidden proposals" + filter: "Filter" filters: - all: All - with_confirmed_hide: Confirmed - without_confirmed_hide: Pending + all: "All" + with_confirmed_hide: "Confirmed" + without_confirmed_hide: "Pending" users: index: - title: Banned users - filter: Filter + title: "Hidden users" + filter: "Filter" filters: - all: All - with_confirmed_hide: Confirmed - without_confirmed_hide: Pending + all: "All" + with_confirmed_hide: "Confirmed" + without_confirmed_hide: "Pending" show: - title: "User activity from %{user}" - back: Back + title: "Activity of user %{user}" + back: "Back" email: "Email:" registered_at: "Registered at:" hidden_at: "Hidden at:" verifications: index: - title: Incomplete verifications - phone_not_given: 'Phone not given' - sms_code_not_confirmed: 'Has not confirmed the sms code' + title: "Incomplete verifications" + phone_not_given: "Phone not given" + sms_code_not_confirmed: "Has not confirmed the sms code" officials: - level_0: Not an official - level_1: Level 1 - level_2: Level 2 - level_3: Level 3 - level_4: Level 4 - level_5: Level 5 + level_0: "Not official" + level_1: "Level 1" + level_2: "Level 2" + level_3: "Level 3" + level_4: "Level 4" + level_5: "Level 5" index: - title: Officials + title: "Officials" search: - title: 'Officials: Search users' - edit_official: Edit official - make_official: Make this user an official + title: "Official positions: User search" + edit_official: "Edit official" + make_official: "Make official" edit: - title: 'Officials: edit user' - destroy: "Remove 'Official' condition" - back: Back + title: "Officials: Edit user" + destroy: "Remove 'Official' status" + back: "Back" flash: - official_updated: 'Official position saved!' - official_destroyed: 'User is not an official anymore' + official_updated: "Details of official saved" + official_destroyed: "Details saved: the user is no longer an official" moderators: index: - title: Moderators + title: "Moderators" search: - email_placeholder: 'Search user by email' - search: Search - user_not_found: 'User not found' + email_placeholder: "Search user by email" + search: "Search" + user_not_found: "User not found" moderator: - delete: Delete - add: Add + delete: "Delete" + add: "Add" activity: show: - title: Activity of Moderators - action: Action - by: Moderated by - type: Type - filter: Show + title: "Moderator activity" + action: "Action" + by: "Moderated by" + type: "Type" + filter: "Show" filters: - all: All - on_proposals: On Proposals - on_debates: On Debates - on_comments: On Comments - on_users: On Users + all: "All" + on_proposals: "Proposals" + on_debates: "Debates" + on_comments: "Comments" + on_users: "Users" actions: - hide: Hidden - restore: Restored - block: Blocked + hide: "Hidden" + restore: "Restored" + block: "Blocked" stats: show: - stats_title: Stats - visits_title: Visits - combined_title: Combined + stats_title: "Stats" + visits_title: "Visits" + combined_title: "Combined" summary: - visits: Visits - debates: Debates - proposals: Proposals - comments: Comments - debate_votes: Debate votes - proposal_votes: Proposal votes - comment_votes: Comment votes - votes: Total votes - user_level_three: Level three users - user_level_two: Level two users - unverified_users: Unverified users - verified_users: Verified users - users: Total users \ No newline at end of file + visits: "Visits" + debates: "Debates" + proposals: "Proposals" + comments: "Comments" + debate_votes: "Debate votes" + proposal_votes: "Proposal votes" + comment_votes: "Comment votes" + votes: "Total votes" + user_level_three: "Level three users" + user_level_two: "Level two users" + unverified_users: "Unverified users" + verified_users: "Verified users" + users: "Total users" \ No newline at end of file diff --git a/config/locales/admin.es.yml b/config/locales/admin.es.yml index 40aef5f24..b124d60e3 100644 --- a/config/locales/admin.es.yml +++ b/config/locales/admin.es.yml @@ -2,177 +2,177 @@ es: admin: settings: index: - title: Configuración global - update_setting: Actualizar + title: "Configuración global" + update_setting: "Actualizar" flash: - updated: 'Valor actualizado' + updated: "Valor actualizado" dashboard: index: - title: Administración + title: "Administración" menu: - settings: Configuración global - debate_topics: Temas de debate - hidden_proposals: Propuestas ocultas - hidden_debates: Debates ocultos - hidden_comments: Comentarios ocultos - hidden_users: Usuarios bloqueados - incomplete_verifications: Verificaciones incompletas - organizations: Organizaciones - officials: Cargos públicos - moderators: Moderadores - stats: Estadísticas - activity: Actividad de moderadores + settings: "Configuración global" + debate_topics: "Temas de debate" + hidden_proposals: "Propuestas ocultas" + hidden_debates: "Debates ocultos" + hidden_comments: "Comentarios ocultos" + hidden_users: "Usuarios bloqueados" + incomplete_verifications: "Verificaciones incompletas" + organizations: "Organizaciones" + officials: "Cargos públicos" + moderators: "Moderadores" + stats: "Estadísticas" + activity: "Actividad de moderadores" shared: user_search: - placeholder: 'Buscar usuario por nombre o email' - button: 'Buscar' + placeholder: "Buscar usuario por nombre o email" + button: "Buscar" proposal_search: - placeholder: 'Buscar propuestas por título, descripción o pregunta' - button: 'Buscar' + placeholder: "Buscar propuestas por título, descripción o pregunta" + button: "Buscar" organizations: index: - title: Organizaciones + title: "Organizaciones" search_placeholder: "Nombre, email o teléfono" - search: Buscar - verify: Verificar - reject: Rechazar - verified: Verificada - rejected: Rechazada - filter: Filtro + search: "Buscar" + verify: "Verificar" + reject: "Rechazar" + verified: "Verificada" + rejected: "Rechazada" + filter: "Filtro" filters: - all: Todas - pending: Pendientes - verified: Verificadas - rejected: Rechazadas + all: "Todas" + pending: "Pendientes" + verified: "Verificadas" + rejected: "Rechazadas" hidden_count: one: "Hay además una organización sin usuario o con el usuario bloqueado" other: "Hay %{count} organizaciones sin usuario o con el usuario bloqueado" search: title: "Buscar Organizaciones" actions: - hide: Ocultar - hide_author: Bloquear al autor - restore: Volver a mostrar - confirm: '¿Estás seguro?' - confirm_hide: Confirmar + hide: "Ocultar" + hide_author: "Bloquear al autor" + restore: "Volver a mostrar" + confirm: "¿Estás seguro?" + confirm_hide: "Confirmar" tags: index: - title: 'Temas de debate' - add_tag: 'Añade un nuevo tema de debate' - mark_as_featured: 'Proponer tema al crear debate' + title: "Temas de debate" + add_tag: "Añade un nuevo tema de debate" + mark_as_featured: "Proponer tema al crear debate" name: - placeholder: 'Escribe el nombre del tema' - create: Crear Tema - update: Actualizar Tema - destroy: Eliminar Tema + placeholder: "Escribe el nombre del tema" + create: "Crear Tema" + update: "Actualizar Tema" + destroy: "Eliminar Tema" comments: index: - title: Comentarios ocultos + title: "Comentarios ocultos" hidden_proposal: "Propuesta oculta" hidden_debate: "Debate oculto" - filter: Filtro + filter: "Filtro" filters: - all: Todos - with_confirmed_hide: Confirmados - without_confirmed_hide: Pendientes + all: "Todos" + with_confirmed_hide: "Confirmados" + without_confirmed_hide: "Pendientes" debates: index: - title: Debates ocultos - filter: Filtro + title: "Debates ocultos" + filter: "Filtro" filters: - all: Todos - with_confirmed_hide: Confirmados - without_confirmed_hide: Pendientes + all: "Todos" + with_confirmed_hide: "Confirmados" + without_confirmed_hide: "Pendientes" proposals: index: - title: Propuestas ocultos - filter: Filtro + title: "Propuestas ocultos" + filter: "Filtro" filters: - all: Todas - with_confirmed_hide: Confirmadas - without_confirmed_hide: Pendientes + all: "Todas" + with_confirmed_hide: "Confirmadas" + without_confirmed_hide: "Pendientes" users: index: - title: Usuarios bloqueados - filter: Filtro + title: "Usuarios bloqueados" + filter: "Filtro" filters: - all: Todos - with_confirmed_hide: Confirmados - without_confirmed_hide: Pendientes + all: "Todos" + with_confirmed_hide: "Confirmados" + without_confirmed_hide: "Pendientes" show: title: "Actividad del usuario %{user}" - back: Volver + back: "Volver" email: "Email:" registered_at: "Fecha de alta:" hidden_at: "Bloqueado:" verifications: index: - title: Verificaciones incompletas - phone_not_given: 'No ha dado su teléfono' - sms_code_not_confirmed: 'No ha introducido su código de seguridad' + title: "Verificaciones incompletas" + phone_not_given: "No ha dado su teléfono" + sms_code_not_confirmed: "No ha introducido su código de seguridad" officials: level_0: "No es cargo público" - level_1: Nivel 1 - level_2: Nivel 2 - level_3: Nivel 3 - level_4: Nivel 4 - level_5: Nivel 5 + level_1: "Nivel 1" + level_2: "Nivel 2" + level_3: "Nivel 3" + level_4: "Nivel 4" + level_5: "Nivel 5" index: - title: Cargos Públicos + title: "Cargos Públicos" search: - title: 'Cargos Públicos: Búsqueda de usuarios' - edit_official: Editar cargo público - make_official: Convertir en cargo público + title: "Cargos Públicos: Búsqueda de usuarios" + edit_official: "Editar cargo público" + make_official: "Convertir en cargo público" edit: - title: 'Cargos Públicos: Editar usuario' + title: "Cargos Públicos: Editar usuario" destroy: "Eliminar condición de 'Cargo Público'" - back: Volver + back: "Volver" flash: - official_updated: 'Datos del cargo público guardados' - official_destroyed: 'Datos guardados: el usuario ya no es cargo público' + official_updated: "Datos del cargo público guardados" + official_destroyed: "Datos guardados: el usuario ya no es cargo público" moderators: index: - title: Moderadores + title: "Moderadores" search: - email_placeholder: 'Buscar usuario por email' - search: Buscar - user_not_found: 'Usuario no encontrado' + email_placeholder: "Buscar usuario por email" + search: "Buscar" + user_not_found: "Usuario no encontrado" moderator: - delete: Borrar - add: Añadir + delete: "Borrar" + add: "Añadir" activity: show: - title: Actividad de los Moderadores - action: 'Acción' - by: Moderado por - type: Tipo - filter: Mostrar + title: "Actividad de los Moderadores" + action: "Acción" + by: "Moderado por" + type: "Tipo" + filter: "Mostrar" filters: - all: Todo - on_proposals: Propuestas - on_debates: Debates - on_comments: Comentarios - on_users: Usuarios + all: "Todo" + on_proposals: "Propuestas" + on_debates: "Debates" + on_comments: "Comentarios" + on_users: "Usuarios" actions: - hide: Ocultado - restore: Restaurado - block: Bloqueado + hide: "Ocultado" + restore: "Restaurado" + block: "Bloqueado" stats: show: - stats_title: Estadísticas - visits_title: Visitas - combined_title: Combinado + stats_title: "Estadísticas" + visits_title: "Visitas" + combined_title: "Combinado" summary: - visits: Visitas - debates: Debates - proposals: Propuestas - comments: Comentarios - debate_votes: Votos en debates - proposal_votes: Votos en propuestas - comment_votes: Votos en comentarios - votes: Votos - user_level_three: Usuarios de nivel tres - user_level_two: Usuarios de nivel dos - unverified_users: Usuarios sin verificar - verified_users: Usuarios verificados - users: Usuarios + visits: "Visitas" + debates: "Debates" + proposals: "Propuestas" + comments: "Comentarios" + debate_votes: "Votos en debates" + proposal_votes: "Votos en propuestas" + comment_votes: "Votos en comentarios" + votes: "Votos" + user_level_three: "Usuarios de nivel tres" + user_level_two: "Usuarios de nivel dos" + unverified_users: "Usuarios sin verificar" + verified_users: "Usuarios verificados" + users: "Usuarios" diff --git a/config/locales/devise.en.yml b/config/locales/devise.en.yml old mode 100644 new mode 100755 index 26a10f292..473181f02 --- a/config/locales/devise.en.yml +++ b/config/locales/devise.en.yml @@ -3,58 +3,62 @@ en: devise: confirmations: - confirmed: "Your email address has been successfully confirmed." - send_instructions: "You will receive an email with instructions for how to confirm your email address in a few minutes." - send_paranoid_instructions: "If your email address exists in our database, you will receive an email with instructions for how to confirm your email address in a few minutes." + confirmed: "Your account has been confirmed." + send_instructions: "In a few minutes you will receive an email containing instructions on how to reset your password." + send_paranoid_instructions: "If your email address is in our database, in a few minutes you will receive an email containing instructions on how to reset your password." failure: already_authenticated: "You are already signed in." - inactive: "Your account is not activated yet." + inactive: "Your account has not yet been activated." invalid: "Invalid %{authentication_keys} or password." - locked: "Your account is locked." - last_attempt: "You have one more attempt before your account is locked." + locked: "Your account has been locked." + last_attempt: "You have one more attempt remaining before your account is blocked." not_found_in_database: "Invalid %{authentication_keys} or password." - timeout: "Your session expired. Please sign in again to continue." - unauthenticated: "You need to sign in or sign up before continuing." - unconfirmed: "You have to confirm your email address before continuing." + timeout: "Your session has expired. Please sign in again to continue." + unauthenticated: "You must sign in or register to continue." + unconfirmed: "You must confirm your account to continue." mailer: confirmation_instructions: subject: "Confirmation instructions" reset_password_instructions: - subject: "Reset password instructions" + subject: "Instructions for resetting your password" unlock_instructions: - subject: "Unlock instructions" + subject: "Unlocking instructions" omniauth_callbacks: - failure: "Could not authenticate you from %{kind} because \"%{reason}\"." - success: "Successfully authenticated from %{kind} account." + failure: "It has not been possible to authorise you as %{kind} because \"%{reason}\"." + success: "Successfully identified as %{kind}." passwords: - no_token: "You can't access this page without coming from a password reset email. If you do come from a password reset email, please make sure you used the full URL provided." - send_instructions: "You will receive an email with instructions on how to reset your password in a few minutes." - send_paranoid_instructions: "If your email address exists in our database, you will receive a password recovery link at your email address in a few minutes." - updated: "Your password has been changed successfully. You are now signed in." + no_token: "You cannot access this page except through a password reset link. If you have accessed it through a password reset link, please check that the URL is complete." + 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." registrations: - destroyed: "Bye! Your account has been successfully cancelled. We hope to see you again soon." - signed_up: "Welcome! You have signed up successfully." - signed_up_but_inactive: "You have signed up successfully. However, we could not sign you in because your account is not yet activated." - signed_up_but_locked: "You have signed up successfully. However, we could not sign you in because your account is locked." - signed_up_but_unconfirmed: "A message with a confirmation link has been sent to your email address. Please follow the link to activate your account." - update_needs_confirmation: "You updated your account successfully, but we need to verify your new email address. Please check your email and follow the confirm link to confirm your new email address." + destroyed: + "Goodbye! Your account has been cancelled. We hope to see you again soon. In accordance with your request, personal data registered as + a user of the site decide.madrid.es and form part of the file 'Gestión de procesos participativos' under the responsibility of the + Dirección General de Participación Ciudadana, they have been canceled under the terms of the provisions of Article 16 of the + Ley Orgánica 15/1999 de Protección de Datos de Carácter Personal and Article 31 of its Reglamento de desarrollo (RD 1720/2007)." + signed_up: "Welcome! You have been authenticated." + signed_up_but_inactive: "Your registration was successful, but you could not be signed in because your account has not been activated." + signed_up_but_locked: "Your registration was successful, but you could not be signed in because your account is locked." + signed_up_but_unconfirmed: "You have been sent a message containing a verification link. Please click on this link to activate your account." + update_needs_confirmation: "Your account has been updated successfully; however, we need to verify your new email address. Please check your email and click on the link to complete the confirmation of your new email address." updated: "Your account has been updated successfully." sessions: - signed_in: "Signed in successfully." - signed_out: "Signed out successfully." - already_signed_out: "Signed out successfully." + signed_in: "You have been signed in successfully." + signed_out: "You have been signed out successfully." + already_signed_out: "You have been signed out successfully." unlocks: - send_instructions: "You will receive an email with instructions for how to unlock your account in a few minutes." - send_paranoid_instructions: "If your account exists, you will receive an email with instructions for how to unlock it in a few minutes." - unlocked: "Your account has been unlocked successfully. Please sign in to continue." + send_instructions: "In a few minutes, you will receive an email containing instructions on unlocking your account." + send_paranoid_instructions: "If you have an account, in a few minutes you will receive an email containing instructions on unlocking your account." + unlocked: "Your account has been unlocked. Please sign in to continue." errors: messages: - already_confirmed: "was already confirmed, please try signing in" - confirmation_period_expired: "needs to be confirmed within %{period}, please request a new one" - expired: "has expired, please request a new one" - not_found: "not found" - not_locked: "was not locked" + already_confirmed: "You have already been verified; please attempt to sign in." + confirmation_period_expired: "You need to be verified within %{period}; please make a repeat request." + expired: "has expired; please make a repeat request." + not_found: "not found." + not_locked: "was not locked." not_saved: - one: "1 error prohibited this %{resource} from being saved:" - other: "%{count} errors prohibited this %{resource} from being saved:" + one: "1 error prevented this %{resource} from being saved:" + other: "%{count} errors prevented this %{resource} from being saved:" diff --git a/config/locales/devise.es.yml b/config/locales/devise.es.yml index c2bc246e9..bf81e4199 100644 --- a/config/locales/devise.es.yml +++ b/config/locales/devise.es.yml @@ -31,7 +31,11 @@ es: updated: "Tu contraseña ha cambiado correctamente. Has sido identificado correctamente." updated_not_active: "Tu contraseña se ha cambiado correctamente." registrations: - destroyed: "¡Adiós! Tu cuenta ha sido cancelada. Esperamos volver a verte pronto." + destroyed: + "¡Adiós! Tu cuenta ha sido cancelada. Esperamos volver a verte pronto. Le informamos que de conformidad con su petición, + sus datos personales registrados como usuario de la Web decide.madrid.es y que forman parte del fichero 'Gestión de procesos participativos' + cuyo responsable es la Dirección General de Participación Ciudadana, han sido cancelados en los términos de lo previsto en el artículo 16 de la + Ley Orgánica 15/1999 de Protección de Datos de Carácter Personal y del artículo 31 de su Reglamento de desarrollo (RD 1720/2007)." signed_up: "¡Bienvenido! Has sido identificado." signed_up_but_inactive: "Te has registrado correctamente, pero no has podido iniciar sesión porque tu cuenta no ha sido activada." signed_up_but_locked: "Te has registrado correctamente, pero no has podido iniciar sesión porque tu cuenta está bloqueada." diff --git a/config/locales/devise_views.en.yml b/config/locales/devise_views.en.yml old mode 100644 new mode 100755 index 2c7ef86bb..508cfd820 --- a/config/locales/devise_views.en.yml +++ b/config/locales/devise_views.en.yml @@ -2,9 +2,9 @@ en: devise_views: confirmations: new: - title: "Resend confirmation instructions" - email_label: Email - submit: "Resend confirmation" + title: "Re-send confirmation instructions" + email_label: "Email" + submit: "Re-send instructions" show: title: "Confirm my account" instructions_html: "Confirming the account with email %{email}" @@ -14,28 +14,28 @@ en: submit: "Confirm" mailer: confirmation_instructions: - title: "Welcome to open government portal" + title: "Welcome to the Open Government Portal of the Madrid City Council" welcome: "Welcome" - text: "You can confirm your account email through the link below:" + text: "You can confirm your email account at the following link:" confirm_link: "Confirm my account" reset_password_instructions: hello: "Hello" - title: Change your password - text: "Someone has requested to change your password. You can do this through the link below:" + title: "Change your password" + text: "We have received a request to change your password. You can do this at the following link:" change_link: "Change my password" - ignore_text: "If you didn't request this, please ignore this email." - info_text: "Your password won't change until you access the link above and create a new one." + ignore_text: "If you did not request a password change, you can ignore this email." + info_text: "Your password will not be changed unless you access the link and edit it." unlock_instructions: hello: "Hello" - title: Your account has been locked - info_text: "Your account has been locked due to an excessive number of unsuccessful sign in attempts." - instructions_text: "Click the link below to unlock your account:" + title: "Your account has been locked" + info_text: "Your account has been blocked due to an excessive number of failed sign-in attempts." + instructions_text: "Please click on this link to unlock your account:" unlock_link: "Unlock my account" menu: login_items: - logout: "Logout" - signup: "Sign up" - login: "Log in" + logout: "Sign out" + signup: "Register" + login: "Sign in" passwords: edit: title: "Change your password" @@ -43,40 +43,40 @@ en: password_confirmation_label: "Confirm new password" change_submit: "Change my password" new: - title: "Forgot your password?" + title: "Forgotten password?" email_label: "Email" - send_submit: "Send me reset password" + send_submit: "Send instructions" users: registrations: edit: edit: "Edit" email_label: "Email" - waiting_for: "Currently waiting confirmation for:" - leave_blank: "Leave blank if you don't want to change it" + waiting_for: "Awaiting confirmation of:" + leave_blank: "Leave blank if you do not wish to modify" password_label: "New password" password_confirmation_label: "Confirm new password" current_password_label: "Current password" - need_current: "We need your current password to confirm your changes" + need_current: "We need your current password to confirm the changes" update_submit: "Update" back_link: "Back" new: - title: "Sign up" + title: "Register" username_label: "Username" - username_note: "Username which will appear in your publications" + username_note: "Name that appears next to your posts" email_label: "Email" password_label: "Password" password_confirmation_label: "Confirm password" - submit: "Sign up" - organization_signup: "Do you represent an organization / group? %{signup_link}" + submit: "Register" + organization_signup: "Do you represent an organisation or collective? %{signup_link}" organization_signup_link: "Sign up here" - terms: "To sign up in this site your accept the %{terms}" - terms_link: "terms of use" + terms: "By registering you accept the %{terms}" + terms_link: "terms and conditions of use" success: - title: "Review your email inbox" - thank_you_html: "Thank you for registering. Now you must confirm your email account." - instructions_1_html: "Please review your email inbox - we have sent you a link to confirm your account." - instructions_2_html: "Once you click that link, you will be able to start participating" - back_to_index: "Understood, take me back to the home page" + title: "Modify your email" + thank_you_html: "Thank you for registering for the website. You must now confirm your email address." + instructions_1_html: "Please check your email - we have sent you a link to confirm your account." + instructions_2_html: "Once confirmed, you may begin participation." + back_to_index: "I understand; go back to main page" delete_form: title: "Erase account" info: "This action can not be undone. Please make sure this is what you want." @@ -86,41 +86,40 @@ en: organizations: registrations: new: - title: "Sign up as organization / collective" - organization_name_label: "Organization name" - responsible_name_label: "Name and surname of the person in charge" - responsible_name_note: "The responsible representative of the organization" + title: "Register as an organisation or collective" + organization_name_label: "Name of organisation" + responsible_name_label: "Full name of the person responsible for the collective" + responsible_name_note: "This would be the person representing the association/collective in whose name the proposals are presented" email_label: "Email" password_label: "Password" phone_number_label: "Phone number" password_confirmation_label: "Confirm password" - submit: "Sign up" + submit: "Register" success: - title: "Registration of organization / collective" - thank_you_html: "Thank you for registering your organization or collective in the website. Now is pending verification." - instructions_1_html: "We will contact you soon in order to verify that you represent your collective." - instructions_2_html: "Meanwhile, review your email. We have sent you a confirmation link to activate your account." - instructions_3_html: "When you confirm your account will then be able to participate as a non-verified organization." - back_to_index: "Understood, take me back to the home page" + title: "Registration of organisation / collective" + thank_you_html: "Thank you for registering your collective on the website. It is now pending verification." + instructions_1_html: "We will contact you soon to verify that you do in fact represent this collective." + instructions_2_html: "While your email is reviewed, we have sent you a link to confirm your account." + instructions_3_html: "Once confirmed, you may begin to participate as an unverified collective." + back_to_index: "I understand; go back to main page" sessions: new: - title: "Log in" + title: "Sign in" email_label: "Email" password_label: "Password" remember_me: "Remember me" - submit: "Log in" + submit: "Enter" unlocks: new: - title: "Resend unlock instructions" + title: "Re-sent unlocking instructions" email_label: "Email" - submit: "Resend unlock instructions" + submit: "Re-send unlocking instructions" shared: links: - login: "Log in" + login: "Enter" signup: "Don't have an account? %{signup_link}" signup_link: "Sign up" - #organization_signup: "Sign up as an organization / collective" signin_with_provider: "Sign in with %{provider}" - new_password: "Forgot your password?" - new_confirmation: "Didn't receive confirmation instructions?" - new_unlock: "Didn't receive unlock instructions?" + new_password: "Forgotten your password?" + new_confirmation: "Haven't received instructions to activate your account?" + new_unlock: "Haven't received unlocking instructions?" diff --git a/config/locales/devise_views.es.yml b/config/locales/devise_views.es.yml index 42576b6ff..83aea1d48 100644 --- a/config/locales/devise_views.es.yml +++ b/config/locales/devise_views.es.yml @@ -3,7 +3,7 @@ es: confirmations: new: title: "Reenviar instrucciones de confirmación" - email_label: Email + email_label: "Email" submit: "Reenviar instrucciones" show: title: "Confirmar mi cuenta" @@ -27,7 +27,7 @@ es: info_text: "Tu contraseña no cambiará hasta que no accedas al enlace y la modifiques." unlock_instructions: hello: "Hola" - title: Tu cuenta ha sido bloqueada + title: "Tu cuenta ha sido bloqueada" info_text: "Tu cuenta ha sido bloqueada debido a un excesivo número de intentos fallidos de alta." instructions_text: "Sigue el siguiente enlace para desbloquear tu cuenta:" unlock_link: "Desbloquear mi cuenta" @@ -119,7 +119,6 @@ es: login: "Entrar" signup: "¿No tienes una cuenta? %{signup_link}" signup_link: "Regístrate" - #organization_signup: "Registro para organizaciones / colectivos" signin_with_provider: "Entrar con %{provider}" new_password: "¿Olvidaste tu contraseña?" new_confirmation: "¿No has recibido instrucciones para confirmar tu cuenta?" diff --git a/config/locales/en.yml b/config/locales/en.yml old mode 100644 new mode 100755 index 21b4a6872..715b12d33 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -1,58 +1,58 @@ en: - locale: English + locale: "English" errors: messages: user_not_found: "User not found" layouts: header: logo: "Madrid" - external_link_transparency: Transparency + external_link_transparency: "Transparency" external_link_transparency_url: "http://www.madrid.es/portales/munimadrid/es/Inicio/El-Ayuntamiento/Transparencia?vgnextfmt=default&vgnextchannel=20fd850769797310VgnVCM2000000c205a0aRCRD" - external_link_opendata: Open data + external_link_opendata: "Open data" external_link_opendata_url: "http://datos.madrid.es" - external_link_blog: Blog + external_link_blog: "Blog" external_link_blog_url: "/blog" open_gov: "%{open} government" - open: "Open" + open: "open" participation: "Participation" transparency: "Transparency" open_data: "Open data" - open_city_title: "The city you want, it will be the city you want." + open_city_title: "Love the city, and it will become a city you love." open_city_slogan_html: - "Start listening to Madrid. - For that we open this digital Puerta del Sol, where all the locals can meet to discuss and share everything we want." + "There are cities that are governed directly by their inhabitants, who discuss the topics they are concerned about, propose ideas to improve + their lives and decide among themselves which ones will be carried out. Madrid is already one of these cities." see_all: "See proposals" - my_account_link: My account + my_account_link: "My account" locale: "Language:" - administration: Administration - moderation: Moderation - highlights: "Highlights" + administration: "Administration" + moderation: "Moderation" + # highlights: "Highlights" more_information: "More information" - debates: Debates - proposals: Proposals + debates: "Debates" + proposals: "Citizen proposals" footer: - description: "This portal use %{consul}, is %{open_source}. Madrid, for the whole world." - open_source: "software libre" + description: "This portal uses the %{consul} which is %{open_source}. From Madrid out into the world." + open_source: "open-source software" open_source_url: "http://www.gnu.org/licenses/agpl-3.0.html" consul: "Consul application" consul_url: "https://github.com/ayuntamientomadrid" copyright: "Ayuntamiento de Madrid, %{year}" participation_title: "Participation" - participation_text: Decide what should be the city of Madrid you want. - transparency_title: Transparency - transparency_text: Get any information on the City of Madrid. - open_data_title: Open Data - open_data_text: "All City Council data are yours." - contact_us: "For technical support contact us" + participation_text: "Decide how to shape the Madrid you want to live in." + transparency_title: "Transparency" + transparency_text: "Find out anything about the Madrid City Council." + open_data_title: "Open data" + open_data_text: "Every detail about the City Council is yours to access." + contact_us: "Contact us at" privacy: "Privacy Policy" - conditions: "Terms of use" + conditions: "Terms and conditions of use" more_info: "More information" accessibility: "Accessibility" application: - ie_title: "This site is not optimized for your browser" + ie_title: "This website is not optimised for your browser" ie: - "You are using Internet Explorer. - For a better experience we recommend use %{chrome} or %{firefox}." + "We have detected that you are browsing with Internet Explorer. + For an enhanced experience, we recommend using %{chrome} or %{firefox}." chrome: "Google Chrome" firefox: "Firefox" social: @@ -61,89 +61,86 @@ en: blog: "Blog" youtube: "YouTube" form: - error: error - errors: errors - not_saved: "prohibited this %{resource} from being saved:" - accept_terms: "I accept the %{policy} and the %{conditions}" - policy: "Privacy policy" - conditions: "Terms of use" - user: account - debate: debate - proposal: proposal - verification::sms: phone - verification::letter: verification + error: "error" + errors: "errors" + not_saved: "prevented this %{resource} from being saved:" + accept_terms: "I agree to the %{policy} and the %{conditions}" + policy: "Privacy Policy" + conditions: "Terms and conditions of use" + user: "Account" + debate: "Debate" + proposal: "Proposal" + verification::sms: "Telephone" + verification::letter: "the verification" application: - alert: - only_beta_testers: "Sorry only Beta Testers are allowed access at the moment" close: "Close" menu: "Menu" debates: index: - title: Debates - start_debate: Start a debate - select_order: Order by - select_order_long: Order debates by + title: "Debates" + start_debate: "Start a debate" + select_order: "Order by" + select_order_long: "You are viewing debates according to:" orders: - confidence_score: best rated - hot_score: most active - created_at: newest - most_commented: most commented - random: random + confidence_score: "highest rated" + hot_score: "most active" + created_at: "newest" + most_commented: "most commented" + random: "random" filter_topic: - one: " with the topic '%{topic}'" - other: " with the topic '%{topic}'" + one: " with topic '%{topic}'" + other: " with topic '%{topic}'" search_form: - title: Search - button: Search + title: "Search" + button: "Search" placeholder: "Search debates..." search_results: - one: " containing '%{search_term}'" - other: " containing '%{search_term}'" + one: " containing the term '%{search_term}'" + other: " containing the term '%{search_term}'" debate: - debate: Debate + debate: "Debate" comments: - zero: No comments - one: 1 Comment - other: "%{count} Comments" + zero: "No comments" + one: "1 comment" + other: "%{count} comments" votes: - zero: No votes - one: 1 vote + zero: "No votes" + one: "1 vote" other: "%{count} votes" form: - debate_title: Debate title - debate_text: Initial text for debate - tags_label: Topics - tags_instructions: > - Tag this debate. You can choose among our proposals on the list or add any other topic you want. - tags_placeholder: "Add topics writing them separated by ','" + debate_title: "Debate title" + debate_text: "Initial debate text" + tags_label: "Topics" + tags_instructions: "Tag this debate. You can choose from our suggestions or enter your own." + tags_placeholder: "Enter the tags you would like to use, separated by commas (',')" show: - back_link: Back - author_deleted: Deleted user - comments_title: Comments + back_link: "Go back" + author_deleted: "User deleted" + comments_title: "Comments" comments: - zero: No comments - one: 1 Comment - other: "%{count} Comments" - login_to_comment: "You need to %{signin} or %{signup} to comment." - edit_debate_link: "Edit debate" - share: Share - flag: "This debate has been flag as innapropiate for some users." + zero: "No comments" + one: "1 comment" + other: "%{count} comments" + login_to_comment: "You must %{signin} or %{signup} to leave a comment." + edit_debate_link: "Edit" + share: "Share" + flag: "This debate has been flagged as inappropriate by several users." edit: - editing: Edit debate - show_link: Show debate - back_link: Back + editing: "Edit debate" + show_link: "View debate" + back_link: "Go back" form: submit_button: "Save changes" new: - start_new: Start a debate - info: "A debate is a discussion forum, not a proposal. And soon... we opened the section of citizen proposals." - more_info: "More info" - back_link: Back - recommendations_title: Tips for creating a debate - recommendation_one: "Do not write the title of the debate or whole sentences in capital. On the Internet this is considered shouting. And nobody likes to scream." - recommendation_two: "Any discussion or comment that involves an illegal act will be eliminated, also intending to sabotage the debate spaces, everything else is permitted." - recommendation_three: "The harsh criticism are very welcome. This is a space of thought but we recommend preserving the elegance and intelligence. The world is better with them present." - recommendation_four: "Enjoy this space, voices that fill it, it is yours too." + start_new: "Start a debate" + info: "A debate is a discussion forum, not a citizen proposal. Very soon we will be opening the citizen proposal section, where anyone will be able to present a proposal which, if they receive support, will be implemented by the City Council." + more_info: "More information" + back_link: "Go back" + recommendations_title: "Recommendations for creating a debate" + recommendation_one: "Do not use capital letters for the debate title or for whole sentences. On the internet, this is considered shouting. And nobody likes being shouted at." + recommendation_two: "Any debate or comment suggesting illegal action will be deleted, as well as those intending to sabotage the debate spaces. Anything else is allowed." + recommendation_three: "Ruthless criticism is very welcome. This is a space for reflection. But we recommend that you stick to elegance and intelligence. The world is a better place with these virtues in it." + recommendation_four: "Enjoy this space and the voices that fill it. It belongs to you too." form: submit_button: "Start a debate" create: @@ -154,91 +151,90 @@ en: submit_button: "Save changes" proposals: index: - title: Proposals + title: "Proposals" featured_proposals_html: "FeaturedThis 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"]') @@ -504,10 +504,12 @@ feature 'Debates' do within("#debates") do expect(page).to have_css('.debate', count: 4) + expect(page).to have_content(debate2.title) expect(page).to have_content(debate4.title) expect(page).to have_content(debate5.title) expect(page).to have_content(debate6.title) + expect(page).to_not have_content(debate1.title) expect(page).to_not have_content(debate3.title) end @@ -518,10 +520,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 @@ -530,9 +532,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 3058de44c..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 @@ -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..e33c1a179 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 @@ -139,7 +139,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!" expect(current_path).to eq(management_proposal_path(proposal)) 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..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 "Ignore flags" + 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 "Ignore flags" + click_on "Mark 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..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 "Ignore flags" + 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 "Ignore flags" + click_on "Mark 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..e41a69bb2 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('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_not have_link('Ignored') + expect(page).to have_link('Pending review') + 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..711820574 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"]') @@ -559,7 +559,7 @@ feature 'Proposals' do end end - scenario 'proposal index search' do + scenario 'Proposal index search' do proposal1 = create(:proposal, title: "Show me what you got") proposal2 = create(:proposal, title: "Get Schwifty") proposal3 = create(:proposal) @@ -574,23 +574,47 @@ feature 'Proposals' do within("#proposals") do expect(page).to have_css('.proposal', count: 3) + expect(page).to have_content(proposal2.title) expect(page).to have_content(proposal4.title) expect(page).to have_content(proposal5.title) + expect(page).to_not have_content(proposal1.title) expect(page).to_not have_content(proposal3.title) end end + scenario 'Index search does not show featured proposals' do + featured_proposals = create_featured_proposals + proposal = create(:proposal, title: "Abcdefghi") + + visit proposals_path + fill_in "search", with: proposal.title + click_button "Search" + + expect(page).to_not have_selector('#proposals .proposal-featured') + expect(page).to_not have_selector('#featured-proposals') + end + + scenario 'Tag index tag does not show featured proposals' do + featured_proposals = create_featured_proposals + proposal = create(:proposal, tag_list: "123") + + visit proposals_path(tag: "123") + + expect(page).to_not have_selector('#proposals .proposal-featured') + expect(page).to_not have_selector('#featured-proposals') + end + scenario 'Conflictive' do good_proposal = create(:proposal) 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 @@ -634,14 +658,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/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..b23d956ac 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,22 +163,22 @@ 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." + 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/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..50635a73c 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 @@ -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 @@ -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 @@ -81,7 +81,7 @@ feature 'Verify Letter' do fill_in "verification_letter_verification_code", with: "12345" click_button "Verify my account" - expect(page).to have_content "Your account has been verified" + expect(page).to have_content "Account 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 b03741f42..9a1cfaa6e 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,16 +75,16 @@ 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." + 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/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..447438472 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' @@ -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 @@ -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..776cfabb4 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 @@ -269,7 +267,7 @@ feature 'Votes' do within("#proposal_#{@proposal.id}") do find('.in-favor a').click - 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/debate_spec.rb b/spec/models/debate_spec.rb index 159ebdbb1..dba82ea6b 100644 --- a/spec/models/debate_spec.rb +++ b/spec/models/debate_spec.rb @@ -318,35 +318,6 @@ describe Debate do end - describe "self.search" do - it "find debates by title" do - debate1 = create(:debate, title: "Karpov vs Kasparov") - create(:debate, title: "Bird vs Magic") - search = Debate.search("Kasparov") - expect(search.size).to eq(1) - expect(search.first).to eq(debate1) - end - - it "find debates by description" do - debate1 = create(:debate, description: "...chess masters...") - create(:debate, description: "...basket masters...") - search = Debate.search("chess") - expect(search.size).to eq(1) - expect(search.first).to eq(debate1) - end - - it "find debates by title and description" do - create(:debate, title: "Karpov vs Kasparov", description: "...played like Gauss...") - create(:debate, title: "Euler vs Gauss", description: "...math masters...") - search = Debate.search("Gauss") - expect(search.size).to eq(2) - end - - it "returns no results if no search term provided" do - expect(Debate.search(" ").size).to eq(0) - end - end - describe "cache" do let(:debate) { create(:debate) } @@ -457,4 +428,169 @@ describe Debate do end + describe "search" do + + context "attributes" do + + xit "searches by title" do + debate = create(:debate, title: 'save the world') + results = Debate.search('save the world') + expect(results).to eq([debate]) + end + + xit "searches by description" do + debate = create(:debate, description: 'in order to save the world one must think about...') + results = Debate.search('one must think') + expect(results).to eq([debate]) + end + + end + + context "stemming" do + + xit "searches word stems" do + debate = create(:debate, title: 'limpiar') + + results = Debate.search('limpiará') + expect(results).to eq([debate]) + + results = Debate.search('limpiémos') + expect(results).to eq([debate]) + + results = Debate.search('limpió') + expect(results).to eq([debate]) + end + + end + + context "accents" do + + xit "searches with accents" do + debate = create(:debate, title: 'difusión') + + results = Debate.search('difusion') + expect(results).to eq([debate]) + + debate2 = create(:debate, title: 'estadisticas') + results = Debate.search('estadísticas') + expect(results).to eq([debate2]) + end + + end + + context "case" do + + xit "searches case insensite" do + debate = create(:debate, title: 'SHOUT') + + results = Debate.search('shout') + expect(results).to eq([debate]) + + debate2 = create(:debate, title: "scream") + results = Debate.search("SCREAM") + expect(results).to eq([debate2]) + end + + end + + context "typos" do + + xit "searches with typos" do + debate = create(:debate, title: 'difusión') + + results = Debate.search('difuon') + expect(results).to eq([debate]) + + debate2 = create(:debate, title: 'desarrollo') + results = Debate.search('desarolo') + expect(results).to eq([debate2]) + end + + end + + context "order" do + + xit "orders by weight" do + debate_description = create(:debate, description: 'stop corruption') + debate_title = create(:debate, title: 'stop corruption') + + results = Debate.search('stop corruption') + + expect(results.first).to eq(debate_title) + expect(results.second).to eq(debate_description) + end + + xit "orders by weight and then votes" do + title_some_votes = create(:debate, title: 'stop corruption', cached_votes_up: 5) + title_least_voted = create(:debate, title: 'stop corruption', cached_votes_up: 2) + title_most_voted = create(:debate, title: 'stop corruption', cached_votes_up: 10) + description_most_voted = create(:debate, description: 'stop corruption', cached_votes_up: 10) + + results = Debate.search('stop corruption') + + expect(results.first).to eq(title_most_voted) + expect(results.second).to eq(description_most_voted) + expect(results.third).to eq(title_some_votes) + expect(results.fourth).to eq(title_least_voted) + end + + xit "orders by weight and then votes and then created_at" do + newest = create(:debate, title: 'stop corruption', cached_votes_up: 5, created_at: Time.now) + oldest = create(:debate, title: 'stop corruption', cached_votes_up: 5, created_at: 1.month.ago) + old = create(:debate, title: 'stop corruption', cached_votes_up: 5, created_at: 1.week.ago) + + results = Debate.search('stop corruption') + + expect(results.first).to eq(newest) + expect(results.second).to eq(old) + expect(results.third).to eq(oldest) + end + + end + + context "tags" do + + xit "searches by tags" do + debate = create(:debate, tag_list: 'Latina') + + results = Debate.search('Latina') + expect(results.first).to eq(debate) + end + + end + + context "no results" do + + xit "no words match" do + debate = create(:debate, title: 'save world') + + results = Debate.search('destroy planet') + expect(results).to eq([]) + end + + xit "too many typos" do + debate = create(:debate, title: 'fantastic') + + results = Debate.search('frantac') + expect(results).to eq([]) + end + + xit "too much stemming" do + debate = create(:debate, title: 'reloj') + + results = Debate.search('superrelojimetro') + expect(results).to eq([]) + end + + xit "empty" do + debate = create(:debate, title: 'great') + + results = Debate.search('') + expect(results).to eq([]) + end + + end + + end + end 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 diff --git a/spec/models/proposal_spec.rb b/spec/models/proposal_spec.rb index bb13f0769..8193bf701 100644 --- a/spec/models/proposal_spec.rb +++ b/spec/models/proposal_spec.rb @@ -355,4 +355,185 @@ describe Proposal do end end + describe "search" do + + context "attributes" do + + it "searches by title" do + proposal = create(:proposal, title: 'save the world') + results = Proposal.search('save the world') + expect(results).to eq([proposal]) + end + + it "searches by summary" do + proposal = create(:proposal, summary: 'basically...') + results = Proposal.search('basically') + expect(results).to eq([proposal]) + end + + it "searches by description" do + proposal = create(:proposal, description: 'in order to save the world one must think about...') + results = Proposal.search('one must think') + expect(results).to eq([proposal]) + end + + it "searches by question" do + proposal = create(:proposal, question: 'to be or not to be') + results = Proposal.search('to be or not to be') + expect(results).to eq([proposal]) + end + + end + + context "stemming" do + + it "searches word stems" do + proposal = create(:proposal, summary: 'limpiar') + + results = Proposal.search('limpiará') + expect(results).to eq([proposal]) + + results = Proposal.search('limpiémos') + expect(results).to eq([proposal]) + + results = Proposal.search('limpió') + expect(results).to eq([proposal]) + end + + end + + context "accents" do + + it "searches with accents" do + proposal = create(:proposal, summary: 'difusión') + + results = Proposal.search('difusion') + expect(results).to eq([proposal]) + + proposal2 = create(:proposal, summary: 'estadisticas') + results = Proposal.search('estadísticas') + expect(results).to eq([proposal2]) + end + + end + + context "case" do + + it "searches case insensite" do + proposal = create(:proposal, title: 'SHOUT') + + results = Proposal.search('shout') + expect(results).to eq([proposal]) + + proposal2 = create(:proposal, title: "scream") + results = Proposal.search("SCREAM") + expect(results).to eq([proposal2]) + end + + end + + context "typos" do + + it "searches with typos" do + proposal = create(:proposal, summary: 'difusión') + + results = Proposal.search('difuon') + expect(results).to eq([proposal]) + + proposal2 = create(:proposal, summary: 'desarrollo') + results = Proposal.search('desarolo') + expect(results).to eq([proposal2]) + end + + end + + context "order" do + + it "orders by weight" do + proposal_question = create(:proposal, question: 'stop corruption') + proposal_title = create(:proposal, title: 'stop corruption') + proposal_description = create(:proposal, description: 'stop corruption') + proposal_summary = create(:proposal, summary: 'stop corruption') + + results = Proposal.search('stop corruption') + + expect(results.first).to eq(proposal_title) + expect(results.second).to eq(proposal_question) + expect(results.third).to eq(proposal_summary) + expect(results.fourth).to eq(proposal_description) + end + + it "orders by weight and then votes" do + title_some_votes = create(:proposal, title: 'stop corruption', cached_votes_up: 5) + title_least_voted = create(:proposal, title: 'stop corruption', cached_votes_up: 2) + title_most_voted = create(:proposal, title: 'stop corruption', cached_votes_up: 10) + summary_most_voted = create(:proposal, summary: 'stop corruption', cached_votes_up: 10) + + results = Proposal.search('stop corruption') + + expect(results.first).to eq(title_most_voted) + expect(results.second).to eq(summary_most_voted) + expect(results.third).to eq(title_some_votes) + expect(results.fourth).to eq(title_least_voted) + end + + it "orders by weight and then votes and then created_at" do + newest = create(:proposal, title: 'stop corruption', cached_votes_up: 5, created_at: Time.now) + oldest = create(:proposal, title: 'stop corruption', cached_votes_up: 5, created_at: 1.month.ago) + old = create(:proposal, title: 'stop corruption', cached_votes_up: 5, created_at: 1.week.ago) + + results = Proposal.search('stop corruption') + + expect(results.first).to eq(newest) + expect(results.second).to eq(old) + expect(results.third).to eq(oldest) + end + + end + + context "tags" do + + it "searches by tags" do + proposal = create(:proposal, tag_list: 'Latina') + + results = Proposal.search('Latina') + expect(results.first).to eq(proposal) + end + + end + + context "no results" do + + it "no words match" do + proposal = create(:proposal, title: 'save world') + + results = Proposal.search('destroy planet') + expect(results).to eq([]) + end + + it "too many typos" do + proposal = create(:proposal, title: 'fantastic') + + results = Proposal.search('frantac') + expect(results).to eq([]) + end + + it "too much stemming" do + proposal = create(:proposal, title: 'reloj') + + results = Proposal.search('superrelojimetro') + expect(results).to eq([]) + end + + it "empty" do + proposal = create(:proposal, title: 'great') + + results = Proposal.search('') + expect(results).to eq([]) + end + + end + + end + 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