From 58069b35a3642ca98990fa617363f6f04362cd70 Mon Sep 17 00:00:00 2001 From: Bertocq Date: Mon, 2 Oct 2017 16:24:53 +0200 Subject: [PATCH 01/48] Remove Poll White/Null/Total Results models, tables, specs and references --- .rubocop_todo.yml | 6 - app/models/poll/null_result.rb | 23 - app/models/poll/total_result.rb | 23 - app/models/poll/white_result.rb | 23 - ...47_remove_poll_white_null_total_results.rb | 16 + db/schema.rb | 51 +- knapsack_rspec_report.json | 449 +++++++++--------- spec/factories.rb | 15 - spec/models/poll/null_result_spec.rb | 70 --- spec/models/poll/total_result_spec.rb | 70 --- spec/models/poll/white_result_spec.rb | 70 --- 11 files changed, 242 insertions(+), 574 deletions(-) delete mode 100644 app/models/poll/null_result.rb delete mode 100644 app/models/poll/total_result.rb delete mode 100644 app/models/poll/white_result.rb create mode 100644 db/migrate/20171002133547_remove_poll_white_null_total_results.rb delete mode 100644 spec/models/poll/null_result_spec.rb delete mode 100644 spec/models/poll/total_result_spec.rb delete mode 100644 spec/models/poll/white_result_spec.rb diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index f8d4bb811..072caad09 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -283,10 +283,7 @@ Lint/ParenthesesAsGroupedExpression: # Cop supports --auto-correct. Lint/StringConversionInInterpolation: Exclude: - - 'app/models/poll/null_result.rb' - 'app/models/poll/partial_result.rb' - - 'app/models/poll/white_result.rb' - - 'app/models/poll/total_result.rb' # Offense count: 15 # Cop supports --auto-correct. @@ -533,10 +530,7 @@ Style/MutableConstant: - 'app/models/activity.rb' - 'app/models/budget/reclassified_vote.rb' - 'app/models/legislation/draft_version.rb' - - 'app/models/poll/null_result.rb' - 'app/models/poll/partial_result.rb' - - 'app/models/poll/white_result.rb' - - 'app/models/poll/total_result.rb' - 'app/models/proposal.rb' - 'app/models/signature_sheet.rb' - 'app/models/site_customization/content_block.rb' diff --git a/app/models/poll/null_result.rb b/app/models/poll/null_result.rb deleted file mode 100644 index d10fe3cb0..000000000 --- a/app/models/poll/null_result.rb +++ /dev/null @@ -1,23 +0,0 @@ -class Poll::NullResult < ActiveRecord::Base - - VALID_ORIGINS = %w{web booth} - - belongs_to :author, -> { with_hidden }, class_name: 'User', foreign_key: 'author_id' - belongs_to :booth_assignment - belongs_to :officer_assignment - - validates :author, presence: true - validates :origin, inclusion: {in: VALID_ORIGINS} - - scope :by_author, ->(author_id) { where(author_id: author_id) } - - before_save :update_logs - - def update_logs - if amount_changed? && amount_was.present? - self.amount_log += ":#{amount_was.to_s}" - self.officer_assignment_id_log += ":#{officer_assignment_id_was.to_s}" - self.author_id_log += ":#{author_id_was.to_s}" - end - end -end diff --git a/app/models/poll/total_result.rb b/app/models/poll/total_result.rb deleted file mode 100644 index 2df01929e..000000000 --- a/app/models/poll/total_result.rb +++ /dev/null @@ -1,23 +0,0 @@ -class Poll::TotalResult < ActiveRecord::Base - - VALID_ORIGINS = %w{web booth} - - belongs_to :author, -> { with_hidden }, class_name: 'User', foreign_key: 'author_id' - belongs_to :booth_assignment - belongs_to :officer_assignment - - validates :author, presence: true - validates :origin, inclusion: {in: VALID_ORIGINS} - - scope :by_author, ->(author_id) { where(author_id: author_id) } - - before_save :update_logs - - def update_logs - if amount_changed? && amount_was.present? - self.amount_log += ":#{amount_was.to_s}" - self.officer_assignment_id_log += ":#{officer_assignment_id_was.to_s}" - self.author_id_log += ":#{author_id_was.to_s}" - end - end -end diff --git a/app/models/poll/white_result.rb b/app/models/poll/white_result.rb deleted file mode 100644 index a4a4e5a4d..000000000 --- a/app/models/poll/white_result.rb +++ /dev/null @@ -1,23 +0,0 @@ -class Poll::WhiteResult < ActiveRecord::Base - - VALID_ORIGINS = %w{web booth} - - belongs_to :author, -> { with_hidden }, class_name: 'User', foreign_key: 'author_id' - belongs_to :booth_assignment - belongs_to :officer_assignment - - validates :author, presence: true - validates :origin, inclusion: {in: VALID_ORIGINS} - - scope :by_author, ->(author_id) { where(author_id: author_id) } - - before_save :update_logs - - def update_logs - if amount_changed? && amount_was.present? - self.amount_log += ":#{amount_was.to_s}" - self.officer_assignment_id_log += ":#{officer_assignment_id_was.to_s}" - self.author_id_log += ":#{author_id_was.to_s}" - end - end -end diff --git a/db/migrate/20171002133547_remove_poll_white_null_total_results.rb b/db/migrate/20171002133547_remove_poll_white_null_total_results.rb new file mode 100644 index 000000000..5fff82ef3 --- /dev/null +++ b/db/migrate/20171002133547_remove_poll_white_null_total_results.rb @@ -0,0 +1,16 @@ +class RemovePollWhiteNullTotalResults < ActiveRecord::Migration + def change + remove_index :poll_null_results, column: [:booth_assignment_id] + remove_index :poll_null_results, column: [:officer_assignment_id] + + remove_index :poll_white_results, column: [:booth_assignment_id] + remove_index :poll_white_results, column: [:officer_assignment_id] + + remove_index :poll_total_results, column: [:booth_assignment_id] + remove_index :poll_total_results, column: [:officer_assignment_id] + + drop_table :poll_null_results + drop_table :poll_total_results + drop_table :poll_white_results + end +end diff --git a/db/schema.rb b/db/schema.rb index e859a487f..b852190f0 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 20171002122312) do +ActiveRecord::Schema.define(version: 20171002133547) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" @@ -613,21 +613,6 @@ ActiveRecord::Schema.define(version: 20171002122312) do t.string "location" end - create_table "poll_null_results", force: :cascade do |t| - t.integer "author_id" - t.integer "amount" - t.string "origin" - t.date "date" - t.integer "booth_assignment_id" - t.integer "officer_assignment_id" - t.text "amount_log", default: "" - t.text "officer_assignment_id_log", default: "" - t.text "author_id_log", default: "" - end - - add_index "poll_null_results", ["booth_assignment_id"], name: "index_poll_null_results_on_booth_assignment_id", using: :btree - add_index "poll_null_results", ["officer_assignment_id"], name: "index_poll_null_results_on_officer_assignment_id", using: :btree - create_table "poll_officer_assignments", force: :cascade do |t| t.integer "booth_assignment_id" t.integer "officer_id" @@ -724,21 +709,6 @@ ActiveRecord::Schema.define(version: 20171002122312) do add_index "poll_shifts", ["booth_id"], name: "index_poll_shifts_on_booth_id", using: :btree add_index "poll_shifts", ["officer_id"], name: "index_poll_shifts_on_officer_id", using: :btree - create_table "poll_total_results", force: :cascade do |t| - t.integer "author_id" - t.integer "amount" - t.string "origin" - t.date "date" - t.integer "booth_assignment_id" - t.integer "officer_assignment_id" - t.text "amount_log", default: "" - t.text "officer_assignment_id_log", default: "" - t.text "author_id_log", default: "" - end - - add_index "poll_total_results", ["booth_assignment_id"], name: "index_poll_total_results_on_booth_assignment_id", using: :btree - add_index "poll_total_results", ["officer_assignment_id"], name: "index_poll_total_results_on_officer_assignment_id", using: :btree - create_table "poll_voters", force: :cascade do |t| t.string "document_number" t.string "document_type" @@ -761,21 +731,6 @@ ActiveRecord::Schema.define(version: 20171002122312) do add_index "poll_voters", ["poll_id"], name: "index_poll_voters_on_poll_id", using: :btree add_index "poll_voters", ["user_id"], name: "index_poll_voters_on_user_id", using: :btree - create_table "poll_white_results", force: :cascade do |t| - t.integer "author_id" - t.integer "amount" - t.string "origin" - t.date "date" - t.integer "booth_assignment_id" - t.integer "officer_assignment_id" - t.text "amount_log", default: "" - t.text "officer_assignment_id_log", default: "" - t.text "author_id_log", default: "" - end - - add_index "poll_white_results", ["booth_assignment_id"], name: "index_poll_white_results_on_booth_assignment_id", using: :btree - add_index "poll_white_results", ["officer_assignment_id"], name: "index_poll_white_results_on_officer_assignment_id", using: :btree - create_table "polls", force: :cascade do |t| t.string "name" t.datetime "starts_at" @@ -1135,8 +1090,6 @@ ActiveRecord::Schema.define(version: 20171002122312) do add_foreign_key "organizations", "users" add_foreign_key "poll_answers", "poll_questions", column: "question_id" add_foreign_key "poll_booth_assignments", "polls" - add_foreign_key "poll_null_results", "poll_booth_assignments", column: "booth_assignment_id" - add_foreign_key "poll_null_results", "poll_officer_assignments", column: "officer_assignment_id" add_foreign_key "poll_officer_assignments", "poll_booth_assignments", column: "booth_assignment_id" add_foreign_key "poll_partial_results", "poll_booth_assignments", column: "booth_assignment_id" add_foreign_key "poll_partial_results", "poll_officer_assignments", column: "officer_assignment_id" @@ -1148,8 +1101,6 @@ ActiveRecord::Schema.define(version: 20171002122312) do add_foreign_key "poll_recounts", "poll_booth_assignments", column: "booth_assignment_id" add_foreign_key "poll_recounts", "poll_officer_assignments", column: "officer_assignment_id" add_foreign_key "poll_voters", "polls" - add_foreign_key "poll_white_results", "poll_booth_assignments", column: "booth_assignment_id" - add_foreign_key "poll_white_results", "poll_officer_assignments", column: "officer_assignment_id" add_foreign_key "proposals", "communities" add_foreign_key "users", "geozones" add_foreign_key "valuators", "users" diff --git a/knapsack_rspec_report.json b/knapsack_rspec_report.json index 595276b2b..5f1fc06b5 100644 --- a/knapsack_rspec_report.json +++ b/knapsack_rspec_report.json @@ -1,226 +1,227 @@ { - "spec/helpers/comments_helper_spec.rb": 0.010898828506469727, - "spec/controllers/graphql_controller_spec.rb": 0.7817962169647217, - "spec/controllers/concerns/has_orders_spec.rb": 0.09597063064575195, - "spec/features/officing/results_spec.rb": 2.6492855548858643, - "spec/models/poll/question_spec.rb": 0.09519433975219727, - "spec/features/organizations_spec.rb": 1.9025108814239502, - "spec/models/legislation/process_spec.rb": 0.09253501892089844, - "spec/lib/acts_as_paranoid_aliases_spec.rb": 0.2438969612121582, - "spec/features/officing_spec.rb": 1.4767742156982422, - "spec/lib/age_spec.rb": 0.0006227493286132812, - "spec/models/proposal_spec.rb": 5.535696983337402, - "spec/models/abilities/administrator_spec.rb": 2.2431821823120117, - "spec/models/poll/final_recount_spec.rb": 0.1787703037261963, - "spec/lib/graph_ql/query_type_creator_spec.rb": 0.012041091918945312, - "spec/models/verification/management/email_spec.rb": 0.06403493881225586, - "spec/models/flag_spec.rb": 0.46442556381225586, - "spec/features/tags/budget_investments_spec.rb": 23.748523235321045, - "spec/features/campaigns_spec.rb": 1.3289697170257568, - "spec/features/admin/activity_spec.rb": 7.763890743255615, - "spec/features/polls/questions_spec.rb": 2.61055326461792, - "spec/features/polls/polls_spec.rb": 2.313369035720825, - "spec/features/home_spec.rb": 0.9780440330505371, - "spec/models/poll/partial_result_spec.rb": 0.3302469253540039, - "spec/models/lock_spec.rb": 0.09437012672424316, - "spec/lib/graph_ql/api_types_creator_spec.rb": 0.0069005489349365234, - "spec/helpers/users_helper_spec.rb": 0.3229796886444092, - "spec/lib/local_census_spec.rb": 0.011091947555541992, - "spec/helpers/text_helper_spec.rb": 0.0005347728729248047, - "spec/customization_engine_spec.rb": 1.3630127906799316, - "spec/models/legislation/answer_spec.rb": 0.6906075477600098, - "spec/models/budget/ballot/line_spec.rb": 0.5054352283477783, - "spec/features/admin/proposals_spec.rb": 1.6710176467895508, - "spec/features/proposal_ballots_spec.rb": 0.3399386405944824, - "spec/models/site_customization/content_block_spec.rb": 0.014521121978759766, - "spec/features/admin/site_customization/content_blocks_spec.rb": 1.2890841960906982, - "spec/models/site_customization/page_spec.rb": 0.011090993881225586, - "spec/features/verification/email_spec.rb": 1.0991628170013428, - "spec/models/proposal_notification_spec.rb": 0.2569601535797119, - "spec/features/registration_form_spec.rb": 0.7285032272338867, - "spec/features/communities_spec.rb": 1.7133822441101074, - "spec/features/admin/moderators_spec.rb": 1.2922589778900146, - "spec/helpers/geozones_helper_spec.rb": 0.09812736511230469, - "spec/features/welcome_spec.rb": 1.5019774436950684, - "spec/controllers/comments_controller_spec.rb": 0.36508607864379883, - "spec/features/admin/legislation/questions_spec.rb": 3.81538724899292, - "spec/controllers/users/registrations_controller_spec.rb": 0.018311023712158203, - "spec/features/comments/debates_spec.rb": 12.265411615371704, - "spec/features/users_spec.rb": 11.05901050567627, - "spec/models/budget/group_spec.rb": 0.04957008361816406, - "spec/features/admin/poll/questions_spec.rb": 1.9041199684143066, - "spec/helpers/admin_helper_spec.rb": 0.00651097297668457, - "spec/models/abilities/organization_spec.rb": 0.24821996688842773, - "spec/features/moderation/comments_spec.rb": 6.318082332611084, - "spec/features/admin/poll/polls_spec.rb": 8.88325023651123, - "spec/models/activity_spec.rb": 0.9704892635345459, - "spec/features/verification/level_two_verification_spec.rb": 0.421832799911499, - "spec/models/poll/officer_assignment_spec.rb": 0.029267072677612305, - "spec/features/admin/verifications_spec.rb": 0.507885217666626, - "spec/mailers/mailer_spec.rb": 0.07406282424926758, - "spec/models/legislation/draft_version_spec.rb": 0.025011777877807617, - "spec/models/budget/investment_spec.rb": 9.084597826004028, - "spec/features/proposals_spec.rb": 183.71455550193787, - "spec/features/tags_spec.rb": 2.949070453643799, - "spec/features/tags/debates_spec.rb": 4.345250368118286, - "spec/features/admin/geozones_spec.rb": 1.935765027999878, - "spec/features/admin/feature_flags_spec.rb": 0.8357558250427246, - "spec/models/user_spec.rb": 2.436626434326172, - "spec/features/moderation/debates_spec.rb": 6.05112886428833, - "spec/models/legislation/annotation_spec.rb": 0.21427702903747559, - "spec/features/comments/proposals_spec.rb": 32.52879500389099, - "spec/controllers/legislation/answers_controller_spec.rb": 0.3481717109680176, - "spec/features/verification/sms_spec.rb": 1.2817349433898926, - "spec/features/admin/budget_investments_spec.rb": 16.1332266330719, - "spec/features/notifications_spec.rb": 14.857182264328003, - "spec/lib/tag_sanitizer_spec.rb": 0.0005936622619628906, - "spec/controllers/admin/api/stats_controller_spec.rb": 0.3948392868041992, - "spec/features/comments/topics_spec.rb": 29.646622896194458, - "spec/models/debate_spec.rb": 5.2278876304626465, - "spec/lib/email_digests_spec.rb": 0.6660604476928711, - "spec/models/abilities/everyone_spec.rb": 0.06328749656677246, - "spec/features/direct_messages_spec.rb": 1.3006987571716309, - "spec/features/debates_spec.rb": 28.736626386642456, - "spec/models/setting_spec.rb": 0.07938265800476074, - "spec/models/legislation/question_option_spec.rb": 0.058206796646118164, - "spec/models/verification/management/document_spec.rb": 0.013574600219726562, - "spec/models/poll/booth_spec.rb": 0.07824325561523438, - "spec/features/admin/legislation/draft_versions_spec.rb": 3.750009059906006, - "spec/features/admin/poll/officers_spec.rb": 1.4151291847229004, - "spec/features/moderation_spec.rb": 1.9578778743743896, - "spec/features/legislation/questions_spec.rb": 1.7689197063446045, - "spec/features/officing/residence_spec.rb": 0.971078634262085, - "spec/models/follow_spec.rb": 0.12199592590332031, - "spec/lib/census_api_spec.rb": 0.0019702911376953125, - "spec/models/tag_cloud_spec.rb": 1.5725350379943848, - "spec/models/budget_spec.rb": 0.2335052490234375, - "spec/features/management/localization_spec.rb": 1.1911811828613281, - "spec/features/legislation/draft_versions_spec.rb": 8.151643514633179, - "spec/models/budget/heading_spec.rb": 0.09901237487792969, - "spec/models/poll/poll_spec.rb": 0.46999382972717285, - "spec/models/custom/residence_spec.rb": 0.050164222717285156, - "spec/models/notification_spec.rb": 0.39408183097839355, - "spec/features/budgets/ballots_spec.rb": 27.406018257141113, - "spec/mailers/devise_mailer_spec.rb": 0.16486406326293945, - "spec/features/admin/debates_spec.rb": 1.546919345855713, - "spec/features/valuation/budgets_spec.rb": 0.2552778720855713, - "spec/models/abilities/common_spec.rb": 6.724466562271118, - "spec/models/residence_spec.rb": 0.24986696243286133, - "spec/features/officing/voters_spec.rb": 2.954087257385254, - "spec/models/vote_spec.rb": 1.3241477012634277, - "spec/lib/migrate_spending_proposals_to_investments_spec.rb": 1.1774518489837646, - "spec/controllers/management/users_controller_spec.rb": 0.007733821868896484, - "spec/helpers/proposals_helper_spec.rb": 0.21885180473327637, - "spec/features/ckeditor_spec.rb": 0.7726309299468994, - "spec/lib/census_caller_spec.rb": 0.009332895278930664, - "spec/features/tracks_spec.rb": 2.7082908153533936, - "spec/features/admin/budgets_spec.rb": 4.468225002288818, - "spec/features/admin/valuators_spec.rb": 1.3326430320739746, - "spec/features/admin/banners_spec.rb": 3.302579164505005, - "spec/features/account_spec.rb": 2.30243182182312, - "spec/features/budgets/budgets_spec.rb": 1.0318260192871094, - "spec/models/poll/answer_spec.rb": 0.11362218856811523, - "spec/features/comments/budget_investments_spec.rb": 16.92409658432007, - "spec/features/budgets/results_spec.rb": 2.589841365814209, - "spec/features/valuation_spec.rb": 2.126727819442749, - "spec/features/stats_spec.rb": 0.8516559600830078, - "spec/features/admin/poll/booths_spec.rb": 1.766916275024414, - "spec/models/legislation/process/phase_spec.rb": 0.0886683464050293, - "spec/models/budget/investment/milestone_spec.rb": 0.1419520378112793, - "spec/models/letter_spec.rb": 0.08197903633117676, - "spec/features/admin/stats_spec.rb": 3.6946730613708496, - "spec/models/identity_spec.rb": 0.004762887954711914, - "spec/features/verification/letter_spec.rb": 1.7480952739715576, - "spec/models/topic_spec.rb": 0.30414509773254395, - "spec/features/users_auth_spec.rb": 7.242254257202148, - "spec/lib/acts_as_taggable_on_spec.rb": 0.7477433681488037, - "spec/features/official_positions_spec.rb": 1.9427640438079834, - "spec/features/admin/newsletters_spec.rb": 0.22768402099609375, - "spec/features/admin/hidden_users_spec.rb": 1.4156956672668457, - "spec/features/comments/legislation_annotations_spec.rb": 18.616747856140137, - "spec/features/admin/site_customization/pages_spec.rb": 1.0219447612762451, - "spec/models/poll/shift_spec.rb": 0.2051677703857422, - "spec/models/geozone_spec.rb": 0.12972474098205566, - "spec/helpers/verification_helper_spec.rb": 0.0009250640869140625, - "spec/lib/cache_spec.rb": 0.06447911262512207, - "spec/features/verification/verification_path_spec.rb": 1.2300751209259033, - "spec/features/sessions_spec.rb": 0.3665180206298828, - "spec/controllers/management/base_controller_spec.rb": 0.019928932189941406, - "spec/features/verification/verified_user_spec.rb": 0.787623405456543, - "spec/models/direct_message_spec.rb": 0.49156641960144043, - "spec/features/admin/tags_spec.rb": 1.045637845993042, - "spec/features/admin/comments_spec.rb": 3.4312756061553955, - "spec/features/moderation/users_spec.rb": 1.1841027736663818, - "spec/models/budget/reclassified_vote_spec.rb": 0.22663235664367676, - "spec/features/admin/organizations_spec.rb": 3.4465878009796143, - "spec/features/proposal_notifications_spec.rb": 4.40612268447876, - "spec/features/emails_spec.rb": 13.047018051147461, - "spec/controllers/debates_controller_spec.rb": 0.3078582286834717, - "spec/features/budgets/investments_spec.rb": 126.55784440040588, - "spec/features/verification/residence_spec.rb": 1.8894774913787842, - "spec/models/abilities/moderator_spec.rb": 2.7029502391815186, - "spec/helpers/votes_helper_spec.rb": 0.363523006439209, - "spec/features/tags/proposals_spec.rb": 8.272820949554443, - "spec/models/signature_spec.rb": 1.6858570575714111, - "spec/models/legislation/process/publication_spec.rb": 0.0707387924194336, - "spec/models/community_spec.rb": 0.13965797424316406, - "spec/models/sms_spec.rb": 0.024147987365722656, - "spec/lib/graphql_spec.rb": 3.7293970584869385, - "spec/lib/tasks/communities_spec.rb": 0.17484474182128906, - "spec/features/management/proposals_spec.rb": 4.549585580825806, - "spec/models/document_spec.rb": 1.2667145729064941, - "spec/features/site_customization/content_blocks_spec.rb": 0.3020951747894287, - "spec/features/localization_spec.rb": 0.5679850578308105, - "spec/models/signature_sheet_spec.rb": 0.7970001697540283, - "spec/features/budgets/votes_spec.rb": 4.38911509513855, - "spec/features/verification/level_three_verification_spec.rb": 1.2754230499267578, - "spec/features/admin/users_spec.rb": 0.3584918975830078, - "spec/models/abilities/valuator_spec.rb": 1.1300320625305176, - "spec/models/officing/residence_spec.rb": 0.3599817752838135, - "spec/features/admin/officials_spec.rb": 0.940401554107666, - "spec/features/admin/settings_spec.rb": 0.37268495559692383, - "spec/models/ahoy/data_source_spec.rb": 0.04887723922729492, - "spec/helpers/settings_helper_spec.rb": 0.020088911056518555, - "spec/models/budget/result_spec.rb": 0.7962813377380371, - "spec/models/poll/null_result_spec.rb": 0.17995309829711914, - "spec/models/valuator_spec.rb": 0.02411341667175293, - "spec/lib/manager_authenticator_spec.rb": 0.0031435489654541016, - "spec/lib/tasks/settings_spec.rb": 0.07562613487243652, - "spec/controllers/legislation/annotations_controller_spec.rb": 0.712010383605957, - "spec/models/comment_spec.rb": 1.7274408340454102, - "spec/features/comments/legislation_questions_spec.rb": 15.219935894012451, - "spec/features/admin_spec.rb": 1.1390578746795654, - "spec/features/admin/poll/booth_assigments_spec.rb": 3.737426280975342, - "spec/controllers/pages_controller_spec.rb": 0.3043200969696045, - "spec/features/admin/administrators_spec.rb": 2.7916433811187744, - "spec/models/poll/total_result_spec.rb": 0.549537181854248, - "spec/features/management/managed_users_spec.rb": 4.38576078414917, - "spec/models/poll/officer_spec.rb": 0.49225711822509766, - "spec/features/user_invites_spec.rb": 0.21891093254089355, - "spec/helpers/application_helper_spec.rb": 0.13661718368530273, - "spec/features/management/account_spec.rb": 0.9717822074890137, - "spec/features/management/document_verifications_spec.rb": 1.0395607948303223, - "spec/features/admin/site_customization/images_spec.rb": 1.2623581886291504, - "spec/models/organization_spec.rb": 0.16587495803833008, - "spec/features/management/email_verifications_spec.rb": 0.46370506286621094, - "spec/features/legislation/processes_spec.rb": 3.2473270893096924, - "spec/features/admin/managers_spec.rb": 1.1836414337158203, - "spec/models/legislation/question_spec.rb": 0.4404168128967285, - "spec/features/management/budget_investments_spec.rb": 7.179029703140259, - "spec/features/admin/signature_sheets_spec.rb": 1.4004056453704834, - "spec/features/admin/poll/shifts_spec.rb": 2.6800806522369385, - "spec/i18n_spec.rb": 58.107173204422, - "spec/features/site_customization/custom_pages_spec.rb": 0.454498291015625, - "spec/features/admin/legislation/processes_spec.rb": 3.3492519855499268, - "spec/features/votes_spec.rb": 16.538654088974, - "spec/features/admin/budget_investment_milestones_spec.rb": 1.3747622966766357, - "spec/models/poll/white_result_spec.rb": 0.23045921325683594, - "spec/controllers/management/sessions_controller_spec.rb": 0.06758952140808105, - "spec/features/management/users_spec.rb": 2.044326066970825, - "spec/controllers/concerns/has_filters_spec.rb": 0.275907039642334, - "spec/features/moderation/proposals_spec.rb": 5.00596022605896, - "spec/lib/wysiwyg_sanitizer_spec.rb": 0.0016448497772216797, - "spec/models/budget/ballot_spec.rb": 0.6595156192779541, - "spec/models/poll/voter_spec.rb": 0.2982313632965088, - "spec/features/valuation/budget_investments_spec.rb": 6.490516185760498 + "spec/models/setting_spec.rb": 0.07869887351989746, + "spec/features/admin/managers_spec.rb": 5.029380798339844, + "spec/features/management/managed_users_spec.rb": 3.1642160415649414, + "spec/features/admin/poll/booths_spec.rb": 1.4152588844299316, + "spec/features/admin/comments_spec.rb": 3.889301061630249, + "spec/helpers/admin_helper_spec.rb": 0.005057334899902344, + "spec/models/abilities/moderator_spec.rb": 2.3274271488189697, + "spec/controllers/admin/api/stats_controller_spec.rb": 0.4249396324157715, + "spec/features/admin/organizations_spec.rb": 3.339292049407959, + "spec/features/admin/newsletters_spec.rb": 0.2460641860961914, + "spec/helpers/geozones_helper_spec.rb": 0.08249163627624512, + "spec/lib/graph_ql/api_types_creator_spec.rb": 0.006573915481567383, + "spec/features/emails_spec.rb": 18.91256046295166, + "spec/features/admin/hidden_users_spec.rb": 1.3854436874389648, + "spec/features/welcome_spec.rb": 1.1956276893615723, + "spec/features/sessions_spec.rb": 0.3943772315979004, + "spec/models/custom/residence_spec.rb": 0.07002687454223633, + "spec/models/poll/booth_spec.rb": 0.05489993095397949, + "spec/models/direct_message_spec.rb": 0.3973381519317627, + "spec/features/valuation/budget_investments_spec.rb": 7.6013023853302, + "spec/models/map_location_spec.rb": 0.12476563453674316, + "spec/models/budget/heading_spec.rb": 0.09248590469360352, + "spec/models/user_spec.rb": 2.9006423950195312, + "spec/features/admin/site_customization/content_blocks_spec.rb": 1.6733989715576172, + "spec/mailers/mailer_spec.rb": 0.08513784408569336, + "spec/models/site_customization/page_spec.rb": 0.015056133270263672, + "spec/features/management/budget_investments_spec.rb": 8.112786293029785, + "spec/features/admin/activity_spec.rb": 12.442089080810547, + "spec/features/registration_form_spec.rb": 1.0509357452392578, + "spec/controllers/legislation/annotations_controller_spec.rb": 0.8151364326477051, + "spec/lib/census_caller_spec.rb": 0.018165111541748047, + "spec/features/users_auth_spec.rb": 6.5102221965789795, + "spec/features/tags/proposals_spec.rb": 10.001718521118164, + "spec/features/account_spec.rb": 2.2510504722595215, + "spec/features/admin/users_spec.rb": 0.4342050552368164, + "spec/lib/cache_spec.rb": 0.057682037353515625, + "spec/features/valuation_spec.rb": 1.3436784744262695, + "spec/models/budget/investment_spec.rb": 12.89230751991272, + "spec/lib/migrate_spending_proposals_to_investments_spec.rb": 0.904367208480835, + "spec/helpers/settings_helper_spec.rb": 0.02300858497619629, + "spec/helpers/application_helper_spec.rb": 0.09152626991271973, + "spec/models/legislation/draft_version_spec.rb": 0.020322084426879883, + "spec/models/legislation/question_spec.rb": 0.3402721881866455, + "spec/models/document_spec.rb": 1.3238348960876465, + "spec/models/poll/question_spec.rb": 0.12588191032409668, + "spec/features/admin/poll/polls_spec.rb": 11.77881646156311, + "spec/lib/manager_authenticator_spec.rb": 0.006296873092651367, + "spec/features/admin/debates_spec.rb": 1.688420295715332, + "spec/features/moderation/debates_spec.rb": 5.343512773513794, + "spec/controllers/debates_controller_spec.rb": 0.40573883056640625, + "spec/models/tag_cloud_spec.rb": 1.6984672546386719, + "spec/models/budget/investment/milestone_spec.rb": 0.15051603317260742, + "spec/models/proposal_notification_spec.rb": 0.2914905548095703, + "spec/features/budgets/investments_spec.rb": 93.5263159275055, + "spec/i18n_spec.rb": 96.26275777816772, + "spec/models/community_spec.rb": 0.16270899772644043, + "spec/controllers/graphql_controller_spec.rb": 0.5831413269042969, + "spec/models/legislation/annotation_spec.rb": 0.16232728958129883, + "spec/lib/acts_as_taggable_on_spec.rb": 0.5747356414794922, + "spec/lib/census_api_spec.rb": 0.0021581649780273438, + "spec/features/moderation/comments_spec.rb": 6.70704984664917, + "spec/models/poll/voter_spec.rb": 0.32018303871154785, + "spec/features/proposal_notifications_spec.rb": 3.906450033187866, + "spec/models/budget/result_spec.rb": 0.8468267917633057, + "spec/helpers/users_helper_spec.rb": 0.25751638412475586, + "spec/features/valuation/budgets_spec.rb": 0.2564871311187744, + "spec/controllers/users/registrations_controller_spec.rb": 0.022383689880371094, + "spec/controllers/management/base_controller_spec.rb": 0.06711888313293457, + "spec/features/admin/officials_spec.rb": 0.893528938293457, + "spec/features/comments/topics_spec.rb": 29.998314142227173, + "spec/features/users_spec.rb": 11.885858297348022, + "spec/models/topic_spec.rb": 0.27634167671203613, + "spec/models/follow_spec.rb": 0.1256728172302246, + "spec/lib/local_census_spec.rb": 0.005529880523681641, + "spec/features/verification/sms_spec.rb": 1.5214743614196777, + "spec/helpers/comments_helper_spec.rb": 0.010879278182983398, + "spec/models/valuator_spec.rb": 0.02650904655456543, + "spec/features/proposal_ballots_spec.rb": 0.3937220573425293, + "spec/features/proposals_spec.rb": 142.48229122161865, + "spec/features/legislation/processes_spec.rb": 2.863476514816284, + "spec/features/ckeditor_spec.rb": 0.8433480262756348, + "spec/models/letter_spec.rb": 0.0695810317993164, + "spec/features/admin/budget_investments_spec.rb": 18.484699964523315, + "spec/models/officing/residence_spec.rb": 0.3402073383331299, + "spec/controllers/concerns/has_orders_spec.rb": 0.1844041347503662, + "spec/features/admin/legislation/processes_spec.rb": 4.020649433135986, + "spec/features/management/users_spec.rb": 2.288966178894043, + "spec/lib/tasks/communities_spec.rb": 0.15353775024414062, + "spec/models/abilities/organization_spec.rb": 0.24793481826782227, + "spec/features/polls/polls_spec.rb": 2.591568946838379, + "spec/features/communities_spec.rb": 1.6137127876281738, + "spec/models/legislation/process/phase_spec.rb": 0.07121586799621582, + "spec/features/officing_spec.rb": 0.979363203048706, + "spec/features/site_customization/custom_pages_spec.rb": 0.5588700771331787, + "spec/features/comments/legislation_questions_spec.rb": 14.133169889450073, + "spec/features/organizations_spec.rb": 0.46280837059020996, + "spec/controllers/legislation/answers_controller_spec.rb": 0.39082813262939453, + "spec/models/image_spec.rb": 7.636544466018677, + "spec/features/management/account_spec.rb": 1.150636911392212, + "spec/models/abilities/common_spec.rb": 5.959435701370239, + "spec/features/comments/debates_spec.rb": 13.69457721710205, + "spec/models/poll/shift_spec.rb": 0.19109749794006348, + "spec/features/site_customization/content_blocks_spec.rb": 0.3058288097381592, + "spec/models/poll/recount_spec.rb": 0.1983809471130371, + "spec/features/verification/level_two_verification_spec.rb": 0.4596068859100342, + "spec/features/verification/level_three_verification_spec.rb": 1.456559658050537, + "spec/lib/tasks/settings_spec.rb": 0.04654407501220703, + "spec/features/admin/budget_investment_milestones_spec.rb": 1.3974273204803467, + "spec/features/management/localization_spec.rb": 1.1653187274932861, + "spec/features/admin/tags_spec.rb": 1.0751111507415771, + "spec/features/officing/results_spec.rb": 1.2672057151794434, + "spec/features/admin/poll/booth_assigments_spec.rb": 4.1742753982543945, + "spec/models/poll/officer_assignment_spec.rb": 0.024514198303222656, + "spec/controllers/management/sessions_controller_spec.rb": 0.07244610786437988, + "spec/features/admin/signature_sheets_spec.rb": 1.4268932342529297, + "spec/models/debate_spec.rb": 4.550540924072266, + "spec/features/comments/proposals_spec.rb": 25.726442337036133, + "spec/models/poll/partial_result_spec.rb": 0.32181620597839355, + "spec/features/admin/legislation/draft_versions_spec.rb": 3.4613990783691406, + "spec/models/budget_spec.rb": 0.14807415008544922, + "spec/models/sms_spec.rb": 0.018825769424438477, + "spec/features/admin/proposals_spec.rb": 1.837270975112915, + "spec/models/geozone_spec.rb": 0.11852264404296875, + "spec/features/admin/banners_spec.rb": 3.0584604740142822, + "spec/models/legislation/process/publication_spec.rb": 0.06270265579223633, + "spec/lib/graph_ql/query_type_creator_spec.rb": 0.009456157684326172, + "spec/features/moderation_spec.rb": 1.001516342163086, + "spec/features/campaigns_spec.rb": 0.8359789848327637, + "spec/features/admin/verifications_spec.rb": 0.6421175003051758, + "spec/features/localization_spec.rb": 0.756089448928833, + "spec/features/admin/poll/questions_spec.rb": 41.59848093986511, + "spec/features/tags/debates_spec.rb": 3.4022486209869385, + "spec/helpers/text_helper_spec.rb": 0.0006229877471923828, + "spec/features/admin/moderators_spec.rb": 1.3467354774475098, + "spec/models/flag_spec.rb": 0.5202171802520752, + "spec/mailers/devise_mailer_spec.rb": 0.2588930130004883, + "spec/features/user_invites_spec.rb": 0.18819189071655273, + "spec/features/legislation/draft_versions_spec.rb": 9.352471828460693, + "spec/features/home_spec.rb": 3.0868682861328125, + "spec/features/budgets/results_spec.rb": 2.4918482303619385, + "spec/features/budgets/votes_spec.rb": 4.285862922668457, + "spec/features/comments/budget_investments_spec.rb": 16.1397545337677, + "spec/features/admin/stats_spec.rb": 2.678718090057373, + "spec/features/polls/questions_spec.rb": 2.594414472579956, + "spec/features/admin/poll/shifts_spec.rb": 4.629284143447876, + "spec/helpers/votes_helper_spec.rb": 0.31733107566833496, + "spec/models/ahoy/data_source_spec.rb": 0.04695439338684082, + "spec/models/residence_spec.rb": 0.20260858535766602, + "spec/features/admin_spec.rb": 0.6963987350463867, + "spec/controllers/comments_controller_spec.rb": 0.2683417797088623, + "spec/lib/age_spec.rb": 0.0007379055023193359, + "spec/models/legislation/answer_spec.rb": 0.14532899856567383, + "spec/features/tags_spec.rb": 3.0131027698516846, + "spec/features/admin/valuators_spec.rb": 1.0099408626556396, + "spec/models/notification_spec.rb": 0.37938618659973145, + "spec/views/welcome/index.html.erb_spec.rb": 0.1471250057220459, + "spec/customization_engine_spec.rb": 1.5587348937988281, + "spec/models/poll/officer_spec.rb": 0.2980079650878906, + "spec/features/budgets/ballots_spec.rb": 25.24861741065979, + "spec/controllers/concerns/has_filters_spec.rb": 0.1412961483001709, + "spec/features/moderation/proposals_spec.rb": 5.947849273681641, + "spec/features/management/document_verifications_spec.rb": 0.9574480056762695, + "spec/features/legislation/questions_spec.rb": 1.605849027633667, + "spec/models/proposal_spec.rb": 5.872406482696533, + "spec/models/legislation/question_option_spec.rb": 0.0395960807800293, + "spec/features/budgets/budgets_spec.rb": 0.8722023963928223, + "spec/lib/email_digests_spec.rb": 0.440814733505249, + "spec/features/official_positions_spec.rb": 1.5717194080352783, + "spec/features/officing/residence_spec.rb": 0.9819045066833496, + "spec/features/officing/voters_spec.rb": 2.078903913497925, + "spec/features/direct_messages_spec.rb": 1.6070659160614014, + "spec/models/abilities/everyone_spec.rb": 0.059804677963256836, + "spec/lib/acts_as_paranoid_aliases_spec.rb": 0.33096909523010254, + "spec/features/debates_spec.rb": 32.84718298912048, + "spec/features/votes_spec.rb": 18.217467069625854, + "spec/models/activity_spec.rb": 1.0154414176940918, + "spec/controllers/pages_controller_spec.rb": 0.19468045234680176, + "spec/features/admin/feature_flags_spec.rb": 0.726452112197876, + "spec/models/signature_sheet_spec.rb": 0.6403882503509521, + "spec/features/admin/poll/officers_spec.rb": 1.2912020683288574, + "spec/models/lock_spec.rb": 0.08562397956848145, + "spec/helpers/proposals_helper_spec.rb": 0.17275524139404297, + "spec/features/tags/budget_investments_spec.rb": 14.154245615005493, + "spec/models/vote_spec.rb": 0.9258472919464111, + "spec/features/admin/site_customization/pages_spec.rb": 1.0365827083587646, + "spec/features/moderation/users_spec.rb": 1.3000907897949219, + "spec/features/comments/legislation_annotations_spec.rb": 19.67066717147827, + "spec/features/admin/legislation/questions_spec.rb": 4.043334007263184, + "spec/models/comment_spec.rb": 1.6633994579315186, + "spec/features/admin/site_customization/images_spec.rb": 1.2299704551696777, + "spec/models/abilities/valuator_spec.rb": 1.1985805034637451, + "spec/models/organization_spec.rb": 0.12121891975402832, + "spec/models/budget/ballot_spec.rb": 0.6403298377990723, + "spec/lib/wysiwyg_sanitizer_spec.rb": 0.0018651485443115234, + "spec/features/stats_spec.rb": 0.8169982433319092, + "spec/models/poll/answer_spec.rb": 0.13266730308532715, + "spec/features/admin/settings_spec.rb": 3.1228368282318115, + "spec/features/verification/verification_path_spec.rb": 1.1146795749664307, + "spec/controllers/management/users_controller_spec.rb": 0.004178762435913086, + "spec/models/direct_upload_spec.rb": 1.1311051845550537, + "spec/features/management/email_verifications_spec.rb": 0.3727388381958008, + "spec/models/abilities/administrator_spec.rb": 2.355985164642334, + "spec/models/budget/ballot/line_spec.rb": 0.49976515769958496, + "spec/features/verification/letter_spec.rb": 1.5464122295379639, + "spec/features/notifications_spec.rb": 19.54401397705078, + "spec/features/admin/administrators_spec.rb": 1.7901337146759033, + "spec/models/signature_spec.rb": 1.5397937297821045, + "spec/models/identity_spec.rb": 0.0023458003997802734, + "spec/models/verification/management/document_spec.rb": 0.017922163009643555, + "spec/models/legislation/process_spec.rb": 0.09648776054382324, + "spec/models/budget/group_spec.rb": 0.049637794494628906, + "spec/models/verification/management/email_spec.rb": 0.057023048400878906, + "spec/helpers/verification_helper_spec.rb": 0.0009088516235351562, + "spec/features/verification/residence_spec.rb": 2.2246382236480713, + "spec/features/tracks_spec.rb": 2.320988178253174, + "spec/lib/tag_sanitizer_spec.rb": 0.0005729198455810547, + "spec/features/admin/budgets_spec.rb": 4.4486541748046875, + "spec/models/site_customization/content_block_spec.rb": 0.010473012924194336, + "spec/features/verification/email_spec.rb": 0.5266687870025635, + "spec/models/budget/reclassified_vote_spec.rb": 0.19786882400512695, + "spec/features/management/proposals_spec.rb": 4.107697486877441, + "spec/models/poll/poll_spec.rb": 0.38217735290527344, + "spec/features/admin/geozones_spec.rb": 1.561723232269287, + "spec/lib/graphql_spec.rb": 3.063258647918701, + "spec/features/verification/verified_user_spec.rb": 0.8179008960723877 } \ No newline at end of file diff --git a/spec/factories.rb b/spec/factories.rb index 30159f85a..93f00d27a 100644 --- a/spec/factories.rb +++ b/spec/factories.rb @@ -554,21 +554,6 @@ FactoryGirl.define do answer { question.valid_answers.sample } end - factory :poll_white_result, class: 'Poll::WhiteResult' do - association :author, factory: :user - origin { 'web' } - end - - factory :poll_null_result, class: 'Poll::NullResult' do - association :author, factory: :user - origin { 'web' } - end - - factory :poll_total_result, class: 'Poll::TotalResult' do - association :author, factory: :user - origin { 'web' } - end - factory :poll_recount, class: 'Poll::Recount' do association :author, factory: :user origin { 'web' } diff --git a/spec/models/poll/null_result_spec.rb b/spec/models/poll/null_result_spec.rb deleted file mode 100644 index 746b48377..000000000 --- a/spec/models/poll/null_result_spec.rb +++ /dev/null @@ -1,70 +0,0 @@ -require 'rails_helper' - -describe Poll::NullResult do - - describe "logging changes" do - it "should update amount_log if amount changes" do - null_result = create(:poll_null_result, amount: 33) - - expect(null_result.amount_log).to eq("") - - null_result.amount = 33 - null_result.save - null_result.amount = 32 - null_result.save - null_result.amount = 34 - null_result.save - - expect(null_result.amount_log).to eq(":33:32") - end - - it "should update officer_assignment_id_log if amount changes" do - null_result = create(:poll_null_result, amount: 33) - - expect(null_result.amount_log).to eq("") - expect(null_result.officer_assignment_id_log).to eq("") - - null_result.amount = 33 - null_result.officer_assignment = create(:poll_officer_assignment, id: 101) - null_result.save - - null_result.amount = 32 - null_result.officer_assignment = create(:poll_officer_assignment, id: 102) - null_result.save - - null_result.amount = 34 - null_result.officer_assignment = create(:poll_officer_assignment, id: 103) - null_result.save - - expect(null_result.amount_log).to eq(":33:32") - expect(null_result.officer_assignment_id_log).to eq(":101:102") - end - - it "should update author_id if amount changes" do - null_result = create(:poll_null_result, amount: 33) - - expect(null_result.amount_log).to eq("") - expect(null_result.author_id_log).to eq("") - - author_A = create(:poll_officer).user - author_B = create(:poll_officer).user - author_C = create(:poll_officer).user - - null_result.amount = 33 - null_result.author_id = author_A.id - null_result.save! - - null_result.amount = 32 - null_result.author_id = author_B.id - null_result.save! - - null_result.amount = 34 - null_result.author_id = author_C.id - null_result.save! - - expect(null_result.amount_log).to eq(":33:32") - expect(null_result.author_id_log).to eq(":#{author_A.id}:#{author_B.id}") - end - end - -end \ No newline at end of file diff --git a/spec/models/poll/total_result_spec.rb b/spec/models/poll/total_result_spec.rb deleted file mode 100644 index baa877227..000000000 --- a/spec/models/poll/total_result_spec.rb +++ /dev/null @@ -1,70 +0,0 @@ -require 'rails_helper' - -describe Poll::TotalResult do - - describe "logging changes" do - it "should update amount_log if amount changes" do - total_result = create(:poll_total_result, amount: 33) - - expect(total_result.amount_log).to eq("") - - total_result.amount = 33 - total_result.save - total_result.amount = 32 - total_result.save - total_result.amount = 34 - total_result.save - - expect(total_result.amount_log).to eq(":33:32") - end - - it "should update officer_assignment_id_log if amount changes" do - total_result = create(:poll_total_result, amount: 33) - - expect(total_result.amount_log).to eq("") - expect(total_result.officer_assignment_id_log).to eq("") - - total_result.amount = 33 - total_result.officer_assignment = create(:poll_officer_assignment, id: 101) - total_result.save - - total_result.amount = 32 - total_result.officer_assignment = create(:poll_officer_assignment, id: 102) - total_result.save - - total_result.amount = 34 - total_result.officer_assignment = create(:poll_officer_assignment, id: 103) - total_result.save - - expect(total_result.amount_log).to eq(":33:32") - expect(total_result.officer_assignment_id_log).to eq(":101:102") - end - - it "should update author_id if amount changes" do - total_result = create(:poll_total_result, amount: 33) - - expect(total_result.amount_log).to eq("") - expect(total_result.author_id_log).to eq("") - - author_A = create(:poll_officer).user - author_B = create(:poll_officer).user - author_C = create(:poll_officer).user - - total_result.amount = 33 - total_result.author_id = author_A.id - total_result.save! - - total_result.amount = 32 - total_result.author_id = author_B.id - total_result.save! - - total_result.amount = 34 - total_result.author_id = author_C.id - total_result.save! - - expect(total_result.amount_log).to eq(":33:32") - expect(total_result.author_id_log).to eq(":#{author_A.id}:#{author_B.id}") - end - end - -end diff --git a/spec/models/poll/white_result_spec.rb b/spec/models/poll/white_result_spec.rb deleted file mode 100644 index 687c4ebe1..000000000 --- a/spec/models/poll/white_result_spec.rb +++ /dev/null @@ -1,70 +0,0 @@ -require 'rails_helper' - -describe Poll::WhiteResult do - - describe "logging changes" do - it "should update amount_log if amount changes" do - white_result = create(:poll_white_result, amount: 33) - - expect(white_result.amount_log).to eq("") - - white_result.amount = 33 - white_result.save - white_result.amount = 32 - white_result.save - white_result.amount = 34 - white_result.save - - expect(white_result.amount_log).to eq(":33:32") - end - - it "should update officer_assignment_id_log if amount changes" do - white_result = create(:poll_white_result, amount: 33) - - expect(white_result.amount_log).to eq("") - expect(white_result.officer_assignment_id_log).to eq("") - - white_result.amount = 33 - white_result.officer_assignment = create(:poll_officer_assignment, id: 21) - white_result.save - - white_result.amount = 32 - white_result.officer_assignment = create(:poll_officer_assignment, id: 22) - white_result.save - - white_result.amount = 34 - white_result.officer_assignment = create(:poll_officer_assignment, id: 23) - white_result.save - - expect(white_result.amount_log).to eq(":33:32") - expect(white_result.officer_assignment_id_log).to eq(":21:22") - end - - it "should update author_id if amount changes" do - white_result = create(:poll_white_result, amount: 33) - - expect(white_result.amount_log).to eq("") - expect(white_result.author_id_log).to eq("") - - author_A = create(:poll_officer).user - author_B = create(:poll_officer).user - author_C = create(:poll_officer).user - - white_result.amount = 33 - white_result.author_id = author_A.id - white_result.save! - - white_result.amount = 32 - white_result.author_id = author_B.id - white_result.save! - - white_result.amount = 34 - white_result.author_id = author_C.id - white_result.save! - - expect(white_result.amount_log).to eq(":33:32") - expect(white_result.author_id_log).to eq(":#{author_A.id}:#{author_B.id}") - end - end - -end \ No newline at end of file From ba9814cd85ac324ace35040bfff6da053a7e5181 Mon Sep 17 00:00:00 2001 From: decabeza Date: Mon, 9 Oct 2017 13:01:39 +0200 Subject: [PATCH 02/48] shows videos on polls answers --- app/views/polls/show.html.erb | 16 ++++++++++++++++ config/locales/en/general.yml | 1 + config/locales/es/general.yml | 1 + 3 files changed, 18 insertions(+) diff --git a/app/views/polls/show.html.erb b/app/views/polls/show.html.erb index 19daf5e35..b7877aa51 100644 --- a/app/views/polls/show.html.erb +++ b/app/views/polls/show.html.erb @@ -125,6 +125,22 @@ <% end %> <% end %> + + <% if answer.videos.present? %> + + <% end %> <% end %> diff --git a/config/locales/en/general.yml b/config/locales/en/general.yml index 413a6abf8..6c3356b6d 100644 --- a/config/locales/en/general.yml +++ b/config/locales/en/general.yml @@ -495,6 +495,7 @@ en: read_more: "Read more about %{answer}" read_less: "Read less about %{answer}" participate_in_other_polls: Participate in other polls + videos: "External video" poll_questions: create_question: "Create question" default_valid_answers: "Yes, No" diff --git a/config/locales/es/general.yml b/config/locales/es/general.yml index b8747406b..5f756bbdd 100644 --- a/config/locales/es/general.yml +++ b/config/locales/es/general.yml @@ -495,6 +495,7 @@ es: read_more: "Leer más sobre %{answer}" read_less: "Leer menos sobre %{answer}" participate_in_other_polls: Participar en otras votaciones + videos: "Vídeo externo" poll_questions: create_question: "Crear pregunta para votación" default_valid_answers: "Sí, No" From f23073bb286984b05edd1d90f2817cde5fbe79be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mar=C3=ADa=20Checa?= Date: Mon, 9 Oct 2017 13:12:44 +0200 Subject: [PATCH 03/48] Fixed already voted message in poll show --- app/views/polls/show.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/polls/show.html.erb b/app/views/polls/show.html.erb index 19daf5e35..d626f4f11 100644 --- a/app/views/polls/show.html.erb +++ b/app/views/polls/show.html.erb @@ -39,7 +39,7 @@ <% else %> - <% if current_user && !@poll.votable_by?(current_user) %> + <% if current_user && @poll.votable_by?(current_user) %>
<%= t("polls.show.already_voted_in_web") %>
From 3fc3f9e88e76542b832e53aa3814a015d8ef9b99 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mar=C3=ADa=20Checa?= Date: Mon, 9 Oct 2017 17:42:13 +0200 Subject: [PATCH 04/48] Fixed condition --- app/views/polls/show.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/polls/show.html.erb b/app/views/polls/show.html.erb index d626f4f11..c9796b836 100644 --- a/app/views/polls/show.html.erb +++ b/app/views/polls/show.html.erb @@ -39,7 +39,7 @@ <% else %> - <% if current_user && @poll.votable_by?(current_user) %> + <% unless current_user && @poll.votable_by?(current_user) %>
<%= t("polls.show.already_voted_in_web") %>
From 54068ce7cbdbebcb4bb148d2049ed152cb96500f Mon Sep 17 00:00:00 2001 From: iagirre Date: Fri, 13 Oct 2017 14:35:14 +0200 Subject: [PATCH 05/48] When answer 2 more info expand is clicked, it expands on top of the first one, not below. Same if the expand is clicked for the first answer --- app/assets/javascripts/polls.js.coffee | 16 ++++++++++++++++ app/views/polls/show.html.erb | 3 +-- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/app/assets/javascripts/polls.js.coffee b/app/assets/javascripts/polls.js.coffee index 5cf792ce2..ac2c759ba 100644 --- a/app/assets/javascripts/polls.js.coffee +++ b/app/assets/javascripts/polls.js.coffee @@ -26,3 +26,19 @@ App.Polls = token_message.html(token_message.html() + "
" + @token + ""); token_message.show() false + + $(".zoom-link").on "click", (event) -> + element = event.target + answer = $(element).closest('div.answer') + + if $(answer).hasClass('medium-6') + $(answer).removeClass("medium-6"); + $(answer).addClass("answer-divider"); + unless $(answer).hasClass('first') + $(answer).insertBefore($(answer).prev('div.answer')); + else + $(answer).addClass("medium-6"); + $(answer).removeClass("answer-divider"); + unless $(answer).hasClass('first') + $(answer).insertAfter($(answer).next('div.answer')); + diff --git a/app/views/polls/show.html.erb b/app/views/polls/show.html.erb index d9d871249..f66973acd 100644 --- a/app/views/polls/show.html.erb +++ b/app/views/polls/show.html.erb @@ -80,8 +80,7 @@
<% @poll.questions.map(&:question_answers).flatten.each do |answer| %> -
+
<% if answer.description.present? %>

<%= answer.title %>

From 2c6c320fa1c3684f9e82535ed8253b2637710171 Mon Sep 17 00:00:00 2001 From: iagirre Date: Fri, 13 Oct 2017 14:35:14 +0200 Subject: [PATCH 06/48] When answer 2 more info expand is clicked, it expands on top of the first one, not below. Same if the expand is clicked for the first answer --- app/assets/javascripts/polls.js.coffee | 16 ++++++++++++++++ app/views/polls/show.html.erb | 3 +-- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/app/assets/javascripts/polls.js.coffee b/app/assets/javascripts/polls.js.coffee index 5cf792ce2..ac2c759ba 100644 --- a/app/assets/javascripts/polls.js.coffee +++ b/app/assets/javascripts/polls.js.coffee @@ -26,3 +26,19 @@ App.Polls = token_message.html(token_message.html() + "
" + @token + ""); token_message.show() false + + $(".zoom-link").on "click", (event) -> + element = event.target + answer = $(element).closest('div.answer') + + if $(answer).hasClass('medium-6') + $(answer).removeClass("medium-6"); + $(answer).addClass("answer-divider"); + unless $(answer).hasClass('first') + $(answer).insertBefore($(answer).prev('div.answer')); + else + $(answer).addClass("medium-6"); + $(answer).removeClass("answer-divider"); + unless $(answer).hasClass('first') + $(answer).insertAfter($(answer).next('div.answer')); + diff --git a/app/views/polls/show.html.erb b/app/views/polls/show.html.erb index 0a56ba237..4489cd226 100644 --- a/app/views/polls/show.html.erb +++ b/app/views/polls/show.html.erb @@ -80,8 +80,7 @@
<% @poll_questions_answers.each do |answer| %> -
+
<% if answer.description.present? %>

<%= answer.title %>

From 540e12a3ac690c919f04a616fb7ad0f3f8785c38 Mon Sep 17 00:00:00 2001 From: Bertocq Date: Fri, 13 Oct 2017 16:47:47 +0200 Subject: [PATCH 07/48] Add RECOUNT_DURATION Poll constant for recount period duration --- app/helpers/shifts_helper.rb | 5 ++++- app/models/poll.rb | 3 +++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/app/helpers/shifts_helper.rb b/app/helpers/shifts_helper.rb index dc9f97a91..7c2d5c1b3 100644 --- a/app/helpers/shifts_helper.rb +++ b/app/helpers/shifts_helper.rb @@ -5,7 +5,10 @@ module ShiftsHelper end def shift_recount_scrutiny_dates(polls) - date_options(polls.map(&:ends_at).map(&:to_date).sort.inject([]) { |total, date| total << (date..date + 1.week).to_a }.flatten.uniq) + dates = polls.map(&:ends_at).map(&:to_date).sort.inject([]) do |total, date| + total << (date..date + Poll::RECOUNT_DURATION).to_a + end + date_options(dates.flatten.uniq) end def date_options(dates) diff --git a/app/models/poll.rb b/app/models/poll.rb index 8675ce49a..c572a4765 100644 --- a/app/models/poll.rb +++ b/app/models/poll.rb @@ -2,6 +2,9 @@ class Poll < ActiveRecord::Base include Imageable acts_as_paranoid column: :hidden_at include ActsAsParanoidAliases + + RECOUNT_DURATION = 1.week + has_many :booth_assignments, class_name: "Poll::BoothAssignment" has_many :booths, through: :booth_assignments has_many :partial_results, through: :booth_assignments From ca2d9a1d688ac24656d1be57eb01a1992b0489ae Mon Sep 17 00:00:00 2001 From: Bertocq Date: Fri, 13 Oct 2017 16:48:25 +0200 Subject: [PATCH 08/48] Add recounting Poll scope with trait and spec --- app/models/poll.rb | 1 + spec/factories.rb | 5 +++++ spec/models/poll/poll_spec.rb | 16 ++++++++++++++++ 3 files changed, 22 insertions(+) diff --git a/app/models/poll.rb b/app/models/poll.rb index c572a4765..41d4a9ab9 100644 --- a/app/models/poll.rb +++ b/app/models/poll.rb @@ -25,6 +25,7 @@ class Poll < ActiveRecord::Base scope :current, -> { where('starts_at <= ? and ? <= ends_at', Date.current.beginning_of_day, Date.current.beginning_of_day) } scope :incoming, -> { where('? < starts_at', Date.current.beginning_of_day) } scope :expired, -> { where('ends_at < ?', Date.current.beginning_of_day) } + scope :recounting, -> { Poll.where(ends_at: (Date.current.beginning_of_day - RECOUNT_DURATION)..Date.current.beginning_of_day) } scope :published, -> { where('published = ?', true) } scope :by_geozone_id, ->(geozone_id) { where(geozones: {id: geozone_id}.joins(:geozones)) } diff --git a/spec/factories.rb b/spec/factories.rb index 69aa92c62..b1c5ff329 100644 --- a/spec/factories.rb +++ b/spec/factories.rb @@ -489,6 +489,11 @@ FactoryGirl.define do ends_at { 15.days.ago } end + trait :recounting do + starts_at { 1.month.ago } + ends_at { Date.current } + end + trait :published do published true end diff --git a/spec/models/poll/poll_spec.rb b/spec/models/poll/poll_spec.rb index 5083d7439..dba964928 100644 --- a/spec/models/poll/poll_spec.rb +++ b/spec/models/poll/poll_spec.rb @@ -76,6 +76,22 @@ describe :poll do end end + describe "#recounting" do + it "returns polls in recount & scrutiny phase" do + current = create(:poll, :current) + incoming = create(:poll, :incoming) + expired = create(:poll, :expired) + recounting = create(:poll, :recounting) + + recounting_polls = Poll.recounting + + expect(recounting_polls).to_not include(current) + expect(recounting_polls).to_not include(incoming) + expect(recounting_polls).to_not include(expired) + expect(recounting_polls).to include(recounting) + end + end + describe "answerable_by" do let(:geozone) {create(:geozone) } From 9146d68c5342fc358cf52d3bd7bcf8b2345b35fe Mon Sep 17 00:00:00 2001 From: Bertocq Date: Fri, 13 Oct 2017 16:53:03 +0200 Subject: [PATCH 09/48] Add current_or_recounting_or_incoming method to Poll model --- app/models/poll.rb | 4 ++++ spec/models/poll/poll_spec.rb | 16 ++++++++++++++++ 2 files changed, 20 insertions(+) diff --git a/app/models/poll.rb b/app/models/poll.rb index 41d4a9ab9..5c65b688f 100644 --- a/app/models/poll.rb +++ b/app/models/poll.rb @@ -51,6 +51,10 @@ class Poll < ActiveRecord::Base current + incoming end + def self.current_or_recounting_or_incoming + current + recounting + incoming + end + def answerable_by?(user) user.present? && user.level_two_or_three_verified? && diff --git a/spec/models/poll/poll_spec.rb b/spec/models/poll/poll_spec.rb index dba964928..bfb5881f2 100644 --- a/spec/models/poll/poll_spec.rb +++ b/spec/models/poll/poll_spec.rb @@ -92,6 +92,22 @@ describe :poll do end end + describe "#current_or_recounting_or_incoming" do + it "returns current or recounting or incoming polls" do + current = create(:poll, :current) + incoming = create(:poll, :incoming) + expired = create(:poll, :expired) + recounting = create(:poll, :recounting) + + current_or_recounting_or_incoming = Poll.current_or_recounting_or_incoming + + expect(current_or_recounting_or_incoming).to include(current) + expect(current_or_recounting_or_incoming).to include(recounting) + expect(current_or_recounting_or_incoming).to include(incoming) + expect(current_or_recounting_or_incoming).to_not include(expired) + end + end + describe "answerable_by" do let(:geozone) {create(:geozone) } From 79c8c2f826dc53eb4ca1219c65d8efc4f36f9c57 Mon Sep 17 00:00:00 2001 From: Bertocq Date: Fri, 13 Oct 2017 16:55:40 +0200 Subject: [PATCH 10/48] Add scope on shift creation date ranges to current/recounting/incoming polls, plus cover with test --- app/views/admin/poll/shifts/_form.html.erb | 4 ++-- spec/features/admin/poll/shifts_spec.rb | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/app/views/admin/poll/shifts/_form.html.erb b/app/views/admin/poll/shifts/_form.html.erb index 1a13edf45..4004a949b 100644 --- a/app/views/admin/poll/shifts/_form.html.erb +++ b/app/views/admin/poll/shifts/_form.html.erb @@ -24,12 +24,12 @@
<%= select 'shift[date]', 'vote_collection_date', - options_for_select(shift_vote_collection_dates(@booth.polls)), + options_for_select(shift_vote_collection_dates(@booth.polls.current_or_incoming)), { prompt: t("admin.poll_shifts.new.select_date"), label: false }, class: 'js-shift-vote-collection-dates' %> <%= select 'shift[date]', 'recount_scrutiny_date', - options_for_select(shift_recount_scrutiny_dates(@booth.polls)), + options_for_select(shift_recount_scrutiny_dates(@booth.polls.current_or_recounting_or_incoming)), { prompt: t("admin.poll_shifts.new.select_date"), label: false }, class: 'js-shift-recount-scrutiny-dates', diff --git a/spec/features/admin/poll/shifts_spec.rb b/spec/features/admin/poll/shifts_spec.rb index 2ac290216..edefd0844 100644 --- a/spec/features/admin/poll/shifts_spec.rb +++ b/spec/features/admin/poll/shifts_spec.rb @@ -35,7 +35,8 @@ feature 'Admin shifts' do create(:poll, :incoming) poll = create(:poll, :current) booth = create(:poll_booth) - assignment = create(:poll_booth_assignment, poll: poll, booth: booth) + create(:poll_booth_assignment, poll: poll, booth: booth) + create(:poll_booth_assignment, poll: create(:poll, :expired), booth: booth) officer = create(:poll_officer) vote_collection_dates = (poll.starts_at.to_date..poll.ends_at.to_date).to_a.map { |date| I18n.l(date, format: :long) } recount_scrutiny_dates = (poll.ends_at.to_date..poll.ends_at.to_date + 1.week).to_a.map { |date| I18n.l(date, format: :long) } From 16f499d5fd732578bc5fd138b97659da9d7c5eb7 Mon Sep 17 00:00:00 2001 From: Bertocq Date: Fri, 13 Oct 2017 17:19:11 +0200 Subject: [PATCH 11/48] Force shift dates to start on current date at minimun --- app/helpers/shifts_helper.rb | 6 ++++-- spec/features/admin/poll/shifts_spec.rb | 6 +++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/app/helpers/shifts_helper.rb b/app/helpers/shifts_helper.rb index 7c2d5c1b3..5c99bad66 100644 --- a/app/helpers/shifts_helper.rb +++ b/app/helpers/shifts_helper.rb @@ -6,7 +6,8 @@ module ShiftsHelper def shift_recount_scrutiny_dates(polls) dates = polls.map(&:ends_at).map(&:to_date).sort.inject([]) do |total, date| - total << (date..date + Poll::RECOUNT_DURATION).to_a + initial_date = date < Date.current ? Date.current : date + total << (initial_date..date + Poll::RECOUNT_DURATION).to_a end date_options(dates.flatten.uniq) end @@ -16,7 +17,8 @@ module ShiftsHelper end def start_date(polls) - polls.map(&:starts_at).min.to_date + start_date = polls.map(&:starts_at).min.to_date + start_date < Date.current ? Date.current : start_date end def end_date(polls) diff --git a/spec/features/admin/poll/shifts_spec.rb b/spec/features/admin/poll/shifts_spec.rb index edefd0844..7512d8b6d 100644 --- a/spec/features/admin/poll/shifts_spec.rb +++ b/spec/features/admin/poll/shifts_spec.rb @@ -38,7 +38,7 @@ feature 'Admin shifts' do create(:poll_booth_assignment, poll: poll, booth: booth) create(:poll_booth_assignment, poll: create(:poll, :expired), booth: booth) officer = create(:poll_officer) - vote_collection_dates = (poll.starts_at.to_date..poll.ends_at.to_date).to_a.map { |date| I18n.l(date, format: :long) } + vote_collection_dates = (Date.current..poll.ends_at.to_date).to_a.map { |date| I18n.l(date, format: :long) } recount_scrutiny_dates = (poll.ends_at.to_date..poll.ends_at.to_date + 1.week).to_a.map { |date| I18n.l(date, format: :long) } visit available_admin_booths_path @@ -53,14 +53,14 @@ feature 'Admin shifts' do expect(page).to have_select('shift_date_vote_collection_date', options: ["Select day", *vote_collection_dates]) expect(page).not_to have_select('shift_date_recount_scrutiny_date') - select I18n.l(poll.starts_at.to_date, format: :long), from: 'shift_date_vote_collection_date' + select I18n.l(Date.current, format: :long), from: 'shift_date_vote_collection_date' click_button "Add shift" expect(page).to have_content "Shift added" within("#shifts") do expect(page).to have_css(".shift", count: 1) - expect(page).to have_content(I18n.l(poll.starts_at.to_date, format: :long)) + expect(page).to have_content(I18n.l(Date.current, format: :long)) expect(page).to have_content("Collect Votes") expect(page).to have_content(officer.name) end From bf5021c6a506a3e193b25634b447b7c3bd1239ec Mon Sep 17 00:00:00 2001 From: decabeza Date: Fri, 13 Oct 2017 18:11:41 +0200 Subject: [PATCH 12/48] changes back link to available booths when manage shifts --- app/views/admin/poll/shifts/new.html.erb | 2 +- spec/features/admin/poll/booths_spec.rb | 14 ++++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/app/views/admin/poll/shifts/new.html.erb b/app/views/admin/poll/shifts/new.html.erb index b975c40a9..4e0665ea2 100644 --- a/app/views/admin/poll/shifts/new.html.erb +++ b/app/views/admin/poll/shifts/new.html.erb @@ -1,4 +1,4 @@ -<%= back_link_to admin_booths_path %> +<%= back_link_to available_admin_booths_path %>

<%= @booth.name %>

diff --git a/spec/features/admin/poll/booths_spec.rb b/spec/features/admin/poll/booths_spec.rb index 4eeb81cb6..1aa487b26 100644 --- a/spec/features/admin/poll/booths_spec.rb +++ b/spec/features/admin/poll/booths_spec.rb @@ -113,4 +113,18 @@ feature 'Admin booths' do end end + scenario "Back link go back to available list when manage shifts" do + poll = create(:poll, :current) + booth = create(:poll_booth) + assignment = create(:poll_booth_assignment, poll: poll, booth: booth) + + visit available_admin_booths_path + + within("#booth_#{booth.id}") do + click_link "Manage shifts" + end + + click_link "Go back" + expect(current_path).to eq(available_admin_booths_path) + end end From f2d99d6747027f3c12ff860ea0d1c82ea8f671eb Mon Sep 17 00:00:00 2001 From: rgarcia Date: Fri, 13 Oct 2017 18:39:13 +0200 Subject: [PATCH 13/48] searches for officers assigned to a poll --- .../poll/officer_assignments_controller.rb | 4 +- .../poll/officer_assignments/index.html.erb | 2 +- .../admin/poll/officer_assignments_spec.rb | 68 +++++++++++++++++++ 3 files changed, 72 insertions(+), 2 deletions(-) create mode 100644 spec/features/admin/poll/officer_assignments_spec.rb diff --git a/app/controllers/admin/poll/officer_assignments_controller.rb b/app/controllers/admin/poll/officer_assignments_controller.rb index fd62df8b3..7532362a7 100644 --- a/app/controllers/admin/poll/officer_assignments_controller.rb +++ b/app/controllers/admin/poll/officer_assignments_controller.rb @@ -25,7 +25,9 @@ class Admin::Poll::OfficerAssignmentsController < Admin::Poll::BaseController def search_officers load_search - @officers = User.joins(:poll_officer).search(@search).order(username: :asc) + + poll_officers = User.where(id: @poll.officers.pluck(:user_id)) + @officers = poll_officers.search(@search).order(username: :asc) respond_to do |format| format.js diff --git a/app/views/admin/poll/officer_assignments/index.html.erb b/app/views/admin/poll/officer_assignments/index.html.erb index f27f6b2ae..04e296980 100644 --- a/app/views/admin/poll/officer_assignments/index.html.erb +++ b/app/views/admin/poll/officer_assignments/index.html.erb @@ -11,7 +11,7 @@ <%= t("admin.poll_officer_assignments.index.no_officers") %>
<% else %> - +
diff --git a/spec/features/admin/poll/officer_assignments_spec.rb b/spec/features/admin/poll/officer_assignments_spec.rb new file mode 100644 index 000000000..20be138b9 --- /dev/null +++ b/spec/features/admin/poll/officer_assignments_spec.rb @@ -0,0 +1,68 @@ +require 'rails_helper' + +feature 'Officer Assignments' do + + background do + admin = create(:administrator) + login_as(admin.user) + end + + scenario "Index" do + poll = create(:poll) + booth = create(:poll_booth) + + officer1 = create(:poll_officer) + officer2 = create(:poll_officer) + officer3 = create(:poll_officer) + + booth_assignment = create(:poll_booth_assignment, poll: poll, booth: booth) + officer_assignment = create(:poll_officer_assignment, booth_assignment: booth_assignment, officer: officer1) + + booth_assignment_2 = create(:poll_booth_assignment, poll: poll) + officer_assignment_2 = create(:poll_officer_assignment, booth_assignment: booth_assignment_2, officer: officer2) + + visit admin_poll_path(poll) + + click_link 'Officers (2)' + + within('#officer_assignments') do + expect(page).to have_content officer1.name + expect(page).to have_content officer2.name + expect(page).to_not have_content officer3.name + end + end + + scenario "Search", :js do + poll = create(:poll) + booth = create(:poll_booth) + + user1 = create(:user, username: "John Snow") + user2 = create(:user, username: "John Silver") + user3 = create(:user, username: "John Edwards") + + officer1 = create(:poll_officer, user: user1) + officer2 = create(:poll_officer, user: user2) + officer3 = create(:poll_officer, user: user3) + + booth_assignment = create(:poll_booth_assignment, poll: poll, booth: booth) + officer_assignment = create(:poll_officer_assignment, booth_assignment: booth_assignment, officer: officer1) + + booth_assignment_2 = create(:poll_booth_assignment, poll: poll) + officer_assignment_2 = create(:poll_officer_assignment, booth_assignment: booth_assignment_2, officer: officer2) + + visit admin_poll_path(poll) + + click_link 'Officers (2)' + + fill_in "search-officers", with: "John" + click_button "Search" + + within('#search-officers-results') do + expect(page).to have_content officer1.name + expect(page).to have_content officer2.name + expect(page).to_not have_content officer3.name + end + end + + +end \ No newline at end of file From 96bd8cec003d8b8e96b6123d1205007b8df64cbd Mon Sep 17 00:00:00 2001 From: decabeza Date: Fri, 13 Oct 2017 18:54:26 +0200 Subject: [PATCH 14/48] fixes styles on admin legislation processes subnav --- .../legislation/processes/_subnav.html.erb | 38 ++++++++++++++----- 1 file changed, 29 insertions(+), 9 deletions(-) diff --git a/app/views/admin/legislation/processes/_subnav.html.erb b/app/views/admin/legislation/processes/_subnav.html.erb index 97640c4f4..f8e9bba56 100644 --- a/app/views/admin/legislation/processes/_subnav.html.erb +++ b/app/views/admin/legislation/processes/_subnav.html.erb @@ -1,11 +1,31 @@ From 2e6072ef19c372c880a439f9e1c2bb109308f6a0 Mon Sep 17 00:00:00 2001 From: decabeza Date: Fri, 13 Oct 2017 18:54:48 +0200 Subject: [PATCH 15/48] adds missing icons on admin menu --- app/assets/fonts/icons.eot | Bin 12528 -> 14024 bytes app/assets/fonts/icons.svg | 5 +++++ app/assets/fonts/icons.ttf | Bin 12372 -> 13868 bytes app/assets/fonts/icons.woff | Bin 9352 -> 10236 bytes app/assets/stylesheets/icons.scss | 20 ++++++++++++++++++++ app/views/admin/_menu.html.erb | 6 ++++-- 6 files changed, 29 insertions(+), 2 deletions(-) diff --git a/app/assets/fonts/icons.eot b/app/assets/fonts/icons.eot index 5564a5c62a83883cf5911bcc08931452d8ca3931..53439b28145908023bc4579be8476a0643412c40 100644 GIT binary patch delta 2085 zcmZuyO>7%Q6n?Wmv+LbBcH-T2+9vg1;?OvD)7ai^o1dmtC~_r;#7`k@C1f0@L9v}Q zN!w6W7=c7{s06J~sN$y*l@JmLs3-^iE`UN*E=6!jT5*X47gP>Z;^OdT>^LdH(aya0 zy>H&k`}Sq_es;M?mu-Mv`wF$C_0sjpDbm67Rb5EWr07!2F#M`Fw z*$H>-;xxwA@Uf>5kow4PxYj_wbE>$oSk@oV5CWedaJev(%NE5K4q^fo{nv}x#aXxl zpJRMK`oU7Rn1A)Bmq!8ieSp}R*_ru;Z$3&c0VLb;P%A)?h0o;m()#nB!M{Nl5CHg< zzWv4Kys?VRE{>}pK#~*KA`T@4*jU|I6}ot;TC6ro9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c5_pai_$kU;DCGr?$IRF8SjIhmEh=h)rg~dF9WDiF zX_IByv@_Wx|;mP|!iR_hm3S+1f$pvB!vV+CHA%`*h$6omxK0g{)PXnMI2^HgiKdZ-&P5Ft}xm5eK?-8=ICM5cB97sG_dpQv%`)ltd&MIVx43iNu zO7>n4_5VRkC6_JaP8G6?<#`1^=80l6X-+X delta 606 zcmZ3Jb0wjkfsuiMftR6yftew|%`L>Y!r*)v1A~DDP*ld<#np`=i-8TumjLn={Dbw4 z{7=Q~XJBBA0P@3D3OgB+-kmzbL>WZ8R|fk6kTpE0i>zqrJN=P6K1w*}~^ zF0ki-9{k&Wq%EG`<|_j?6HtzU;p)$6!4TSITJZmOK&3)p2@VE`JkTtl7)XU46T|;^ z|KBkQfsF!*zyJ$a#Fk+b1NUSn#&AZ1$+H+|djeewQ~<&a1PmA)84|&4b}*lDav#&o$@<28+zjRxmR8m_AkobZ%r184{8Ss11rNED4Ugmn_(A}%?1>|H2IsMqPi1<7RVheoIqD_F-(B6SsBC_ z7D3r;K=EUfFB%C?4m9$ZJljZn@^Pck$+E@@jJA{QjH@;uGJeN6`I)J_x((297NBb& UK?U*}!x`H}=Rq_gT&D#C04sucU;qFB diff --git a/app/assets/fonts/icons.woff b/app/assets/fonts/icons.woff index 7f8f3c95e81bff9ad949c7b630da7ecfa6e4e196..0ac7f8f19cfa02f884464c3f30b0cf2f98865ef2 100644 GIT binary patch literal 10236 zcmZX4WlSB;6YT|xYq8>5+}(@2+okwLFYfN{P~6?6xVsg1E$*(x9Ui}bUf!3t$;sxN z+04vN_QURGToolG6xGxe0RXC303zUX@W}xn{+s{*Au1t30suh30RZHC0077DI@FXI z2?;fM0O0%C=W4u95V*-~{E!qAmjD1LKGy*VKS2Vp27FOeWn%r*s6V;%CqT-hdhJHm z26msC(TPYvypuYJa_518-~v$J*lj7jxh&j0Bo z04M;2TjqeLdn&;|61YeS2!l=+sBBojWrL!fdI=RI&;;>|>9J!e(8~|mtw(D5#HLZp z!r56}Lw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oJlg951osrQp5qZ|^meaY>q8P~p778l4Gd5EuTG^GFwXtqGJ^2MU#HPVm1fHnz zKuo9wvxc#xUs6$I=5*l8JG)n{+ZXRc{|<_5fN?rK>*pu}^ zkiiH3Hy>Sl0!H{I=@5&UaXVJ4HYP8uD^e|a&;CRqUwWQ)d__H+mR2Ten$W9b3nF{%&=UWc^*GBwkq zTz`TvaQJVNyox_?hTkkJj;4Z$L>5|4h7=m2dR1#gkRytU2CM4a1Gu*D zqLX#%%k(tvim`fy?0v2Btm$l5sHm#yCN|RJYR#Wt3u=>t-Edwda>C`>mq{{Z~)@dN+> diff --git a/app/assets/stylesheets/icons.scss b/app/assets/stylesheets/icons.scss index 96eb10a0d..dc59d1118 100644 --- a/app/assets/stylesheets/icons.scss +++ b/app/assets/stylesheets/icons.scss @@ -268,3 +268,23 @@ .icon-search-minus::before { content: '\35'; } + +.icon-calculator::before { + content: "\36"; +} + +.icon-map-marker::before { + content: "\37"; +} + +.icon-user-plus::before { + content: "\38"; +} + +.icon-file-text-o::before { + content: "\39"; +} + +.icon-file-text::before { + content: "\21"; +} diff --git a/app/views/admin/_menu.html.erb b/app/views/admin/_menu.html.erb index 21dc7cffb..f2af2c116 100644 --- a/app/views/admin/_menu.html.erb +++ b/app/views/admin/_menu.html.erb @@ -136,7 +136,7 @@ <% if feature?(:legislation) %>
  • "> <%= link_to admin_legislation_processes_path do %> - + <%= t("admin.menu.legislation") %> <% end %>
  • @@ -156,7 +156,7 @@
  • - + <%= t("admin.menu.title_site_customization") %>
      "> <%= link_to admin_geozones_path do %> + <%= t('admin.menu.geozones') %> <% end %> @@ -185,6 +186,7 @@ <% if feature?(:signature_sheets) %>
    • "> <%= link_to admin_signature_sheets_path do %> + <%= t("admin.menu.signature_sheets") %> <% end %>
    • From 127ae893fcefe2df55253209c8d28c23575115a2 Mon Sep 17 00:00:00 2001 From: decabeza Date: Fri, 13 Oct 2017 18:55:14 +0200 Subject: [PATCH 16/48] replaces polls and budgets help icons to add consistency --- app/assets/images/help/help_icon_budgets.png | Bin 2273 -> 1456 bytes app/assets/images/help/help_icon_polls.png | Bin 2051 -> 1683 bytes 2 files changed, 0 insertions(+), 0 deletions(-) diff --git a/app/assets/images/help/help_icon_budgets.png b/app/assets/images/help/help_icon_budgets.png index fc5e3022fc45e78cb6742678c93cc5e9ec580faf..f986a939c54fb097dcb50d96900b9f61a8cb3117 100644 GIT binary patch delta 633 zcmaDTxPg0uCu7b=F99Y6S4UG5V>1g2M+;L&Lqk_{CsQXECkqR6OBX{YCrb;1$yH1; zFh%A#6>VcmW4AOma5k_sot(%dJ=uv_NT4FOKrbaT#R@8JG#PD5 z5}WzvTE^U)+WYW!$KDoU4}}vt8N31oGMn=!+iWg9EO6#9tIVZ(gM7xUC)NR)b58d6 zq%*rcm|-E9%b2w>H$&z8Rjq{H3h!OU0_Qf};K~eiX>nz`@?yEojd$8d-c3Byu=RYj zjX-?>t6*otg!cA(5}Pl)QCV=+nep05%Lgh8;*2wPE~~%rQsqvo_75?(9&PQlFL}2y zebUqklMQI^U-DBnn~`zteH}&Frin9OnU-;~?y=xX5Zfnk@m%tJc5XvmUAO0QZ(DYR z9GG~_Y05Th4=>h;(!Xa?84cs!FZN*QyY@o-;nk&2D$O^nELC)LVcPt_>67^k)q9h_ zt)1bwdd5?x$^HV*P2Oi)&Rsl1vf`RgU9PCYulF}CB`@hKhn|0)Ad;0Elbd8I!jH zWq&X-FgRgmG-WL?W-&D_G+{9`Ejc+gV=ZGgGc;v3IbmWmG-e_ob97Q=W;$eVV|8t1 zZgfdRJtARbZ(?OSWN%|>WIAwYZ**^SXm4;jWjHo6H#aynEn{UeVl6Q-H(@O~WjAFl zWiv5iF*9LdWHnB5JTG!&W;#S=bCZPwHGgb6xJm#31ocToK~#9!>{nYzV^KJ3jSBws#RxwCTDJ3YzsT!ybrNu&P8ALjTq0)Y|U;Uo`^`l_vS1r*-oJ?n| zZRu1$1|&>l(UBlJX4E29)cA^wj zVSg`jh#~chBU@*uM5)xQpVI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^4GczB$ySuB&IDw&k{H*Bf>-)U2vhoV^%85YP6apbZ!(`;);^N{vq&al^G!K(2y8C%bl2*XxrS}3?ndnG!r0tH$OlB zcx-I!>(bKFGXiQe0P+eSd4GTZCw#O9gF$Le;W=A>hlhuEnwy(HB519HgM&;cB-~|6 zF!NQI%{p9z?CtHrn&dKuM1=X0i>uPb#U&T_zMBPLOf*-(v-lv@}QZg6n01i?7tmYNs9`1trETPe3BBoyA++1UqzRe(P@I3G~7UdOO9 z)q!jrn5_ajL_M1lhUlY^SPO!6(Pz?OaUVE3I)e1{bkJxtY$)yQ>{#tJ4KTS} z4rOI!keHZAiTFoeiG>c6*9wIKl9H03s;UZqlu9L2h>2v@II%`kGd4CBYHDgAK0co5 z;tPlPlJ*P5#l@i2YS}m@MVXnIj2WVpuR@GNiJdJdD1ge!O7QUTfYQ=Z#sXh*i!Uo1 zLR(Q$0omEvu)Mqsg@uLeI}RGg#(8Y%A!e|Duz9c3=^!U32e6SrT3Q+dZ*1$912_+V zgR846bar+^YHBKAZ)ddD*49EyObpA5-Q8WbQhbw>li7tPJUkrg>+2ySBZFN+NC&aP zm&6veIhjlbYinzaR#KRspU=E(XlQ_@rY4r%DJdxs7Z(ROirM?d#zwlNfK)2Iw0cCQ zFC!x(e;ywn-#3jheW&Cik3&O4L9JGQv-P5Mb#*~`c{z-Zjxw)>m_@+fdU|@ESal(x zgG3{-F*Gy;Sy@>S6%_^1(b0f_p`)V%dV70W?+`M6r5n*jp}s(d+S=NnwYBwko5lN} z)eVcYwY5@$QhZI@t+m~f<7pzCtv%j~a}q%So}Qkoc!9Xf*SD`jD0KM0LN5qAAR!^) zCD!nJWa1vi)o_irMRY~OtJ$PVrFtt^hX34u!~Xz&2`~V?NdL{ Date: Fri, 13 Oct 2017 18:58:58 +0200 Subject: [PATCH 17/48] removes unnecessary helper for welcome page --- app/helpers/welcome_helper.rb | 4 ---- app/views/welcome/index.html.erb | 5 ++--- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/app/helpers/welcome_helper.rb b/app/helpers/welcome_helper.rb index 9f8c8c13e..fe1c5f450 100644 --- a/app/helpers/welcome_helper.rb +++ b/app/helpers/welcome_helper.rb @@ -55,8 +55,4 @@ module WelcomeHelper end end - def highlight_background - (feature?("user.recommendations") && current_user) ? "highlight" : "" - end - end diff --git a/app/views/welcome/index.html.erb b/app/views/welcome/index.html.erb index 0ea0f748d..e27f4436e 100644 --- a/app/views/welcome/index.html.erb +++ b/app/views/welcome/index.html.erb @@ -22,12 +22,12 @@ <%= render "recommended", recommended_debates: @recommended_debates, recommended_proposals: @recommended_proposals %> +
      <% end %> <% cache [locale_and_user_status, @featured_debates, @featured_proposals, 'featured'] do %>
      - -
      +

      <%= t("welcome.debates.title") %>

      @@ -47,6 +47,5 @@
      -
      <% end %> From ae74e1ba07ddc7bacfbc8bbd05a18d19e70229d6 Mon Sep 17 00:00:00 2001 From: decabeza Date: Fri, 13 Oct 2017 19:31:02 +0200 Subject: [PATCH 18/48] improves admin tags layout --- app/views/admin/tags/index.html.erb | 33 +++++++++++++++-------------- config/locales/en/admin.yml | 5 +++-- config/locales/es/admin.yml | 5 +++-- 3 files changed, 23 insertions(+), 20 deletions(-) diff --git a/app/views/admin/tags/index.html.erb b/app/views/admin/tags/index.html.erb index f22321f38..787fad46a 100644 --- a/app/views/admin/tags/index.html.erb +++ b/app/views/admin/tags/index.html.erb @@ -1,39 +1,40 @@

      <%= t("admin.tags.index.add_tag") %>

      <%= form_for(@tag, url: admin_tags_path, as: :tag) do |f| %> - -
      -
      - <%= f.label :name, t("admin.tags.name.placeholder") %> - <%= f.text_field :name, placeholder: t("admin.tags.name.placeholder"), label: false %> -
      - +
      + <%= f.label :name, t("admin.tags.name.placeholder") %> + <%= f.text_field :name, placeholder: t("admin.tags.name.placeholder"), label: false %>
      <%= f.submit(t("admin.tags.create"), class: "button success") %> - <% end %> -

      <%= t("admin.tags.index.title") %>: <%= page_entries_info @tags %>

      +
      +

      <%= t("admin.tags.index.title") %>: <%= page_entries_info @tags %>

  • <%= t("admin.poll_officer_assignments.index.table_name") %> <%= t("admin.poll_officer_assignments.index.table_email") %>
    + + + + + <% @tags.each do |tag| %> - + <% end %> +
    <%= t("admin.tags.index.title") %><%= t("admin.actions.actions") %>
    + <%= form_for(tag, url: admin_tag_path(tag), as: :tag, - html: { id: "edit_tag_#{tag.id}", class: "text-right"}) do |f| %> + html: { id: "edit_tag_#{tag.id}"}) do |f| %> - - <%= tag.name %> - - - <%= link_to t("admin.tags.destroy"), admin_tag_path(tag), method: :delete, class: "button hollow alert on-hover" %> + <%= tag.name %> <% end %> + <%= link_to t("admin.tags.destroy"), admin_tag_path(tag), method: :delete, class: "button hollow alert" %> +
    <%= paginate @tags %> diff --git a/config/locales/en/admin.yml b/config/locales/en/admin.yml index dfe92305d..cf1f83a2a 100644 --- a/config/locales/en/admin.yml +++ b/config/locales/en/admin.yml @@ -901,11 +901,12 @@ en: total: Total proposals_with_notifications: Proposals with notifications tags: - create: Create Topic - destroy: Destroy Topic + create: Create topic + destroy: Destroy topic index: add_tag: Add a new proposal topic title: Proposal topics + topic: Topic name: placeholder: Type the name of the topic users: diff --git a/config/locales/es/admin.yml b/config/locales/es/admin.yml index 289546bab..a4a377854 100644 --- a/config/locales/es/admin.yml +++ b/config/locales/es/admin.yml @@ -903,11 +903,12 @@ es: total: Total proposals_with_notifications: Propuestas con notificaciones tags: - create: Crear Tema - destroy: Eliminar Tema + create: Crear tema + destroy: Eliminar tema index: add_tag: Añade un nuevo tema de propuesta title: Temas de propuesta + topic: Tema name: placeholder: Escribe el nombre del tema users: From d91388b2b3464c3c4b524607a48a0fd7245e82c3 Mon Sep 17 00:00:00 2001 From: decabeza Date: Fri, 13 Oct 2017 20:57:19 +0200 Subject: [PATCH 19/48] improves layout and unifies design of admin moderated content --- app/views/admin/comments/index.html.erb | 68 ++++++++++------- app/views/admin/debates/index.html.erb | 68 ++++++++++------- app/views/admin/hidden_users/index.html.erb | 62 ++++++++------- app/views/admin/proposals/index.html.erb | 84 ++++++++++++--------- config/locales/en/admin.yml | 8 ++ config/locales/es/admin.yml | 8 ++ 6 files changed, 182 insertions(+), 116 deletions(-) diff --git a/app/views/admin/comments/index.html.erb b/app/views/admin/comments/index.html.erb index 75493857c..e07487bcf 100644 --- a/app/views/admin/comments/index.html.erb +++ b/app/views/admin/comments/index.html.erb @@ -2,34 +2,46 @@ <%= render 'shared/filter_subnav', i18n_namespace: "admin.comments.index" %> -

    <%= page_entries_info @comments %>

    +<% if @comments.any? %> +

    <%= page_entries_info @comments %>

    - - <% @comments.each do |comment| %> - - - + + <% end %> + +
    - <%= text_with_links comment.body %>
    - <% if comment.commentable.hidden? %> - (<%= t("admin.comments.index.hidden_#{comment.commentable_type.downcase}") %>: <%= comment.commentable.title %>) - <% else %> - <%= link_to comment.commentable.title, comment.commentable %> - <% end %> -
    - <%= link_to t("admin.actions.restore"), - restore_admin_comment_path(comment, request.query_parameters), - method: :put, - data: { confirm: t("admin.actions.confirm") }, - class: "button hollow on-hover-block" %> - <% unless comment.confirmed_hide? %> - <%= link_to t("admin.actions.confirm_hide"), - confirm_hide_admin_comment_path(comment, request.query_parameters), + + + + + + + <% @comments.each do |comment| %> + + + - - <% end %> -
    <%= t("admin.shared.description") %><%= t("admin.shared.actions") %>
    + <%= text_with_links comment.body %>
    + <% if comment.commentable.hidden? %> + (<%= t("admin.comments.index.hidden_#{comment.commentable_type.downcase}") %>: <%= comment.commentable.title %>) + <% else %> + <%= link_to comment.commentable.title, comment.commentable %> + <% end %> +
    + <%= link_to t("admin.actions.restore"), + restore_admin_comment_path(comment, request.query_parameters), method: :put, - class: "button hollow warning on-hover-block" %> - <% end %> -
    + data: { confirm: t("admin.actions.confirm") }, + class: "button hollow warning" %> + <% unless comment.confirmed_hide? %> + <%= link_to t("admin.actions.confirm_hide"), + confirm_hide_admin_comment_path(comment, request.query_parameters), + method: :put, + class: "button" %> + <% end %> +
    -<%= paginate @comments %> + <%= paginate @comments %> +<% else %> +
    + <%= t("admin.comments.index.no_hidden_comments") %> +
    +<% end %> diff --git a/app/views/admin/debates/index.html.erb b/app/views/admin/debates/index.html.erb index 987aa6e72..7715e1032 100644 --- a/app/views/admin/debates/index.html.erb +++ b/app/views/admin/debates/index.html.erb @@ -2,33 +2,47 @@ <%= render 'shared/filter_subnav', i18n_namespace: "admin.debates.index" %> -

    <%= page_entries_info @debates %>

    +<% if @debates.any? %> +

    <%= page_entries_info @debates %>

    - - <% @debates.each do |debate| %> - - - + + <% end %> + +
    - <%= debate.title %> -
    -
    - <%= debate.description %> -
    -
    - <%= link_to t("admin.actions.restore"), - restore_admin_debate_path(debate, request.query_parameters), - method: :put, - data: { confirm: t("admin.actions.confirm") }, - class: "button hollow on-hover" %> - <% unless debate.confirmed_hide? %> - <%= link_to t("admin.actions.confirm_hide"), - confirm_hide_admin_debate_path(debate, request.query_parameters), + + + + + + + + <% @debates.each do |debate| %> + + + + - - <% end %> -
    <%= t("admin.shared.title") %><%= t("admin.shared.description") %><%= t("admin.shared.actions") %>
    + <%= debate.title %> + +
    + <%= debate.description %> +
    +
    + <%= link_to t("admin.actions.restore"), + restore_admin_debate_path(debate, request.query_parameters), method: :put, - class: "button hollow warning on-hover" %> - <% end %> -
    + data: { confirm: t("admin.actions.confirm") }, + class: "button hollow warning" %> + <% unless debate.confirmed_hide? %> + <%= link_to t("admin.actions.confirm_hide"), + confirm_hide_admin_debate_path(debate, request.query_parameters), + method: :put, + class: "button" %> + <% end %> +
    -<%= paginate @debates %> + <%= paginate @debates %> +<% else %> +
    + <%= t("admin.debates.index.no_hidden_debates") %> +
    +<% end %> diff --git a/app/views/admin/hidden_users/index.html.erb b/app/views/admin/hidden_users/index.html.erb index 21bf016e4..6bcea253c 100644 --- a/app/views/admin/hidden_users/index.html.erb +++ b/app/views/admin/hidden_users/index.html.erb @@ -2,32 +2,42 @@ <%= render 'shared/filter_subnav', i18n_namespace: "admin.hidden_users.index" %> -

    <%= page_entries_info @users %>

    +<% if @users.any? %> +

    <%= page_entries_info @users %>

    - -<% @users.each do |user| %> - - +
    -

    <%= link_to user.name, admin_hidden_user_path(user) %>

    -
    + + + + + + <% @users.each do |user| %> + + - - + + + <% end %> + +
    <%= t("admin.hidden_users.index.user") %><%= t("admin.shared.actions") %>
    +

    <%= link_to user.name, admin_hidden_user_path(user) %>

    +
    - <%= link_to t("admin.actions.restore"), - restore_admin_hidden_user_path(user, request.query_parameters), - method: :put, - data: { confirm: t("admin.actions.confirm") }, - class: "button hollow on-hover" %> - <% unless user.confirmed_hide? %> - <%= link_to t("admin.actions.confirm_hide"), - confirm_hide_admin_hidden_user_path(user, request.query_parameters), - method: :put, - class: "button hollow warning on-hover" %> - <% end %> -
    + <%= link_to t("admin.actions.restore"), + restore_admin_hidden_user_path(user, request.query_parameters), + method: :put, + data: { confirm: t("admin.actions.confirm") }, + class: "button hollow warning" %> + <% unless user.confirmed_hide? %> + <%= link_to t("admin.actions.confirm_hide"), + confirm_hide_admin_hidden_user_path(user, request.query_parameters), + method: :put, + class: "button" %> + <% end %> +
    + + <%= paginate @users %> +<% else %> +
    + <%= t("admin.hidden_users.index.no_hidden_users") %> +
    <% end %> - - -<%= paginate @users %> - - diff --git a/app/views/admin/proposals/index.html.erb b/app/views/admin/proposals/index.html.erb index d929843b1..ba161ce77 100644 --- a/app/views/admin/proposals/index.html.erb +++ b/app/views/admin/proposals/index.html.erb @@ -2,41 +2,55 @@ <%= render 'shared/filter_subnav', i18n_namespace: "admin.proposals.index" %> -

    <%= page_entries_info @proposals %>

    +<% if @proposals.any? %> +

    <%= page_entries_info @proposals %>

    - - <% @proposals.each do |proposal| %> - - - + + <% end %> + +
    - <%= proposal.title %> -
    -
    -

    <%= proposal.summary %>

    - <%= proposal.description %> - <% if proposal.external_url.present? %> -

    <%= text_with_links proposal.external_url %>

    - <% end %> - <% if proposal.video_url.present? %> -

    <%= text_with_links proposal.video_url %>

    - <% end %> -

    <%= proposal.question %>

    -
    -
    - <%= link_to t("admin.actions.restore"), - restore_admin_proposal_path(proposal, request.query_parameters), - method: :put, - data: { confirm: t("admin.actions.confirm") }, - class: "button hollow on-hover-block" %> - <% unless proposal.confirmed_hide? %> - <%= link_to t("admin.actions.confirm_hide"), - confirm_hide_admin_proposal_path(proposal, request.query_parameters), + + + + + + + + <% @proposals.each do |proposal| %> + + + + - - <% end %> -
    <%= t("admin.shared.title") %><%= t("admin.shared.description") %><%= t("admin.shared.actions") %>
    + <%= proposal.title %> + +
    +

    <%= proposal.summary %>

    + <%= proposal.description %> + <% if proposal.external_url.present? %> +

    <%= text_with_links proposal.external_url %>

    + <% end %> + <% if proposal.video_url.present? %> +

    <%= text_with_links proposal.video_url %>

    + <% end %> +

    <%= proposal.question %>

    +
    +
    + <%= link_to t("admin.actions.restore"), + restore_admin_proposal_path(proposal, request.query_parameters), method: :put, - class: "button hollow warning on-hover-block" %> - <% end %> -
    + data: { confirm: t("admin.actions.confirm") }, + class: "button hollow warning" %> + <% unless proposal.confirmed_hide? %> + <%= link_to t("admin.actions.confirm_hide"), + confirm_hide_admin_proposal_path(proposal, request.query_parameters), + method: :put, + class: "button" %> + <% end %> +
    -<%= paginate @proposals %> + <%= paginate @proposals %> +<% else %> +
    + <%= t("admin.proposals.index.no_hidden_proposals") %> +
    +<% end %> diff --git a/config/locales/en/admin.yml b/config/locales/en/admin.yml index cf1f83a2a..87bbb6685 100644 --- a/config/locales/en/admin.yml +++ b/config/locales/en/admin.yml @@ -213,6 +213,7 @@ en: hidden_debate: Hidden debate hidden_proposal: Hidden proposal title: Hidden comments + no_hidden_comments: There is no hidden comments. dashboard: index: back: Go back to %{org} @@ -226,6 +227,7 @@ en: with_confirmed_hide: Confirmed without_confirmed_hide: Pending title: Hidden debates + no_hidden_debates: There is no hidden debates. hidden_users: index: filter: Filter @@ -234,6 +236,8 @@ en: with_confirmed_hide: Confirmed without_confirmed_hide: Pending title: Hidden users + user: User + no_hidden_users: There is no hidden users. show: email: 'Email:' hidden_at: 'Hidden at:' @@ -715,6 +719,7 @@ en: with_confirmed_hide: Confirmed without_confirmed_hide: Pending title: Hidden proposals + no_hidden_proposals: There is no hidden proposals. settings: flash: updated: Value updated @@ -757,6 +762,9 @@ en: placeholder: Search user by name or email search_results: "Search results" no_search_results: "No results found." + actions: Actions + title: Title + description: Description spending_proposals: index: geozone_filter_all: All zones diff --git a/config/locales/es/admin.yml b/config/locales/es/admin.yml index a4a377854..d1a24b314 100644 --- a/config/locales/es/admin.yml +++ b/config/locales/es/admin.yml @@ -213,6 +213,7 @@ es: hidden_debate: Debate oculto hidden_proposal: Propuesta oculta title: Comentarios ocultos + no_hidden_comments: No hay comentarios ocultos. dashboard: index: back: Volver a %{org} @@ -226,6 +227,7 @@ es: with_confirmed_hide: Confirmados without_confirmed_hide: Pendientes title: Debates ocultos + no_hidden_debates: No hay debates ocultos. hidden_users: index: filter: Filtro @@ -234,6 +236,8 @@ es: with_confirmed_hide: Confirmados without_confirmed_hide: Pendientes title: Usuarios bloqueados + user: Usuario + no_hidden_users: No hay uusarios bloqueados. show: email: 'Email:' hidden_at: 'Bloqueado:' @@ -717,6 +721,7 @@ es: with_confirmed_hide: Confirmadas without_confirmed_hide: Pendientes title: Propuestas ocultas + no_hidden_proposals: No hay propuestas ocultas. settings: flash: updated: Valor actualizado @@ -759,6 +764,9 @@ es: placeholder: Buscar usuario por nombre o email search_results: "Resultados de la búsqueda" no_search_results: "No se han encontrado resultados." + actions: Acciones + title: "Título" + description: "Descripción" spending_proposals: index: geozone_filter_all: Todos los ámbitos de actuación From b52abfb9221513ffdd1906640e24b867794f9784 Mon Sep 17 00:00:00 2001 From: decabeza Date: Fri, 13 Oct 2017 21:00:45 +0200 Subject: [PATCH 20/48] uses correct i18n key --- app/views/admin/tags/index.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/admin/tags/index.html.erb b/app/views/admin/tags/index.html.erb index 787fad46a..c60ddaa0f 100644 --- a/app/views/admin/tags/index.html.erb +++ b/app/views/admin/tags/index.html.erb @@ -14,7 +14,7 @@ - + From 1da787e2fff3bfbe7748a07b43a71fa83b96cd6d Mon Sep 17 00:00:00 2001 From: decabeza Date: Fri, 13 Oct 2017 21:01:23 +0200 Subject: [PATCH 21/48] fixes lint warnings using single quoted on icons.scss --- app/assets/stylesheets/icons.scss | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/app/assets/stylesheets/icons.scss b/app/assets/stylesheets/icons.scss index dc59d1118..b9f2735b4 100644 --- a/app/assets/stylesheets/icons.scss +++ b/app/assets/stylesheets/icons.scss @@ -270,21 +270,21 @@ } .icon-calculator::before { - content: "\36"; + content: '\36'; } .icon-map-marker::before { - content: "\37"; + content: '\37'; } .icon-user-plus::before { - content: "\38"; + content: '\38'; } .icon-file-text-o::before { - content: "\39"; + content: '\39'; } .icon-file-text::before { - content: "\21"; + content: '\21'; } From 99e609769507ffe46fee1ac2c6c6466aed9e0c51 Mon Sep 17 00:00:00 2001 From: decabeza Date: Fri, 13 Oct 2017 21:32:19 +0200 Subject: [PATCH 22/48] updates admin tags specs --- app/views/admin/tags/index.html.erb | 2 +- spec/features/admin/tags_spec.rb | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/app/views/admin/tags/index.html.erb b/app/views/admin/tags/index.html.erb index c60ddaa0f..55e51a8ac 100644 --- a/app/views/admin/tags/index.html.erb +++ b/app/views/admin/tags/index.html.erb @@ -29,7 +29,7 @@ <%= tag.name %> <% end %> - diff --git a/spec/features/admin/tags_spec.rb b/spec/features/admin/tags_spec.rb index dd9c38c6b..8ff205852 100644 --- a/spec/features/admin/tags_spec.rb +++ b/spec/features/admin/tags_spec.rb @@ -23,7 +23,7 @@ feature 'Admin tags' do within("form.new_tag") do fill_in "tag_name", with: 'important issues' - click_button 'Create Topic' + click_button 'Create topic' end visit admin_tags_path @@ -39,8 +39,8 @@ feature 'Admin tags' do expect(page).to have_content @tag1.name expect(page).to have_content tag2.name - within("#edit_tag_#{tag2.id}") do - click_link 'Destroy Topic' + within("#tag_#{tag2.id}") do + click_link 'Destroy topic' end visit admin_tags_path @@ -58,8 +58,8 @@ feature 'Admin tags' do expect(page).to have_content @tag1.name expect(page).to have_content tag2.name - within("#edit_tag_#{tag2.id}") do - click_link 'Destroy Topic' + within("#tag_#{tag2.id}") do + click_link 'Destroy topic' end visit admin_tags_path @@ -81,7 +81,7 @@ feature 'Admin tags' do within("form.new_tag") do fill_in "tag_name", with: "wow_category" - click_button 'Create Topic' + click_button 'Create topic' end expect(ActsAsTaggableOn::Tag.category.where(name: "wow_category")).to exist From 45f73aa1baff8e995ade7f58c7988f95f1e6b00e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mar=C3=ADa=20Checa?= Date: Mon, 16 Oct 2017 12:22:54 +0200 Subject: [PATCH 23/48] Excluded officer shift dates from each task date range --- app/helpers/shifts_helper.rb | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/app/helpers/shifts_helper.rb b/app/helpers/shifts_helper.rb index dc9f97a91..ec1b342c4 100644 --- a/app/helpers/shifts_helper.rb +++ b/app/helpers/shifts_helper.rb @@ -1,15 +1,15 @@ module ShiftsHelper def shift_vote_collection_dates(polls) - date_options((start_date(polls)..end_date(polls))) + date_options((start_date(polls)..end_date(polls)), 0) end def shift_recount_scrutiny_dates(polls) - date_options(polls.map(&:ends_at).map(&:to_date).sort.inject([]) { |total, date| total << (date..date + 1.week).to_a }.flatten.uniq) + date_options(polls.map(&:ends_at).map(&:to_date).sort.inject([]) { |total, date| total << (date..date + 1.week).to_a }.flatten.uniq, 1) end - def date_options(dates) - dates.map { |date| [l(date, format: :long), l(date)] } + def date_options(dates, task_id) + dates.reject { |date| officer_shifts(task_id).include?(date) }.map { |date| [l(date, format: :long), l(date)] } end def start_date(polls) @@ -24,4 +24,9 @@ module ShiftsHelper officers.collect { |officer| [officer.name, officer.id] } end + private + + def officer_shifts(task_id) + @officer.shifts.where(task: task_id).map(&:date) + end end From c9a3bcc65a7539ba6fbb0477a04e7d367923b4ab Mon Sep 17 00:00:00 2001 From: decabeza Date: Mon, 16 Oct 2017 13:14:15 +0200 Subject: [PATCH 24/48] adds admin polls answer video specs --- spec/features/polls/answers_spec.rb | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/spec/features/polls/answers_spec.rb b/spec/features/polls/answers_spec.rb index f7dfd4d38..54890610e 100644 --- a/spec/features/polls/answers_spec.rb +++ b/spec/features/polls/answers_spec.rb @@ -39,6 +39,31 @@ feature 'Answers' do expect(page).to have_content "Adding more trees, creating a play area..." end + + scenario 'Add video to answer' do + question = create(:poll_question) + answer1 = create(:poll_question_answer, question: question) + answer2 = create(:poll_question_answer, question: question) + + visit admin_question_path(question) + + within("#poll_question_answer_#{answer1.id}") do + click_link "Video list" + end + + click_link "Add video" + + fill_in "poll_question_answer_video_title", with: "Awesome project video" + fill_in "poll_question_answer_video_url", with: "https://www.youtube.com/watch?v=123" + + click_button "Save" + + within("#poll_question_answer_video_#{answer1.id}") do + expect(page).to have_content "Awesome project video" + expect(page).to have_content "https://www.youtube.com/watch?v=123" + end + end + pending "Update" pending "Destroy" From 279adaa00d19f108366025c96cda857bc390e842 Mon Sep 17 00:00:00 2001 From: decabeza Date: Mon, 16 Oct 2017 13:14:44 +0200 Subject: [PATCH 25/48] starts with polls show answers with video specs --- spec/features/polls/polls_spec.rb | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/spec/features/polls/polls_spec.rb b/spec/features/polls/polls_spec.rb index 9fdb07255..96787bc9e 100644 --- a/spec/features/polls/polls_spec.rb +++ b/spec/features/polls/polls_spec.rb @@ -65,6 +65,19 @@ feature 'Polls' do let(:geozone) { create(:geozone) } let(:poll) { create(:poll, summary: "Summary", description: "Description") } + scenario 'Show answers with videos' do + question = create(:poll_question, poll: poll) + answer1 = create(:poll_question_answer, question: question, title: 'Chewbacca') + answer2 = create(:poll_question_answer, question: question, title: 'Han Solo', + video_title: "Awesome project video", + video_url: "https://www.youtube.com/watch?v=123") + + + visit poll_path(poll) + + + end + scenario 'Lists questions from proposals as well as regular ones' do normal_question = create(:poll_question, poll: poll) proposal_question = create(:poll_question, poll: poll, proposal: create(:proposal)) From a6d533a76750c86aa2a7ab623bcf01a5a9b8891c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mar=C3=ADa=20Checa?= Date: Mon, 16 Oct 2017 13:47:10 +0200 Subject: [PATCH 26/48] Helper improvements --- app/helpers/shifts_helper.rb | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/app/helpers/shifts_helper.rb b/app/helpers/shifts_helper.rb index ec1b342c4..f8cfe8cd4 100644 --- a/app/helpers/shifts_helper.rb +++ b/app/helpers/shifts_helper.rb @@ -1,15 +1,19 @@ module ShiftsHelper def shift_vote_collection_dates(polls) - date_options((start_date(polls)..end_date(polls)), 0) + date_options((start_date(polls)..end_date(polls)), Poll::Shift.tasks[:vote_collection]) end def shift_recount_scrutiny_dates(polls) - date_options(polls.map(&:ends_at).map(&:to_date).sort.inject([]) { |total, date| total << (date..date + 1.week).to_a }.flatten.uniq, 1) + date_options(polls.map(&:ends_at).map(&:to_date).sort.inject([]) { |total, date| total << (date..date + 1.week).to_a }.flatten.uniq, Poll::Shift.tasks[:recount_scrutiny]) end def date_options(dates, task_id) - dates.reject { |date| officer_shifts(task_id).include?(date) }.map { |date| [l(date, format: :long), l(date)] } + valid_dates(dates, task_id).map { |date| [l(date, format: :long), l(date)] } + end + + def valid_dates(dates, task_id) + dates.reject { |date| officer_shifts(task_id).include?(date) } end def start_date(polls) From 7d22b386b947baaca82982fe45526671df69c8cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mar=C3=ADa=20Checa?= Date: Mon, 16 Oct 2017 16:08:15 +0200 Subject: [PATCH 27/48] Added tests --- spec/factories.rb | 8 +++++++ spec/features/admin/poll/shifts_spec.rb | 31 +++++++++++++++++++++++++ 2 files changed, 39 insertions(+) diff --git a/spec/factories.rb b/spec/factories.rb index 69aa92c62..ba7c910ba 100644 --- a/spec/factories.rb +++ b/spec/factories.rb @@ -531,6 +531,14 @@ FactoryGirl.define do association :booth, factory: :poll_booth association :officer, factory: :poll_officer date Date.current + + trait :vote_collection_task do + task 0 + end + + trait :recount_scrutiny_task do + task 1 + end end factory :poll_voter, class: 'Poll::Voter' do diff --git a/spec/features/admin/poll/shifts_spec.rb b/spec/features/admin/poll/shifts_spec.rb index 2ac290216..4864d63d8 100644 --- a/spec/features/admin/poll/shifts_spec.rb +++ b/spec/features/admin/poll/shifts_spec.rb @@ -91,6 +91,37 @@ feature 'Admin shifts' do end end + scenario "Vote Collection Shift and Recount & Scrutiny Shift don't include already assigned dates to officer", :js do + poll = create(:poll, :current) + booth = create(:poll_booth) + assignment = create(:poll_booth_assignment, poll: poll, booth: booth) + officer = create(:poll_officer) + + shift1 = create(:poll_shift, :vote_collection_task, officer: officer, booth: booth, date: Time.zone.today) + shift2 = create(:poll_shift, :recount_scrutiny_task, officer: officer, booth: booth, date: Time.zone.tomorrow) + + vote_collection_dates = (poll.starts_at.to_date..poll.ends_at.to_date).to_a + .reject { |date| date == Time.zone.today } + .map { |date| I18n.l(date, format: :long) } + recount_scrutiny_dates = (poll.ends_at.to_date..poll.ends_at.to_date + 1.week).to_a + .reject { |date| date == Time.zone.tomorrow } + .map { |date| I18n.l(date, format: :long) } + + visit available_admin_booths_path + + within("#booth_#{booth.id}") do + click_link "Manage shifts" + end + + fill_in "search", with: officer.email + click_button "Search" + click_link "Edit shifts" + + expect(page).to have_select('shift_date_vote_collection_date', options: ["Select day", *vote_collection_dates]) + select "Recount & Scrutiny", from: 'shift_task' + expect(page).to have_select('shift_date_recount_scrutiny_date', options: ["Select day", *recount_scrutiny_dates]) + end + scenario "Error on create", :js do poll = create(:poll, :current) booth = create(:poll_booth) From c2dcad79b3243eefc56deca7cfe0a152cd36b966 Mon Sep 17 00:00:00 2001 From: rgarcia Date: Mon, 16 Oct 2017 17:14:40 +0200 Subject: [PATCH 28/48] adds video spec --- spec/factories.rb | 6 ++++++ spec/features/polls/polls_spec.rb | 9 +++------ 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/spec/factories.rb b/spec/factories.rb index a28471efc..cf3b8f88a 100644 --- a/spec/factories.rb +++ b/spec/factories.rb @@ -507,6 +507,12 @@ FactoryGirl.define do sequence(:description) { |n| "Question description #{n}" } end + factory :poll_answer_video, class: 'Poll::Question::Answer::Video' do + association :answer, factory: :poll_question_answer + title "Sample video title" + url "http://sample-video-url.org" + end + factory :poll_booth, class: 'Poll::Booth' do sequence(:name) { |n| "Booth #{n}" } sequence(:location) { |n| "Street #{n}" } diff --git a/spec/features/polls/polls_spec.rb b/spec/features/polls/polls_spec.rb index 96787bc9e..2793fafdf 100644 --- a/spec/features/polls/polls_spec.rb +++ b/spec/features/polls/polls_spec.rb @@ -67,15 +67,12 @@ feature 'Polls' do scenario 'Show answers with videos' do question = create(:poll_question, poll: poll) - answer1 = create(:poll_question_answer, question: question, title: 'Chewbacca') - answer2 = create(:poll_question_answer, question: question, title: 'Han Solo', - video_title: "Awesome project video", - video_url: "https://www.youtube.com/watch?v=123") - + answer = create(:poll_question_answer, question: question, title: 'Chewbacca') + video = create(:poll_answer_video, answer: answer, title: "Awesome project video", url: "https://www.youtube.com/watch?v=123") visit poll_path(poll) - + expect(page).to have_link("Awesome project video", href: "https://www.youtube.com/watch?v=123") end scenario 'Lists questions from proposals as well as regular ones' do From 1812c0330e9e5eb84cd856c8d15abfa29b49862e Mon Sep 17 00:00:00 2001 From: decabeza Date: Mon, 16 Oct 2017 18:37:00 +0200 Subject: [PATCH 29/48] replaces video url on poll answer factories --- spec/factories.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/factories.rb b/spec/factories.rb index cf3b8f88a..db24002ae 100644 --- a/spec/factories.rb +++ b/spec/factories.rb @@ -510,7 +510,7 @@ FactoryGirl.define do factory :poll_answer_video, class: 'Poll::Question::Answer::Video' do association :answer, factory: :poll_question_answer title "Sample video title" - url "http://sample-video-url.org" + url "https://youtu.be/nhuNb0XtRhQ" end factory :poll_booth, class: 'Poll::Booth' do From 580c57e71bf0a9b5db2bb6611a52e4daac8ba265 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mar=C3=ADa=20Checa?= Date: Mon, 16 Oct 2017 19:02:27 +0200 Subject: [PATCH 30/48] Added officing tests Added new tests to officing section to ensure that multiple sessions (different users) can be initialized at the same time without crashing. --- spec/features/officing_spec.rb | 39 +++++++++++++++++++++++++++++++++- spec/sessions_helper.rb | 8 +++++++ 2 files changed, 46 insertions(+), 1 deletion(-) create mode 100644 spec/sessions_helper.rb diff --git a/spec/features/officing_spec.rb b/spec/features/officing_spec.rb index aff3eac4e..897a26107 100644 --- a/spec/features/officing_spec.rb +++ b/spec/features/officing_spec.rb @@ -1,4 +1,5 @@ require 'rails_helper' +require 'sessions_helper' feature 'Poll Officing' do let(:user) { create(:user) } @@ -106,4 +107,40 @@ feature 'Poll Officing' do expect(page).to_not have_css('#moderation_menu') end -end \ No newline at end of file + scenario 'Officing dashboard available for multiple sessions' do + user1 = create(:user) + user2 = create(:user) + officer1 = create(:poll_officer, user: user1) + officer2 = create(:poll_officer, user: user2) + + in_browser(:one) do + login_as user1 + visit officing_root_path + end + + in_browser(:two) do + login_as user2 + visit officing_root_path + end + + in_browser(:one) do + page.should have_content("Here you can validate user documents and store voting results") + + visit new_officing_residence_path + page.should have_content("Validate document") + + visit final_officing_polls_path + page.should have_content("Polls ready for final recounting") + end + + in_browser(:two) do + page.should have_content("Here you can validate user documents and store voting results") + + visit new_officing_residence_path + page.should have_content("Validate document") + + visit final_officing_polls_path + page.should have_content("Polls ready for final recounting") + end + end +end diff --git a/spec/sessions_helper.rb b/spec/sessions_helper.rb new file mode 100644 index 000000000..fc3fcc2f0 --- /dev/null +++ b/spec/sessions_helper.rb @@ -0,0 +1,8 @@ +def in_browser(name) + old_session = Capybara.session_name + + Capybara.session_name = name + yield + + Capybara.session_name = old_session +end From 3ec12cfad7f0a0d263c52cc5b6efb903ec962e55 Mon Sep 17 00:00:00 2001 From: decabeza Date: Mon, 16 Oct 2017 19:39:06 +0200 Subject: [PATCH 31/48] removes box shadow for off canvas content --- app/assets/stylesheets/layout.scss | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/assets/stylesheets/layout.scss b/app/assets/stylesheets/layout.scss index 160819795..ecb58d2f1 100644 --- a/app/assets/stylesheets/layout.scss +++ b/app/assets/stylesheets/layout.scss @@ -372,6 +372,10 @@ a { display: table-cell; } +.off-canvas-content { + box-shadow: none; +} + // 02. Header // ---------- From 92dbb4fb73b5166a6378ca82d33637e0205f2507 Mon Sep 17 00:00:00 2001 From: decabeza Date: Mon, 16 Oct 2017 19:39:29 +0200 Subject: [PATCH 32/48] removes unnecessary close button for admin menu --- app/views/layouts/admin.html.erb | 4 ---- 1 file changed, 4 deletions(-) diff --git a/app/views/layouts/admin.html.erb b/app/views/layouts/admin.html.erb index c0e36ba0e..351c04b76 100644 --- a/app/views/layouts/admin.html.erb +++ b/app/views/layouts/admin.html.erb @@ -18,10 +18,6 @@
    - -
    <%= side_menu %>
    From 0b5eed090e8b680074d49ff6a439d43316e613a5 Mon Sep 17 00:00:00 2001 From: Bertocq Date: Mon, 16 Oct 2017 19:54:07 +0200 Subject: [PATCH 33/48] Fix no-answer scenario for question valid answers --- app/models/poll/question.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/poll/question.rb b/app/models/poll/question.rb index efcaf4635..90e528bd0 100644 --- a/app/models/poll/question.rb +++ b/app/models/poll/question.rb @@ -40,7 +40,7 @@ class Poll::Question < ActiveRecord::Base end def valid_answers - (super.try(:split, ',').compact || []).map(&:strip) + (super.try(:split, ',')&.compact || []).map(&:strip) end def copy_attributes_from_proposal(proposal) From e1e9b431d79f2d0540db6e1a862b887b388c7abe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mar=C3=ADa=20Checa?= Date: Mon, 16 Oct 2017 20:10:49 +0200 Subject: [PATCH 34/48] Added tests --- spec/features/polls/voter_spec.rb | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/spec/features/polls/voter_spec.rb b/spec/features/polls/voter_spec.rb index 256807928..409bcd09d 100644 --- a/spec/features/polls/voter_spec.rb +++ b/spec/features/polls/voter_spec.rb @@ -41,6 +41,27 @@ feature "Voter" do expect(Poll::Voter.first.origin).to eq("web") end + scenario "Voting via web as unverified user", :js do + poll = create(:poll) + + question = create(:poll_question, poll: poll) + answer1 = create(:poll_question_answer, question: question, title: 'Yes') + answer2 = create(:poll_question_answer, question: question, title: 'No') + + user = create(:user, :incomplete_verification) + + login_as user + visit poll_path(poll) + + within("#poll_question_#{question.id}_answers") do + expect(page).to_not have_link('Yes') + expect(page).to_not have_link('No') + end + + expect(page).to have_content("You must verify your account in order to answer") + expect(page).to_not have_content("You have already participated in this poll. If you vote again it will be overwritten") + end + scenario "Voting in booth", :js do user = create(:user, :in_census) From c24fab427e04f90f26be9cd426293cbe85c61b6b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mar=C3=ADa=20Checa?= Date: Tue, 17 Oct 2017 10:20:36 +0200 Subject: [PATCH 35/48] Completed tests --- spec/features/officing_spec.rb | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/spec/features/officing_spec.rb b/spec/features/officing_spec.rb index 897a26107..2a54bbff1 100644 --- a/spec/features/officing_spec.rb +++ b/spec/features/officing_spec.rb @@ -108,11 +108,18 @@ feature 'Poll Officing' do end scenario 'Officing dashboard available for multiple sessions' do + poll = create(:poll) + booth = create(:poll_booth) + booth_assignment = create(:poll_booth_assignment, poll: poll, booth: booth) + user1 = create(:user) user2 = create(:user) officer1 = create(:poll_officer, user: user1) officer2 = create(:poll_officer, user: user2) + officer_assignment_1 = create(:poll_officer_assignment, booth_assignment: booth_assignment, officer: officer1) + officer_assignment_2 = create(:poll_officer_assignment, booth_assignment: booth_assignment, officer: officer2) + in_browser(:one) do login_as user1 visit officing_root_path From 68e09e8a9a1880d6e5850cef23696aa00c476119 Mon Sep 17 00:00:00 2001 From: Bertocq Date: Tue, 17 Oct 2017 12:16:09 +0200 Subject: [PATCH 36/48] Fix vote collection date expectations --- spec/features/admin/poll/shifts_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/features/admin/poll/shifts_spec.rb b/spec/features/admin/poll/shifts_spec.rb index 6f027fad3..35df2e20e 100644 --- a/spec/features/admin/poll/shifts_spec.rb +++ b/spec/features/admin/poll/shifts_spec.rb @@ -101,7 +101,7 @@ feature 'Admin shifts' do shift1 = create(:poll_shift, :vote_collection_task, officer: officer, booth: booth, date: Time.zone.today) shift2 = create(:poll_shift, :recount_scrutiny_task, officer: officer, booth: booth, date: Time.zone.tomorrow) - vote_collection_dates = (poll.starts_at.to_date..poll.ends_at.to_date).to_a + vote_collection_dates = (Date.current..poll.ends_at.to_date).to_a .reject { |date| date == Time.zone.today } .map { |date| I18n.l(date, format: :long) } recount_scrutiny_dates = (poll.ends_at.to_date..poll.ends_at.to_date + 1.week).to_a From c8568d16aa00bfaa47a6e7f9b29ce3c5b0b45367 Mon Sep 17 00:00:00 2001 From: Bertocq Date: Tue, 17 Oct 2017 13:13:51 +0200 Subject: [PATCH 37/48] Fix wrongful expectation on add video to answer scenario --- spec/features/polls/answers_spec.rb | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/spec/features/polls/answers_spec.rb b/spec/features/polls/answers_spec.rb index 88b7e28aa..8bb87c94e 100644 --- a/spec/features/polls/answers_spec.rb +++ b/spec/features/polls/answers_spec.rb @@ -2,20 +2,20 @@ require 'rails_helper' feature 'Answers' do + let(:question) { create(:poll_question) } + let(:admin) { create(:administrator) } + background do - admin = create(:administrator) login_as(admin.user) end scenario "Index" do - question = create(:poll_question) answer1 = create(:poll_question_answer, question: question, given_order: 2) answer2 = create(:poll_question_answer, question: question, given_order: 1) visit admin_question_path(question) expect(page).to have_css(".poll_question_answer", count: 2) - expect(page.body.index(answer1.title)).to be < page.body.index(answer2.title) within("#poll_question_answer_#{answer1.id}") do @@ -25,8 +25,6 @@ feature 'Answers' do end scenario "Create" do - question = create(:poll_question) - visit admin_question_path(question) click_link "Add answer" @@ -35,15 +33,12 @@ feature 'Answers' do click_button "Save" expect(page).to have_content "Answer created successfully" - expect(page).to have_css(".poll_question_answer", count: 1) expect(page).to have_content "¿Would you like to reform Central Park?" expect(page).to have_content "Adding more trees, creating a play area..." end - scenario 'Add video to answer' do - question = create(:poll_question) answer1 = create(:poll_question_answer, question: question) answer2 = create(:poll_question_answer, question: question) @@ -60,7 +55,7 @@ feature 'Answers' do click_button "Save" - within("#poll_question_answer_video_#{answer1.id}") do + within("#poll_question_answer_video_#{answer1.videos.last.id}") do expect(page).to have_content "Awesome project video" expect(page).to have_content "https://www.youtube.com/watch?v=123" end From 58f57bc15b0ab88536e60fe987228dea3568b8d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mar=C3=ADa=20Checa?= Date: Tue, 17 Oct 2017 13:16:46 +0200 Subject: [PATCH 38/48] Added poll method `voted_in_web?` --- app/models/poll.rb | 4 ++++ app/views/polls/show.html.erb | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/app/models/poll.rb b/app/models/poll.rb index 84349bf0b..cd91db884 100644 --- a/app/models/poll.rb +++ b/app/models/poll.rb @@ -65,6 +65,10 @@ class Poll < ActiveRecord::Base Poll::Voter.where(poll: self, user: user, origin: "booth").exists? end + def voted_in_web?(user) + Poll::Voter.where(poll: self, user: user, origin: "web").exists? + end + def date_range unless starts_at.present? && ends_at.present? && starts_at <= ends_at errors.add(:starts_at, I18n.t('errors.messages.invalid_date_range')) diff --git a/app/views/polls/show.html.erb b/app/views/polls/show.html.erb index c9796b836..b81ee2c7a 100644 --- a/app/views/polls/show.html.erb +++ b/app/views/polls/show.html.erb @@ -39,7 +39,7 @@
    <% else %> - <% unless current_user && @poll.votable_by?(current_user) %> + <% if current_user && @poll.voted_in_web?(current_user) %>
    <%= t("polls.show.already_voted_in_web") %>
    From 712151b395d576cfcc775227af9d3f54f3977a88 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mar=C3=ADa=20Checa?= Date: Tue, 17 Oct 2017 13:17:20 +0200 Subject: [PATCH 39/48] Tests improvements --- spec/features/polls/voter_spec.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spec/features/polls/voter_spec.rb b/spec/features/polls/voter_spec.rb index 409bcd09d..21e73e238 100644 --- a/spec/features/polls/voter_spec.rb +++ b/spec/features/polls/voter_spec.rb @@ -54,8 +54,8 @@ feature "Voter" do visit poll_path(poll) within("#poll_question_#{question.id}_answers") do - expect(page).to_not have_link('Yes') - expect(page).to_not have_link('No') + expect(page).to_not have_link('Yes', href: "/questions/#{question.id}/answer?answer=Yes&token=") + expect(page).to_not have_link('No', href: "/questions/#{question.id}/answer?answer=No&token=") end expect(page).to have_content("You must verify your account in order to answer") From 548fd03ac8afcdd85e07b494dc05eac029679651 Mon Sep 17 00:00:00 2001 From: decabeza Date: Tue, 17 Oct 2017 13:25:09 +0200 Subject: [PATCH 40/48] fixes admin login items menu on mobile size --- app/views/layouts/_header.html.erb | 2 +- app/views/shared/_admin_login_items.html.erb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/layouts/_header.html.erb b/app/views/layouts/_header.html.erb index 304c5c954..fff3e3977 100644 --- a/app/views/layouts/_header.html.erb +++ b/app/views/layouts/_header.html.erb @@ -28,7 +28,7 @@
    -
    diff --git a/config/locales/en/officing.yml b/config/locales/en/officing.yml index bb9ef6bd2..9837e7b86 100644 --- a/config/locales/en/officing.yml +++ b/config/locales/en/officing.yml @@ -63,7 +63,6 @@ en: show: can_vote: Can vote error_already_voted: Has already participated in this poll - no_actions: There is no available actions submit: Confirm vote success: "Vote introduced!" can_vote: diff --git a/config/locales/es/officing.yml b/config/locales/es/officing.yml index 86d6982fc..b16196382 100644 --- a/config/locales/es/officing.yml +++ b/config/locales/es/officing.yml @@ -63,8 +63,7 @@ es: show: can_vote: Puede votar error_already_voted: "Ya ha participado en esta votación" - no_actions: No hay acciones disponibles submit: Confirmar voto success: "¡Voto introducido!" can_vote: - submit_disable_with: "Espera, confirmando voto..." \ No newline at end of file + submit_disable_with: "Espera, confirmando voto..." From ce0a7f6fad4382468bdda767e37c0009d402b3db Mon Sep 17 00:00:00 2001 From: Bertocq Date: Tue, 17 Oct 2017 22:00:00 +0200 Subject: [PATCH 47/48] Rubocop autocorrections --- .../admin/poll/polls_controller.rb | 2 +- .../questions/answers/images_controller.rb | 2 +- .../questions/answers/videos_controller.rb | 10 ++++----- .../admin/poll/shifts_controller.rb | 2 +- app/controllers/direct_uploads_controller.rb | 5 ++--- app/helpers/documentables_helper.rb | 4 ++-- app/helpers/documents_helper.rb | 2 +- app/helpers/imageables_helper.rb | 10 ++++----- app/helpers/polls_helper.rb | 2 +- app/helpers/welcome_helper.rb | 12 +++++----- app/models/concerns/followable.rb | 2 +- app/models/debate.rb | 4 ++-- app/models/direct_upload.rb | 22 +++++++++---------- app/models/document.rb | 2 +- app/models/image.rb | 8 +++---- app/models/poll/voter.rb | 2 +- app/models/proposal.rb | 8 +++---- .../admin/poll/officer_assignments_spec.rb | 7 +++--- spec/features/admin/poll/shifts_spec.rb | 8 +++---- spec/features/admin/settings_spec.rb | 1 - spec/features/comments/polls_spec.rb | 20 ++++++++--------- spec/features/debates_spec.rb | 4 ++-- spec/features/emails_spec.rb | 1 - spec/features/home_spec.rb | 2 +- spec/models/debate_spec.rb | 12 +++++----- spec/models/direct_upload_spec.rb | 4 ++-- spec/models/map_location_spec.rb | 2 +- spec/models/proposal_spec.rb | 8 +++---- spec/shared/features/mappable.rb | 22 +++++++++---------- spec/shared/features/nested_documentable.rb | 4 ++-- spec/shared/features/nested_imageable.rb | 16 +++++--------- spec/support/common_actions.rb | 2 +- 32 files changed, 101 insertions(+), 111 deletions(-) diff --git a/app/controllers/admin/poll/polls_controller.rb b/app/controllers/admin/poll/polls_controller.rb index cce880ed4..5103275fb 100644 --- a/app/controllers/admin/poll/polls_controller.rb +++ b/app/controllers/admin/poll/polls_controller.rb @@ -54,7 +54,7 @@ class Admin::Poll::PollsController < Admin::Poll::BaseController end def poll_params - params.require(:poll).permit(:name, :starts_at, :ends_at, :geozone_restricted, :summary, :description, + params.require(:poll).permit(:name, :starts_at, :ends_at, :geozone_restricted, :summary, :description, geozone_ids: [], image_attributes: [:id, :title, :attachment, :cached_attachment, :user_id, :_destroy]) end diff --git a/app/controllers/admin/poll/questions/answers/images_controller.rb b/app/controllers/admin/poll/questions/answers/images_controller.rb index 1bf30907d..030e177a1 100644 --- a/app/controllers/admin/poll/questions/answers/images_controller.rb +++ b/app/controllers/admin/poll/questions/answers/images_controller.rb @@ -5,7 +5,7 @@ class Admin::Poll::Questions::Answers::ImagesController < Admin::Poll::BaseContr end def new - @answer = ::Poll::Question::Answer.find(params[:answer_id]) + @answer = ::Poll::Question::Answer.find(params[:answer_id]) end def create diff --git a/app/controllers/admin/poll/questions/answers/videos_controller.rb b/app/controllers/admin/poll/questions/answers/videos_controller.rb index a231c1a20..e9262b6dd 100644 --- a/app/controllers/admin/poll/questions/answers/videos_controller.rb +++ b/app/controllers/admin/poll/questions/answers/videos_controller.rb @@ -33,11 +33,11 @@ class Admin::Poll::Questions::Answers::VideosController < Admin::Poll::BaseContr end def destroy - if @video.destroy - notice = t("flash.actions.destroy.poll_question_answer_video") - else - notice = t("flash.actions.destroy.error") - end + notice = if @video.destroy + t("flash.actions.destroy.poll_question_answer_video") + else + t("flash.actions.destroy.error") + end redirect_to :back, notice: notice end diff --git a/app/controllers/admin/poll/shifts_controller.rb b/app/controllers/admin/poll/shifts_controller.rb index 1f60b2b4e..89bb68999 100644 --- a/app/controllers/admin/poll/shifts_controller.rb +++ b/app/controllers/admin/poll/shifts_controller.rb @@ -49,7 +49,7 @@ class Admin::Poll::ShiftsController < Admin::Poll::BaseController end def shift_params - shift_params = params.require(:shift).permit(:booth_id, :officer_id, :task, date:[:vote_collection_date, :recount_scrutiny_date]) + shift_params = params.require(:shift).permit(:booth_id, :officer_id, :task, date: [:vote_collection_date, :recount_scrutiny_date]) shift_params.merge(date: shift_params[:date]["#{shift_params[:task]}_date".to_sym]) end end diff --git a/app/controllers/direct_uploads_controller.rb b/app/controllers/direct_uploads_controller.rb index ade7d631f..a067a5d04 100644 --- a/app/controllers/direct_uploads_controller.rb +++ b/app/controllers/direct_uploads_controller.rb @@ -18,8 +18,7 @@ class DirectUploadsController < ApplicationController render json: { cached_attachment: @direct_upload.relation.cached_attachment, filename: @direct_upload.relation.attachment.original_filename, destroy_link: render_destroy_upload_link(@direct_upload).html_safe, - attachment_url: @direct_upload.relation.attachment.url - } + attachment_url: @direct_upload.relation.attachment.url} else @direct_upload.destroy_attachment render json: { errors: @direct_upload.errors[:attachment].join(", ") }, @@ -28,7 +27,7 @@ class DirectUploadsController < ApplicationController end def destroy - @direct_upload = DirectUpload.new(direct_upload_params.merge(user: current_user) ) + @direct_upload = DirectUpload.new(direct_upload_params.merge(user: current_user)) @direct_upload.relation.set_attachment_from_cached_attachment if @direct_upload.destroy_attachment diff --git a/app/helpers/documentables_helper.rb b/app/helpers/documentables_helper.rb index 8d9f85578..3fe56abd2 100644 --- a/app/helpers/documentables_helper.rb +++ b/app/helpers/documentables_helper.rb @@ -24,8 +24,8 @@ module DocumentablesHelper def documentable_humanized_accepted_content_types(documentable_class) documentable_class.accepted_content_types - .collect{ |content_type| content_type.split("/").last } - .join(", ") + .collect{ |content_type| content_type.split("/").last } + .join(", ") end def documentables_note(documentable) diff --git a/app/helpers/documents_helper.rb b/app/helpers/documents_helper.rb index d7e8d1dea..70eb6a27f 100644 --- a/app/helpers/documents_helper.rb +++ b/app/helpers/documents_helper.rb @@ -33,7 +33,7 @@ module DocumentsHelper def render_attachment(builder, document) klass = document.errors[:attachment].any? ? "error" : "" - klass = document.persisted? || document.cached_attachment.present? ? " hide" : "" + klass = document.persisted? || document.cached_attachment.present? ? " hide" : "" html = builder.label :attachment, t("documents.form.attachment_label"), class: "button hollow #{klass}" diff --git a/app/helpers/imageables_helper.rb b/app/helpers/imageables_helper.rb index b1c8059ce..efe3c88ce 100644 --- a/app/helpers/imageables_helper.rb +++ b/app/helpers/imageables_helper.rb @@ -22,17 +22,17 @@ module ImageablesHelper def imageable_accepted_content_types_extensions Image::ACCEPTED_CONTENT_TYPE - .collect{ |content_type| ".#{content_type.split("/").last}" } - .join(",") + .collect{ |content_type| ".#{content_type.split('/').last}" } + .join(",") end def imageable_humanized_accepted_content_types Image::ACCEPTED_CONTENT_TYPE - .collect{ |content_type| content_type.split("/").last } - .join(", ") + .collect{ |content_type| content_type.split("/").last } + .join(", ") end - def imageables_note(imageable) + def imageables_note(_imageable) t "images.form.note", accepted_content_types: imageable_humanized_accepted_content_types, max_file_size: imageable_max_file_size end diff --git a/app/helpers/polls_helper.rb b/app/helpers/polls_helper.rb index dd4018be7..0d5b0a605 100644 --- a/app/helpers/polls_helper.rb +++ b/app/helpers/polls_helper.rb @@ -44,7 +44,7 @@ module PollsHelper def poll_voter_token(poll, user) Poll::Voter.where(poll: poll, user: user, origin: "web").first&.token || '' end - + def voted_before_sign_in(question) question.answers.where(author: current_user).any? { |vote| current_user.current_sign_in_at >= vote.updated_at } end diff --git a/app/helpers/welcome_helper.rb b/app/helpers/welcome_helper.rb index fe1c5f450..7b12c5d6f 100644 --- a/app/helpers/welcome_helper.rb +++ b/app/helpers/welcome_helper.rb @@ -46,12 +46,12 @@ module WelcomeHelper end def calculate_offset(debates, proposals, apply_offset) - if (debates.any? && proposals.any?) - if apply_offset - offset = "medium-offset-2 large-offset-2" - else - offset = "end" - end + if debates.any? && proposals.any? + offset = if apply_offset + "medium-offset-2 large-offset-2" + else + "end" + end end end diff --git a/app/models/concerns/followable.rb b/app/models/concerns/followable.rb index fee1ebd7f..d635cadda 100644 --- a/app/models/concerns/followable.rb +++ b/app/models/concerns/followable.rb @@ -5,7 +5,7 @@ module Followable has_many :follows, as: :followable, dependent: :destroy has_many :followers, through: :follows, source: :user - scope :followed_by_user, -> (user){ + scope :followed_by_user, ->(user){ joins(:follows).where("follows.user_id = ?", user.id) } end diff --git a/app/models/debate.rb b/app/models/debate.rb index eb424c308..65c06345d 100644 --- a/app/models/debate.rb +++ b/app/models/debate.rb @@ -48,8 +48,8 @@ class Debate < ActiveRecord::Base attr_accessor :link_required def self.recommendations(user) - tagged_with(user.interests, any: true). - where("author_id != ?", user.id) + tagged_with(user.interests, any: true) + .where("author_id != ?", user.id) end def searchable_values diff --git a/app/models/direct_upload.rb b/app/models/direct_upload.rb index e597f9f12..6681aa7be 100644 --- a/app/models/direct_upload.rb +++ b/app/models/direct_upload.rb @@ -7,7 +7,7 @@ class DirectUpload :relation, :resource_relation, :attachment, :cached_attachment, :user - validates_presence_of :attachment, :resource_type, :resource_relation, :user + validates :attachment, :resource_type, :resource_relation, :user, presence: true validate :parent_resource_attachment_validations, if: -> { attachment.present? && resource_type.present? && resource_relation.present? && user.present? } @@ -19,15 +19,15 @@ class DirectUpload if @resource_type.present? && @resource_relation.present? && (@attachment.present? || @cached_attachment.present?) @resource = @resource_type.constantize.find_or_initialize_by(id: @resource_id) - #Refactor - if @resource.respond_to?(:images) && - ((@attachment.present? && !@attachment.content_type.match(/pdf/)) || @cached_attachment.present?) - @relation = @resource.images.send("build", relation_attributtes) - elsif @resource.class.reflections[@resource_relation].macro == :has_one - @relation = @resource.send("build_#{resource_relation}", relation_attributtes) - else - @relation = @resource.send(@resource_relation).build(relation_attributtes) - end + # Refactor + @relation = if @resource.respond_to?(:images) && + ((@attachment.present? && !@attachment.content_type.match(/pdf/)) || @cached_attachment.present?) + @resource.images.send("build", relation_attributtes) + elsif @resource.class.reflections[@resource_relation].macro == :has_one + @resource.send("build_#{resource_relation}", relation_attributtes) + else + @resource.send(@resource_relation).build(relation_attributtes) + end @relation.user = user end @@ -50,7 +50,7 @@ class DirectUpload def parent_resource_attachment_validations @relation.valid? - if @relation.errors.has_key? :attachment + if @relation.errors.key? :attachment errors[:attachment] = @relation.errors[:attachment] end end diff --git a/app/models/document.rb b/app/models/document.rb index f680bc04e..8843bbed9 100644 --- a/app/models/document.rb +++ b/app/models/document.rb @@ -44,7 +44,7 @@ class Document < ActiveRecord::Base attachment.instance.prefix(attachment, style) end - def prefix(attachment, style) + def prefix(attachment, _style) if !attachment.instance.persisted? "cached_attachments/user/#{attachment.instance.user_id}" else diff --git a/app/models/image.rb b/app/models/image.rb index 84b38dd4a..99061f6f1 100644 --- a/app/models/image.rb +++ b/app/models/image.rb @@ -5,7 +5,7 @@ class Image < ActiveRecord::Base TITLE_LEGHT_RANGE = 4..80 MIN_SIZE = 475 MAX_IMAGE_SIZE = 1.megabyte - ACCEPTED_CONTENT_TYPE = %w(image/jpeg image/jpg) + ACCEPTED_CONTENT_TYPE = %w(image/jpeg image/jpg).freeze has_attached_file :attachment, styles: { large: "x#{MIN_SIZE}", medium: "300x300#", thumb: "140x245#" }, url: "/system/:class/:prefix/:style/:hash.:extension", @@ -52,7 +52,7 @@ class Image < ActiveRecord::Base attachment.instance.prefix(attachment, style) end - def prefix(attachment, style) + def prefix(attachment, _style) if !attachment.instance.persisted? "cached_attachments/user/#{attachment.instance.user_id}" else @@ -103,8 +103,8 @@ class Image < ActiveRecord::Base def remove_cached_attachment image = Image.new(imageable: imageable, - cached_attachment: cached_attachment, - user: user) + cached_attachment: cached_attachment, + user: user) image.set_attachment_from_cached_attachment image.attachment.destroy end diff --git a/app/models/poll/voter.rb b/app/models/poll/voter.rb index bc0118a88..778a5d88a 100644 --- a/app/models/poll/voter.rb +++ b/app/models/poll/voter.rb @@ -1,7 +1,7 @@ class Poll class Voter < ActiveRecord::Base - VALID_ORIGINS = %w{ web booth } + VALID_ORIGINS = %w{web booth}.freeze belongs_to :poll belongs_to :user diff --git a/app/models/proposal.rb b/app/models/proposal.rb index 1a688ab30..3b0696d26 100644 --- a/app/models/proposal.rb +++ b/app/models/proposal.rb @@ -69,10 +69,10 @@ class Proposal < ActiveRecord::Base scope :public_for_api, -> { all } def self.recommendations(user) - tagged_with(user.interests, any: true). - where("author_id != ?", user.id). - unsuccessful. - not_followed_by_user(user) + tagged_with(user.interests, any: true) + .where("author_id != ?", user.id) + .unsuccessful + .not_followed_by_user(user) end def self.not_followed_by_user(user) diff --git a/spec/features/admin/poll/officer_assignments_spec.rb b/spec/features/admin/poll/officer_assignments_spec.rb index 20be138b9..48d10ad39 100644 --- a/spec/features/admin/poll/officer_assignments_spec.rb +++ b/spec/features/admin/poll/officer_assignments_spec.rb @@ -30,9 +30,9 @@ feature 'Officer Assignments' do expect(page).to have_content officer2.name expect(page).to_not have_content officer3.name end - end + end - scenario "Search", :js do + scenario "Search", :js do poll = create(:poll) booth = create(:poll_booth) @@ -62,7 +62,6 @@ feature 'Officer Assignments' do expect(page).to have_content officer2.name expect(page).to_not have_content officer3.name end - end - + end end \ No newline at end of file diff --git a/spec/features/admin/poll/shifts_spec.rb b/spec/features/admin/poll/shifts_spec.rb index 35df2e20e..bddd1b6b1 100644 --- a/spec/features/admin/poll/shifts_spec.rb +++ b/spec/features/admin/poll/shifts_spec.rb @@ -102,11 +102,11 @@ feature 'Admin shifts' do shift2 = create(:poll_shift, :recount_scrutiny_task, officer: officer, booth: booth, date: Time.zone.tomorrow) vote_collection_dates = (Date.current..poll.ends_at.to_date).to_a - .reject { |date| date == Time.zone.today } - .map { |date| I18n.l(date, format: :long) } + .reject { |date| date == Time.zone.today } + .map { |date| I18n.l(date, format: :long) } recount_scrutiny_dates = (poll.ends_at.to_date..poll.ends_at.to_date + 1.week).to_a - .reject { |date| date == Time.zone.tomorrow } - .map { |date| I18n.l(date, format: :long) } + .reject { |date| date == Time.zone.tomorrow } + .map { |date| I18n.l(date, format: :long) } visit available_admin_booths_path diff --git a/spec/features/admin/settings_spec.rb b/spec/features/admin/settings_spec.rb index 73d190cb9..40baf6423 100644 --- a/spec/features/admin/settings_spec.rb +++ b/spec/features/admin/settings_spec.rb @@ -87,7 +87,6 @@ feature 'Admin settings' do expect(page).to have_content "Map configuration updated succesfully" end - end end diff --git a/spec/features/comments/polls_spec.rb b/spec/features/comments/polls_spec.rb index 8ef528cd3..0fe01cf06 100644 --- a/spec/features/comments/polls_spec.rb +++ b/spec/features/comments/polls_spec.rb @@ -21,7 +21,7 @@ feature 'Commenting polls' do end scenario 'Show' do - skip "Feature not implemented yet, review soon" + skip "Feature not implemented yet, review soon" parent_comment = create(:comment, commentable: poll) first_child = create(:comment, commentable: poll, parent: parent_comment) @@ -243,7 +243,7 @@ feature 'Commenting polls' do end scenario "Flagging as inappropriate", :js do - skip "Feature not implemented yet, review soon" + skip "Feature not implemented yet, review soon" comment = create(:comment, commentable: poll) @@ -261,7 +261,7 @@ feature 'Commenting polls' do end scenario "Undoing flagging as inappropriate", :js do - skip "Feature not implemented yet, review soon" + skip "Feature not implemented yet, review soon" comment = create(:comment, commentable: poll) Flag.flag(user, comment) @@ -280,7 +280,7 @@ feature 'Commenting polls' do end scenario "Flagging turbolinks sanity check", :js do - skip "Feature not implemented yet, review soon" + skip "Feature not implemented yet, review soon" poll = create(:poll, title: "Should we change the world?") comment = create(:comment, commentable: poll) @@ -310,7 +310,7 @@ feature 'Commenting polls' do feature "Moderators" do scenario "can create comment as a moderator", :js do - skip "Feature not implemented yet, review soon" + skip "Feature not implemented yet, review soon" moderator = create(:moderator) @@ -330,7 +330,7 @@ feature 'Commenting polls' do end scenario "can create reply as a moderator", :js do - skip "Feature not implemented yet, review soon" + skip "Feature not implemented yet, review soon" citizen = create(:user, username: "Ana") manuela = create(:user, username: "Manuela") @@ -359,7 +359,7 @@ feature 'Commenting polls' do end scenario "can not comment as an administrator" do - skip "Feature not implemented yet, review soon" + skip "Feature not implemented yet, review soon" moderator = create(:moderator) @@ -372,7 +372,7 @@ feature 'Commenting polls' do feature "Administrators" do scenario "can create comment as an administrator", :js do - skip "Feature not implemented yet, review soon" + skip "Feature not implemented yet, review soon" admin = create(:administrator) @@ -392,7 +392,7 @@ feature 'Commenting polls' do end scenario "can create reply as an administrator", :js do - skip "Feature not implemented yet, review soon" + skip "Feature not implemented yet, review soon" citizen = create(:user, username: "Ana") manuela = create(:user, username: "Manuela") @@ -421,7 +421,7 @@ feature 'Commenting polls' do end scenario "can not comment as a moderator" do - skip "Feature not implemented yet, review soon" + skip "Feature not implemented yet, review soon" admin = create(:administrator) diff --git a/spec/features/debates_spec.rb b/spec/features/debates_spec.rb index 3d7c6acf8..39cd84760 100644 --- a/spec/features/debates_spec.rb +++ b/spec/features/debates_spec.rb @@ -394,7 +394,7 @@ feature 'Debates' do end scenario 'Debates are ordered by recommendations when there is a user logged', :js do - proposal = create(:proposal, tag_list: "Sport" ) + proposal = create(:proposal, tag_list: "Sport") user = create(:user) create(:follow, followable: proposal, user: user) login_as(user) @@ -830,7 +830,7 @@ feature 'Debates' do debate2 = create(:debate, title: "Show what you got", cached_votes_total: 1, tag_list: "Sport") debate3 = create(:debate, title: "Do not display with same tag", cached_votes_total: 100, tag_list: "Sport") debate4 = create(:debate, title: "Do not display", cached_votes_total: 1) - proposal1 = create(:proposal, tag_list: "Sport") + proposal1 = create(:proposal, tag_list: "Sport") create(:follow, followable: proposal1, user: user) visit debates_path diff --git a/spec/features/emails_spec.rb b/spec/features/emails_spec.rb index a26e8ce11..74b608ed6 100644 --- a/spec/features/emails_spec.rb +++ b/spec/features/emails_spec.rb @@ -408,7 +408,6 @@ feature 'Emails' do end expect(page).to have_content 'It will be done next week.' - email = open_last_email expect(email).to have_subject('Someone has responded to your comment') expect(email).to deliver_to(user1) diff --git a/spec/features/home_spec.rb b/spec/features/home_spec.rb index cb5349814..4854fff4d 100644 --- a/spec/features/home_spec.rb +++ b/spec/features/home_spec.rb @@ -27,7 +27,7 @@ feature "Home" do background do Setting['feature.user.recommendations'] = true user = create(:user) - proposal = create(:proposal, tag_list: "Sport" ) + proposal = create(:proposal, tag_list: "Sport") create(:follow, followable: proposal, user: user) login_as(user) end diff --git a/spec/models/debate_spec.rb b/spec/models/debate_spec.rb index 64dbf729f..3e1278bd7 100644 --- a/spec/models/debate_spec.rb +++ b/spec/models/debate_spec.rb @@ -725,10 +725,10 @@ describe Debate do end it "Should return debates ordered by cached_votes_total" do - debate1 = create(:debate, cached_votes_total: 1, tag_list: "Sport" ) - debate2 = create(:debate, cached_votes_total: 5, tag_list: "Sport" ) - debate3 = create(:debate, cached_votes_total: 10, tag_list: "Sport" ) - proposal = create(:proposal, tag_list: "Sport" ) + debate1 = create(:debate, cached_votes_total: 1, tag_list: "Sport") + debate2 = create(:debate, cached_votes_total: 5, tag_list: "Sport") + debate3 = create(:debate, cached_votes_total: 10, tag_list: "Sport") + proposal = create(:proposal, tag_list: "Sport") create(:follow, followable: proposal, user: user) result = Debate.recommendations(user).sort_by_recommendations @@ -741,7 +741,7 @@ describe Debate do it "Should return debates related with user interests" do debate1 = create(:debate, tag_list: "Sport") debate2 = create(:debate, tag_list: "Politics") - proposal1 = create(:proposal, tag_list: "Sport") + proposal1 = create(:proposal, tag_list: "Sport") create(:follow, followable: proposal1, user: user) result = Debate.recommendations(user) @@ -753,7 +753,7 @@ describe Debate do it "Should not return debates when user is the author" do debate1 = create(:debate, author: user, tag_list: "Sport") debate2 = create(:debate, tag_list: "Sport") - proposal = create(:proposal, tag_list: "Sport" ) + proposal = create(:proposal, tag_list: "Sport") create(:follow, followable: proposal, user: user) result = Debate.recommendations(user) diff --git a/spec/models/direct_upload_spec.rb b/spec/models/direct_upload_spec.rb index 5abe06765..8cfebf076 100644 --- a/spec/models/direct_upload_spec.rb +++ b/spec/models/direct_upload_spec.rb @@ -42,7 +42,7 @@ describe DirectUpload do proposal_document_direct_upload.save_attachment - expect(File.exists?(proposal_document_direct_upload.relation.attachment.path)).to eq(true) + expect(File.exist?(proposal_document_direct_upload.relation.attachment.path)).to eq(true) expect(proposal_document_direct_upload.relation.attachment.path).to include('cached_attachments') end @@ -57,7 +57,7 @@ describe DirectUpload do uploaded_path = proposal_document_direct_upload.relation.attachment.path proposal_document_direct_upload.destroy_attachment - expect(File.exists?(uploaded_path)).to eq(false) + expect(File.exist?(uploaded_path)).to eq(false) end end diff --git a/spec/models/map_location_spec.rb b/spec/models/map_location_spec.rb index bd093a71e..62070529e 100644 --- a/spec/models/map_location_spec.rb +++ b/spec/models/map_location_spec.rb @@ -2,7 +2,7 @@ require 'rails_helper' describe MapLocation do - let(:map_location) { build(:map_location, :proposal_map_location ) } + let(:map_location) { build(:map_location, :proposal_map_location) } it "should be valid" do expect(map_location).to be_valid diff --git a/spec/models/proposal_spec.rb b/spec/models/proposal_spec.rb index 588bd4057..29338a62f 100644 --- a/spec/models/proposal_spec.rb +++ b/spec/models/proposal_spec.rb @@ -903,10 +903,10 @@ describe Proposal do end it "Should return proposals ordered by cached_votes_up" do - proposal1 = create(:proposal, cached_votes_up: 1, tag_list: "Sport" ) - proposal2 = create(:proposal, cached_votes_up: 5, tag_list: "Sport" ) - proposal3 = create(:proposal, cached_votes_up: 10, tag_list: "Sport" ) - proposal4 = create(:proposal, tag_list: "Sport" ) + proposal1 = create(:proposal, cached_votes_up: 1, tag_list: "Sport") + proposal2 = create(:proposal, cached_votes_up: 5, tag_list: "Sport") + proposal3 = create(:proposal, cached_votes_up: 10, tag_list: "Sport") + proposal4 = create(:proposal, tag_list: "Sport") create(:follow, followable: proposal4, user: user) result = Proposal.recommendations(user).sort_by_recommendations diff --git a/spec/shared/features/mappable.rb b/spec/shared/features/mappable.rb index ccbcd5625..65ece1f25 100644 --- a/spec/shared/features/mappable.rb +++ b/spec/shared/features/mappable.rb @@ -2,7 +2,7 @@ shared_examples "mappable" do |mappable_factory_name, mappable_association_name, include ActionView::Helpers - let!(:user) { create(:user, :level_two) } + let!(:user) { create(:user, :level_two) } before do Setting['feature.map'] = true @@ -11,7 +11,7 @@ shared_examples "mappable" do |mappable_factory_name, mappable_association_name, describe "At #{mappable_new_path}" do let!(:arguments) { {} } - let!(:mappable) { create("#{mappable_factory_name}".to_sym) } + let!(:mappable) { create(mappable_factory_name.to_s.to_sym) } let!(:map_location) { create(:map_location, "#{mappable_factory_name}_map_location".to_sym, "#{mappable_association_name}": mappable) } before { set_arguments(arguments, mappable, mappable_path_arguments) } @@ -77,10 +77,10 @@ shared_examples "mappable" do |mappable_factory_name, mappable_association_name, describe "At #{mappable_edit_path}" do - let!(:mappable) { create("#{mappable_factory_name}".to_sym) } + let!(:mappable) { create(mappable_factory_name.to_s.to_sym) } let!(:map_location) { create(:map_location, "#{mappable_factory_name}_map_location".to_sym, "#{mappable_association_name}": mappable) } - before { skip } unless mappable_edit_path.present? + before { skip } if mappable_edit_path.blank? scenario "Should edit map on #{mappable_factory_name} and contain default values", :js do login_as mappable.author @@ -143,13 +143,13 @@ shared_examples "mappable" do |mappable_factory_name, mappable_association_name, describe "At #{mappable_show_path}" do let!(:arguments) { {} } - let!(:mappable) { create("#{mappable_factory_name}".to_sym) } + let!(:mappable) { create(mappable_factory_name.to_s.to_sym) } let!(:map_location) { create(:map_location, "#{mappable_factory_name}_map_location".to_sym, "#{mappable_association_name}": mappable) } before { set_arguments(arguments, mappable, mappable_path_arguments) } scenario "Should display map on #{mappable_factory_name} show page", :js do - arguments.merge!("id": mappable.id) + arguments[:id] = mappable.id visit send(mappable_show_path, arguments) @@ -157,9 +157,9 @@ shared_examples "mappable" do |mappable_factory_name, mappable_association_name, end scenario "Should not display map on #{mappable_factory_name} show when marker is not defined", :js do - mappable_without_map = create("#{mappable_factory_name}".to_sym) + mappable_without_map = create(mappable_factory_name.to_s.to_sym) set_arguments(arguments, mappable_without_map, mappable_path_arguments) - arguments.merge!("id": mappable_without_map.id) + arguments[:id] = mappable_without_map.id visit send(mappable_show_path, arguments) @@ -168,7 +168,7 @@ shared_examples "mappable" do |mappable_factory_name, mappable_association_name, scenario "Should not display map on #{mappable_factory_name} show page when feature.map is disable", :js do Setting['feature.map'] = false - arguments.merge!("id": mappable.id) + arguments[:id] = mappable.id visit send(mappable_show_path, arguments) @@ -212,9 +212,7 @@ def submit_budget_investment_form end def set_arguments(arguments, mappable, mappable_path_arguments) - if mappable_path_arguments - mappable_path_arguments.each do |argument_name, path_to_value| + mappable_path_arguments&.each do |argument_name, path_to_value| arguments.merge!("#{argument_name}": mappable.send(path_to_value)) - end end end diff --git a/spec/shared/features/nested_documentable.rb b/spec/shared/features/nested_documentable.rb index 24d6631a8..3661af408 100644 --- a/spec/shared/features/nested_documentable.rb +++ b/spec/shared/features/nested_documentable.rb @@ -199,8 +199,8 @@ shared_examples "nested documentable" do |login_as_name, documentable_factory_na find("#tab-documents-label").click expect(page).to have_content "empty.pdf" - #Review - #Doble check why the file is stored with a name different to empty.pdf + # Review + # Doble check why the file is stored with a name different to empty.pdf expect(page).to have_css("a[href$='.pdf']") end diff --git a/spec/shared/features/nested_imageable.rb b/spec/shared/features/nested_imageable.rb index 1eef9a269..947887afa 100644 --- a/spec/shared/features/nested_imageable.rb +++ b/spec/shared/features/nested_imageable.rb @@ -1,4 +1,4 @@ -shared_examples "nested imageable" do |imageable_factory_name, path, imageable_path_arguments, fill_resource_method_name, submit_button, imageable_success_notice, has_many_images=false| +shared_examples "nested imageable" do |imageable_factory_name, path, imageable_path_arguments, fill_resource_method_name, submit_button, imageable_success_notice, has_many_images = false| include ActionView::Helpers include ImagesHelper include ImageablesHelper @@ -9,15 +9,11 @@ shared_examples "nested imageable" do |imageable_factory_name, path, imageable_p let!(:imageable) { create(imageable_factory_name) } before do - if imageable_path_arguments - imageable_path_arguments.each do |argument_name, path_to_value| + imageable_path_arguments&.each do |argument_name, path_to_value| arguments.merge!("#{argument_name}": imageable.send(path_to_value)) - end end - if imageable.respond_to?(:author) - imageable.update(author: user) - end + imageable.update(author: user) if imageable.respond_to?(:author) end describe "at #{path}" do @@ -119,7 +115,7 @@ shared_examples "nested imageable" do |imageable_factory_name, path, imageable_p click_on submit_button if has_many_images - #Pending. Review soon and test + # Pending. Review soon and test else within "#nested-image .image" do expect(page).to have_content("can't be blank", count: 2) @@ -174,7 +170,7 @@ shared_examples "nested imageable" do |imageable_factory_name, path, imageable_p imageable_redirected_to_resource_show_or_navigate_to if has_many_images - #Pending. Review soon and test + # Pending. Review soon and test else expect(page).to have_selector "figure img" expect(page).to have_selector "figure figcaption" @@ -230,7 +226,7 @@ rescue return end -def imageable_attach_new_file(imageable_factory_name, path, success = true) +def imageable_attach_new_file(_imageable_factory_name, path, success = true) click_link "Add image" within "#nested-image" do image = find(".image") diff --git a/spec/support/common_actions.rb b/spec/support/common_actions.rb index a55ebd63c..b87a54d8e 100644 --- a/spec/support/common_actions.rb +++ b/spec/support/common_actions.rb @@ -163,7 +163,7 @@ module CommonActions expect(page).to have_content 'Document verified with Census' end - def confirm_phone(user=nil) + def confirm_phone(user = nil) user ||= User.last fill_in 'sms_phone', with: "611111111" From 7b40c8416664d3c9788a46e61353711a03a04f0c Mon Sep 17 00:00:00 2001 From: Bertocq Date: Tue, 17 Oct 2017 22:06:07 +0200 Subject: [PATCH 48/48] Rubocop fixes and rubocop todo update for those that can't be done right now --- .rubocop_todo.yml | 118 +++++++++++------------- app/helpers/imageables_helper.rb | 6 +- app/helpers/images_helper.rb | 2 +- app/helpers/welcome_helper.rb | 4 +- spec/models/poll/partial_result_spec.rb | 14 +-- 5 files changed, 65 insertions(+), 79 deletions(-) diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 072caad09..373bb213c 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -1,12 +1,12 @@ # This configuration was generated by # `rubocop --auto-gen-config` -# on 2017-07-07 21:23:30 +0200 using RuboCop version 0.49.1. +# on 2017-10-17 22:05:23 +0200 using RuboCop version 0.49.1. # The point is for the user to remove these configuration records # one by one as the offenses are removed from the code base. # Note that changes in the inspected code, or installation of new # versions of RuboCop, may require this file to be generated again. -# Offense count: 45 +# Offense count: 40 # Cop supports --auto-correct. # Configuration parameters: EnforcedHashRocketStyle, SupportedHashRocketStyles, EnforcedColonStyle, SupportedColonStyles, EnforcedLastArgumentHashStyle, SupportedLastArgumentHashStyles. # SupportedHashRocketStyles: key, separator, table @@ -14,11 +14,10 @@ # SupportedLastArgumentHashStyles: always_inspect, always_ignore, ignore_implicit, ignore_explicit Layout/AlignHash: Exclude: - - 'app/controllers/officing/results_controller.rb' - 'spec/controllers/legislation/annotations_controller_spec.rb' - 'spec/features/admin/banners_spec.rb' -# Offense count: 50 +# Offense count: 52 # Cop supports --auto-correct. # Configuration parameters: EnforcedStyle, SupportedStyles, IndentationWidth. # SupportedStyles: with_first_parameter, with_fixed_indentation @@ -33,7 +32,7 @@ Layout/ClosingParenthesisIndentation: - 'spec/models/legislation/annotation_spec.rb' - 'spec/rails_helper.rb' -# Offense count: 51 +# Offense count: 37 # Cop supports --auto-correct. # Configuration parameters: EnforcedStyle, SupportedStyles. # SupportedStyles: leading, trailing @@ -68,11 +67,10 @@ Layout/EmptyLines: Exclude: - 'app/controllers/admin/budget_investment_milestones_controller.rb' -# Offense count: 2 +# Offense count: 1 # Cop supports --auto-correct. Layout/EmptyLinesAroundMethodBody: Exclude: - - 'app/models/abilities/administrator.rb' - 'lib/graph_ql/api_types_creator.rb' # Offense count: 2 @@ -126,13 +124,13 @@ Layout/IndentationConsistency: - 'spec/models/legislation/draft_version_spec.rb' - 'spec/models/proposal_spec.rb' -# Offense count: 23 +# Offense count: 48 # Cop supports --auto-correct. # Configuration parameters: Width, IgnoredPatterns. Layout/IndentationWidth: Enabled: false -# Offense count: 7 +# Offense count: 6 # Cop supports --auto-correct. Layout/LeadingCommentSpace: Exclude: @@ -140,7 +138,6 @@ Layout/LeadingCommentSpace: - 'app/controllers/budgets/ballot/lines_controller.rb' - 'spec/features/budgets/ballots_spec.rb' - 'spec/features/comments/poll_questions_spec.rb' - - 'spec/features/officing/voters_spec.rb' - 'spec/support/common_actions.rb' # Offense count: 3 @@ -181,7 +178,7 @@ Layout/MultilineMethodCallBraceLayout: - 'spec/models/legislation/annotation_spec.rb' - 'spec/rails_helper.rb' -# Offense count: 71 +# Offense count: 59 # Cop supports --auto-correct. # Configuration parameters: EnforcedStyle, SupportedStyles, IndentationWidth. # SupportedStyles: aligned, indented, indented_relative_to_receiver @@ -201,7 +198,7 @@ Layout/MultilineMethodCallIndentation: - 'spec/models/proposal_spec.rb' - 'spec/models/user_spec.rb' -# Offense count: 8 +# Offense count: 7 # Cop supports --auto-correct. # Configuration parameters: EnforcedStyle, SupportedStyles, IndentationWidth. # SupportedStyles: aligned, indented @@ -264,22 +261,7 @@ Lint/LiteralInCondition: Exclude: - 'app/models/budget/investment.rb' -# Offense count: 51 -Lint/ParenthesesAsGroupedExpression: - Exclude: - - 'spec/factories.rb' - - 'spec/features/admin/organizations_spec.rb' - - 'spec/features/budgets/investments_spec.rb' - - 'spec/features/campaigns_spec.rb' - - 'spec/features/debates_spec.rb' - - 'spec/features/management/managed_users_spec.rb' - - 'spec/features/management/proposals_spec.rb' - - 'spec/features/management/spending_proposals_spec.rb' - - 'spec/features/management/users_spec.rb' - - 'spec/features/proposals_spec.rb' - - 'spec/models/debate_spec.rb' - -# Offense count: 13 +# Offense count: 3 # Cop supports --auto-correct. Lint/StringConversionInInterpolation: Exclude: @@ -308,7 +290,7 @@ Lint/UnusedMethodArgument: - 'app/mailers/mailer.rb' - 'app/models/abilities/everyone.rb' -# Offense count: 278 +# Offense count: 325 Lint/UselessAssignment: Enabled: false @@ -317,35 +299,46 @@ Lint/Void: Exclude: - 'app/controllers/polls_controller.rb' -# Offense count: 74 +# Offense count: 86 Metrics/AbcSize: - Max: 54 + Max: 64 -# Offense count: 454 +# Offense count: 487 # Configuration parameters: CountComments, ExcludedMethods. Metrics/BlockLength: - Max: 1071 - -# Offense count: 8 -# Configuration parameters: CountComments. -Metrics/ClassLength: - Max: 256 + Max: 1227 # Offense count: 10 +# Configuration parameters: CountComments. +Metrics/ClassLength: + Max: 262 + +# Offense count: 13 Metrics/CyclomaticComplexity: Max: 10 -# Offense count: 53 +# Offense count: 25 +# Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns. +# URISchemes: http, https +Metrics/LineLength: + Max: 248 + +# Offense count: 67 # Configuration parameters: CountComments. Metrics/MethodLength: - Max: 49 + Max: 56 # Offense count: 1 # Configuration parameters: CountComments. Metrics/ModuleLength: - Max: 214 + Max: 242 -# Offense count: 7 +# Offense count: 3 +# Configuration parameters: CountKeywordArgs. +Metrics/ParameterLists: + Max: 7 + +# Offense count: 8 Metrics/PerceivedComplexity: Max: 11 @@ -399,20 +392,20 @@ Rails/HttpPositionalArguments: - 'spec/controllers/pages_controller_spec.rb' - 'spec/controllers/users/registrations_controller_spec.rb' -# Offense count: 20 +# Offense count: 18 Rails/OutputSafety: Exclude: - 'app/controllers/admin/legislation/draft_versions_controller.rb' - 'app/controllers/admin/legislation/processes_controller.rb' - 'app/controllers/admin/legislation/questions_controller.rb' - 'app/controllers/budgets/investments_controller.rb' + - 'app/controllers/direct_uploads_controller.rb' - 'app/controllers/spending_proposals_controller.rb' - 'app/helpers/application_helper.rb' - 'app/helpers/text_with_links_helper.rb' - - 'app/helpers/users_helper.rb' - 'app/helpers/valuation_helper.rb' -# Offense count: 70 +# Offense count: 71 # Configuration parameters: Blacklist. # Blacklist: decrement!, decrement_counter, increment!, increment_counter, toggle!, touch, update_all, update_attribute, update_column, update_columns, update_counters Rails/SkipsModelValidations: @@ -428,7 +421,7 @@ Style/AccessorMethodName: - 'app/controllers/proposals_controller.rb' - 'lib/merged_comment_tree.rb' -# Offense count: 1 +# Offense count: 8 # Cop supports --auto-correct. # Configuration parameters: EnforcedStyle, SupportedStyles. # SupportedStyles: braces, no_braces, context_dependent @@ -438,7 +431,7 @@ Style/BracesAroundHashParameters: - 'spec/features/budgets/investments_spec.rb' - 'spec/features/proposals_spec.rb' -# Offense count: 119 +# Offense count: 123 # Configuration parameters: EnforcedStyle, SupportedStyles. # SupportedStyles: nested, compact Style/ClassAndModuleChildren: @@ -451,14 +444,13 @@ Style/ClassVars: - 'app/models/organization.rb' - 'app/models/user.rb' -# Offense count: 12 +# Offense count: 8 # Cop supports --auto-correct. # Configuration parameters: EnforcedStyle, SupportedStyles, SingleLineConditionsOnly, IncludeTernaryExpressions. # SupportedStyles: assign_to_condition, assign_inside_condition Style/ConditionalAssignment: Exclude: - 'app/controllers/admin/poll/booth_assignments_controller.rb' - - 'app/controllers/admin/poll/officer_assignments_controller.rb' - 'app/controllers/admin/poll/questions_controller.rb' - 'app/controllers/comments_controller.rb' - 'app/controllers/management/spending_proposals_controller.rb' @@ -484,7 +476,7 @@ Style/FileName: Style/GuardClause: Enabled: false -# Offense count: 12 +# Offense count: 11 # Cop supports --auto-correct. # Configuration parameters: MaxLineLength. Style/IfUnlessModifier: @@ -495,19 +487,19 @@ Style/IfUnlessModifier: - 'app/controllers/legislation/annotations_controller.rb' - 'app/controllers/valuation/budget_investments_controller.rb' - 'app/controllers/verification/letter_controller.rb' - - 'app/controllers/welcome_controller.rb' - 'app/helpers/embed_videos_helper.rb' - 'app/mailers/mailer.rb' - 'app/models/proposal.rb' - 'app/models/spending_proposal.rb' -# Offense count: 4 +# Offense count: 5 # Cop supports --auto-correct. # Configuration parameters: EnforcedStyle, SupportedStyles. # SupportedStyles: line_count_dependent, lambda, literal Style/Lambda: Exclude: - 'app/models/comment.rb' + - 'app/models/concerns/followable.rb' - 'app/models/direct_message.rb' - 'app/models/vote.rb' - 'lib/graph_ql/api_types_creator.rb' @@ -523,7 +515,7 @@ Style/MultilineIfThen: Exclude: - 'app/controllers/management/users_controller.rb' -# Offense count: 15 +# Offense count: 13 # Cop supports --auto-correct. Style/MutableConstant: Exclude: @@ -546,7 +538,7 @@ Style/MutableConstant: Style/NumericLiterals: MinDigits: 9 -# Offense count: 19 +# Offense count: 20 # Cop supports --auto-correct. # Configuration parameters: AutoCorrect, EnforcedStyle, SupportedStyles. # SupportedStyles: predicate, comparison @@ -574,7 +566,7 @@ Style/ParallelAssignment: - 'lib/active_model/dates.rb' - 'spec/support/common_actions.rb' -# Offense count: 11 +# Offense count: 10 # Configuration parameters: NamePrefix, NamePrefixBlacklist, NameWhitelist. # NamePrefix: is_, has_, have_ # NamePrefixBlacklist: is_, has_, have_ @@ -588,7 +580,6 @@ Style/PredicateName: - 'app/helpers/debates_helper.rb' - 'app/models/budget/ballot.rb' - 'app/models/user.rb' - - 'lib/census_api.rb' # Offense count: 4 # Cop supports --auto-correct. @@ -608,13 +599,14 @@ Style/RedundantBegin: - 'app/controllers/graphql_controller.rb' - 'app/models/legislation/annotation.rb' -# Offense count: 3 +# Offense count: 5 # Cop supports --auto-correct. # Configuration parameters: EnforcedStyle, SupportedStyles, AllowInnerSlashes. # SupportedStyles: slashes, percent_r, mixed Style/RegexpLiteral: Exclude: - 'app/helpers/embed_videos_helper.rb' + - 'app/models/poll/question/answer/video.rb' - 'spec/customization_engine_spec.rb' # Offense count: 6 @@ -633,22 +625,16 @@ Style/SafeNavigation: Exclude: - 'app/models/signature.rb' -# Offense count: 9 -# Configuration parameters: SupportedStyles. -# SupportedStyles: snake_case, camelCase -Style/VariableName: - EnforcedStyle: snake_case - -# Offense count: 107 +# Offense count: 93 # Configuration parameters: EnforcedStyle, SupportedStyles. # SupportedStyles: snake_case, normalcase, non_integer Style/VariableNumber: Enabled: false -# Offense count: 31 +# Offense count: 34 # Cop supports --auto-correct. # Configuration parameters: SupportedStyles, WordRegex. # SupportedStyles: percent, brackets Style/WordArray: EnforcedStyle: percent - MinSize: 9 + MinSize: 8 diff --git a/app/helpers/imageables_helper.rb b/app/helpers/imageables_helper.rb index efe3c88ce..8cae1b989 100644 --- a/app/helpers/imageables_helper.rb +++ b/app/helpers/imageables_helper.rb @@ -9,10 +9,10 @@ module ImageablesHelper end def imageable_max_file_size - bytesToMeg(Image::MAX_IMAGE_SIZE) + bytes_to_megabytes(Image::MAX_IMAGE_SIZE) end - def bytesToMeg(bytes) + def bytes_to_megabytes(bytes) bytes / Numeric::MEGABYTE end @@ -37,4 +37,4 @@ module ImageablesHelper max_file_size: imageable_max_file_size end -end \ No newline at end of file +end diff --git a/app/helpers/images_helper.rb b/app/helpers/images_helper.rb index 4e2bdff0e..208ccf5ab 100644 --- a/app/helpers/images_helper.rb +++ b/app/helpers/images_helper.rb @@ -22,7 +22,7 @@ module ImagesHelper image.errors[:attachment].join(', ') if image.errors.key?(:attachment) end - def image_bytesToMeg(bytes) + def image_bytes_to_megabytes(bytes) bytes / Numeric::MEGABYTE end diff --git a/app/helpers/welcome_helper.rb b/app/helpers/welcome_helper.rb index 7b12c5d6f..0b483468f 100644 --- a/app/helpers/welcome_helper.rb +++ b/app/helpers/welcome_helper.rb @@ -1,11 +1,11 @@ module WelcomeHelper def active_class(index) - "is-active is-in" if index == 0 + "is-active is-in" if index.zero? end def slide_display(index) - "display: none;" if index > 0 + "display: none;" if index.positive? end def recommended_path(recommended) diff --git a/spec/models/poll/partial_result_spec.rb b/spec/models/poll/partial_result_spec.rb index dd6176a06..07e6a7355 100644 --- a/spec/models/poll/partial_result_spec.rb +++ b/spec/models/poll/partial_result_spec.rb @@ -57,24 +57,24 @@ describe Poll::PartialResult do expect(partial_result.amount_log).to eq("") expect(partial_result.author_id_log).to eq("") - author_A = create(:poll_officer).user - author_B = create(:poll_officer).user - author_C = create(:poll_officer).user + author1 = create(:poll_officer).user + author2 = create(:poll_officer).user + author3 = create(:poll_officer).user partial_result.amount = 33 - partial_result.author_id = author_A.id + partial_result.author_id = author1.id partial_result.save! partial_result.amount = 32 - partial_result.author_id = author_B.id + partial_result.author_id = author2.id partial_result.save! partial_result.amount = 34 - partial_result.author_id = author_C.id + partial_result.author_id = author3.id partial_result.save! expect(partial_result.amount_log).to eq(":33:32") - expect(partial_result.author_id_log).to eq(":#{author_A.id}:#{author_B.id}") + expect(partial_result.author_id_log).to eq(":#{author1.id}:#{author2.id}") end end
    <%= t("admin.tags.index.title") %><%= t("admin.tags.index.topic") %> <%= t("admin.actions.actions") %>
    + <%= link_to t("admin.tags.destroy"), admin_tag_path(tag), method: :delete, class: "button hollow alert" %>
    - <%= t("officing.voters.show.no_actions") %> +