From 2d3e3586d1531418ab2aceed988b43f65176c05b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juanjo=20Baza=CC=81n?= Date: Tue, 14 Mar 2017 13:30:31 +0100 Subject: [PATCH 01/16] updates capistrano scm config --- Capfile | 4 ++++ config/deploy.rb | 1 - 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/Capfile b/Capfile index 1a33b63f0..ea11eb9b6 100644 --- a/Capfile +++ b/Capfile @@ -12,6 +12,10 @@ require 'capistrano/delayed_job' require 'whenever/capistrano' require 'rvm1/capistrano3' +#SCM: Git +require "capistrano/scm/git" +install_plugin Capistrano::SCM::Git + # Load custom tasks from `lib/capistrano/tasks` if you have any defined Dir.glob('lib/capistrano/tasks/*.rake').each { |r| import r } Dir.glob('lib/capistrano/tasks/*.cap').each { |r| import r } diff --git a/config/deploy.rb b/config/deploy.rb index 52fa7a255..5b842cef6 100644 --- a/config/deploy.rb +++ b/config/deploy.rb @@ -15,7 +15,6 @@ set :full_app_name, deploysecret(:full_app_name) set :server_name, deploysecret(:server_name) set :repo_url, 'https://github.com/consul/consul.git' -set :scm, :git set :revision, `git rev-parse --short #{fetch(:branch)}`.strip set :log_level, :info From 85c5e584fb19f3d66312bc72c9e71a15b4267459 Mon Sep 17 00:00:00 2001 From: rgarcia Date: Wed, 15 Mar 2017 18:49:17 +0100 Subject: [PATCH 02/16] adds comprehensive specs for permissions to vote an investment --- spec/models/budget/investment_spec.rb | 39 +++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/spec/models/budget/investment_spec.rb b/spec/models/budget/investment_spec.rb index abbc8ad26..3725b91f3 100644 --- a/spec/models/budget/investment_spec.rb +++ b/spec/models/budget/investment_spec.rb @@ -285,6 +285,45 @@ describe Budget::Investment do expect(salamanca_investment.valid_heading?(user)).to eq(false) end + + it "allows votes in a group with a single heading" do + all_city_investment = create(:budget_investment, heading: heading) + expect(all_city_investment.valid_heading?(user)).to eq(true) + end + + it "allows votes in a group with a single heading after voting in that heading" do + all_city_investment1 = create(:budget_investment, heading: heading) + all_city_investment2 = create(:budget_investment, heading: heading) + + create(:vote, votable: all_city_investment1, voter: user) + + expect(all_city_investment2.valid_heading?(user)).to eq(true) + end + + it "allows votes in a group with a single heading after voting in another group" do + districts = create(:budget_group, budget: budget) + carabanchel = create(:budget_heading, group: districts) + + all_city_investment = create(:budget_investment, heading: heading) + carabanchel_investment = create(:budget_investment, heading: carabanchel) + + create(:vote, votable: carabanchel_investment, voter: user) + + expect(all_city_investment.valid_heading?(user)).to eq(true) + end + + it "allows votes in a group with multiple headings after voting in group with a single heading" do + districts = create(:budget_group, budget: budget) + carabanchel = create(:budget_heading, group: districts) + salamanca = create(:budget_heading, group: districts) + + all_city_investment = create(:budget_investment, heading: heading) + carabanchel_investment = create(:budget_investment, heading: carabanchel) + + create(:vote, votable: all_city_investment, voter: user) + + expect(carabanchel_investment.valid_heading?(user)).to eq(true) + end end end From dadfdba1b1fd34b74e54da63c0aafa611518ba83 Mon Sep 17 00:00:00 2001 From: Alberto Garcia Cabeza Date: Mon, 20 Mar 2017 11:59:22 +0100 Subject: [PATCH 03/16] adds date of birth form when manager creates new user --- app/controllers/management/users_controller.rb | 2 +- app/views/management/users/new.html.erb | 10 ++++++++-- config/locales/management.en.yml | 1 + config/locales/management.es.yml | 1 + spec/features/management/users_spec.rb | 2 ++ 5 files changed, 13 insertions(+), 3 deletions(-) diff --git a/app/controllers/management/users_controller.rb b/app/controllers/management/users_controller.rb index 53004a838..8d3d148fa 100644 --- a/app/controllers/management/users_controller.rb +++ b/app/controllers/management/users_controller.rb @@ -32,7 +32,7 @@ class Management::UsersController < Management::BaseController private def user_params - params.require(:user).permit(:document_type, :document_number, :username, :email) + params.require(:user).permit(:document_type, :document_number, :username, :email, :date_of_birth) end def destroy_session diff --git a/app/views/management/users/new.html.erb b/app/views/management/users/new.html.erb index 6602e4978..d52597590 100644 --- a/app/views/management/users/new.html.erb +++ b/app/views/management/users/new.html.erb @@ -4,7 +4,7 @@ message: t("management.document_verifications.in_census_has_following_permissions"), permissions: [:debates, :create_proposals, :support_proposals, :vote_proposals] %> -
+