Merge branch 'master' into legislation-module-stable

This commit is contained in:
Amaia Castro
2016-12-14 11:48:28 +01:00
29 changed files with 250 additions and 178 deletions

View File

@@ -7,7 +7,7 @@ gem 'pg', '~> 0.19.0'
# Use SCSS for stylesheets
gem 'sass-rails', '~> 5.0', '>= 5.0.4'
# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 3.0.3'
gem 'uglifier', '>= 3.0.4'
# Use CoffeeScript for .coffee assets and views
gem 'coffee-rails', '~> 4.2.1'
# See https://github.com/rails/execjs#readme for more supported runtimes
@@ -52,7 +52,7 @@ gem 'rollbar', '~> 2.13.3'
gem 'delayed_job_active_record', '~> 4.1.0'
gem 'daemons'
gem 'devise-async'
gem 'newrelic_rpm', '~> 3.17.0.325'
gem 'newrelic_rpm', '~> 3.17.1.326'
gem 'whenever', require: false
gem 'pg_search'
gem 'sitemap_generator'

View File

@@ -68,7 +68,7 @@ GEM
bcrypt (3.1.11)
browser (2.3.0)
builder (3.2.2)
bullet (5.2.0)
bullet (5.4.2)
activesupport (>= 3.0.0)
uniform_notifier (~> 1.10.0)
byebug (9.0.6)
@@ -112,12 +112,12 @@ GEM
execjs
coffee-script-source (1.10.0)
concurrent-ruby (1.0.2)
coveralls (0.8.15)
coveralls (0.8.17)
json (>= 1.8, < 3)
simplecov (~> 0.12.0)
term-ansicolor (~> 1.3)
thor (~> 0.19.1)
tins (>= 1.6.0, < 2)
tins (~> 1.6)
daemons (1.2.4)
dalli (2.7.6)
database_cleaner (1.5.3)
@@ -171,8 +171,8 @@ GEM
activesupport (>= 4.1)
railties (>= 4.1)
tzinfo (~> 1.2, >= 1.2.2)
fuubar (2.1.1)
rspec (~> 3.0)
fuubar (2.2.0)
rspec-core (~> 3.0)
ruby-progressbar (~> 1.4)
geocoder (1.4.0)
globalid (0.3.7)
@@ -187,7 +187,7 @@ GEM
httpi (2.4.1)
rack
i18n (0.7.0)
i18n-tasks (0.9.5)
i18n-tasks (0.9.6)
activesupport (>= 4.0.2)
ast (>= 2.1.0)
easy_translate (>= 0.5.0)
@@ -213,7 +213,7 @@ GEM
actionpack (>= 3.0.0)
activesupport (>= 3.0.0)
kgio (2.10.0)
knapsack (1.13.0)
knapsack (1.13.1)
rake
timecop (>= 0.1.0)
launchy (2.4.3)
@@ -232,14 +232,14 @@ GEM
mime-types-data (~> 3.2015)
mime-types-data (3.2016.0521)
mini_portile2 (2.1.0)
minitest (5.9.1)
minitest (5.10.1)
multi_json (1.12.1)
multi_xml (0.5.5)
multipart-post (2.0.0)
net-scp (1.2.1)
net-ssh (>= 2.6.5)
net-ssh (3.2.0)
newrelic_rpm (3.17.0.325)
newrelic_rpm (3.17.1.326)
nokogiri (1.6.8.1)
mini_portile2 (~> 2.1.0)
nori (2.6.0)
@@ -272,7 +272,7 @@ GEM
orm_adapter (0.5.0)
paranoia (2.2.0)
activerecord (>= 4.0, < 5.1)
parser (2.3.1.4)
parser (2.3.3.1)
ast (~> 2.2)
pg (0.19.0)
pg_search (1.0.6)
@@ -320,7 +320,7 @@ GEM
thor (>= 0.18.1, < 2.0)
rainbow (2.1.0)
raindrops (0.17.0)
rake (11.3.0)
rake (12.0.0)
redcarpet (3.3.4)
referer-parser (0.3.0)
request_store (1.3.1)
@@ -329,10 +329,6 @@ GEM
rinku (2.0.2)
rollbar (2.13.3)
multi_json
rspec (3.5.0)
rspec-core (~> 3.5.0)
rspec-expectations (~> 3.5.0)
rspec-mocks (~> 3.5.0)
rspec-core (3.5.4)
rspec-support (~> 3.5.0)
rspec-expectations (3.5.0)
@@ -405,15 +401,16 @@ GEM
sshkit (1.11.4)
net-scp (>= 1.1.2)
net-ssh (>= 2.8.0)
term-ansicolor (1.3.2)
term-ansicolor (1.4.0)
tins (~> 1.0)
terminal-table (1.5.2)
thor (0.19.1)
terminal-table (1.7.3)
unicode-display_width (~> 1.1.1)
thor (0.19.4)
thread (0.2.2)
thread_safe (0.3.5)
tilt (2.0.5)
timecop (0.8.1)
tins (1.11.0)
tins (1.13.0)
tolk (2.0.0)
rails (>= 4.0)
safe_yaml (>= 0.8.6)
@@ -426,7 +423,7 @@ GEM
tilt (>= 1.4, < 3)
tzinfo (1.2.2)
thread_safe (~> 0.1)
uglifier (3.0.3)
uglifier (3.0.4)
execjs (>= 0.3.0, < 3)
unicode-display_width (1.1.1)
unicorn (5.1.0)
@@ -495,7 +492,7 @@ DEPENDENCIES
knapsack
launchy
letter_opener_web (~> 1.3.0)
newrelic_rpm (~> 3.17.0.325)
newrelic_rpm (~> 3.17.1.326)
omniauth
omniauth-facebook (~> 3.0.0)
omniauth-google-oauth2 (~> 0.4.0)
@@ -524,7 +521,7 @@ DEPENDENCIES
tolk (~> 2.0.0)
turbolinks
turnout (~> 2.4.0)
uglifier (>= 3.0.3)
uglifier (>= 3.0.4)
unicorn (~> 5.1.0)
web-console (= 3.3.0)
whenever

View File

@@ -5,6 +5,7 @@
Citizen Participation and Open Government Application
[![Join the chat at https://gitter.im/consul/consul](https://badges.gitter.im/consul/consul.svg)](https://gitter.im/consul/consul?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
[![Build Status](https://travis-ci.org/consul/consul.svg?branch=master)](https://travis-ci.org/consul/consul)
[![Code Climate](https://codeclimate.com/github/consul/consul/badges/gpa.svg)](https://codeclimate.com/github/consul/consul)
[![Dependency Status](https://gemnasium.com/consul/consul.svg)](https://gemnasium.com/consul/consul)

View File

@@ -5,6 +5,7 @@
Aplicación de Participación Ciudadana y Gobierno Abierto
[![Join the chat at https://gitter.im/consul/consul](https://badges.gitter.im/consul/consul.svg)](https://gitter.im/consul/consul?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
[![Build Status](https://travis-ci.org/consul/consul.svg?branch=master)](https://travis-ci.org/consul/consul)
[![Code Climate](https://codeclimate.com/github/consul/consul/badges/gpa.svg)](https://codeclimate.com/github/consul/consul)
[![Dependency Status](https://gemnasium.com/consul/consul.svg)](https://gemnasium.com/consul/consul)

View File

@@ -57,15 +57,15 @@ $brand: #004A83;
$dark: darken($brand, 10%);
$text: #222222;
$text-medium: #999999;
$text-light: #CCCCCC;
$text-medium: #515151;
$text-light: #BFBFBF;
$border: #DEE0E3;
$link: #2895F1;
$link: $brand;
$link-hover: darken($link, 20%);
$debates: #008CCF;
$debates: $brand;
$like: #7BD2A8;
$unlike: #EF8585;
@@ -74,6 +74,7 @@ $delete: #F04124;
$check: #46DB91;
$proposals: #FFA42D;
$proposals-dark: #794500;
$budget: #454372;
$budget-hover: #7571BF;

View File

@@ -56,6 +56,7 @@ a {
}
&:focus {
color: $link-hover;
outline: 3px solid #ffbf47;
}
}
@@ -258,6 +259,10 @@ a {
margin: 0 $line-height/2;
}
.pagination .current {
background: $brand;
}
// 02. Header
// ----------
@@ -1160,7 +1165,7 @@ table {
top: 0;
}
&:hover {
&:hover, &:focus {
background: white;
color: #40A2D1;
}
@@ -1200,7 +1205,7 @@ table {
top: 0;
}
&:hover {
&:hover, &:focus {
background: white;
color: #354F88;
}
@@ -1240,7 +1245,7 @@ table {
top: 0;
}
&:hover {
&:hover, &:focus {
background: white;
color: #CE3E26;
}
@@ -1284,7 +1289,8 @@ table {
top: 0;
}
&:hover {
&:hover, &:focus {
background: white;
color: #40A2D1;
}
}
@@ -1307,7 +1313,8 @@ table {
top: 0;
}
&:hover {
&:hover, &:focus {
background: white;
color: #354F88;
}
}
@@ -1330,7 +1337,8 @@ table {
top: 0;
}
&:hover {
&:hover, &:focus {
background: white;
color: #CE3E26;
}
}

View File

@@ -528,7 +528,7 @@
}
.label-proposal {
color: $proposals;
color: $proposals-dark;
}
.label-investment-project {
@@ -566,7 +566,7 @@
}
.icon-proposals {
color: $proposals;
color: $proposals-dark;
}
.icon-budget {

View File

@@ -163,7 +163,6 @@ class User < ActiveRecord::Base
username: nil,
email: nil,
unconfirmed_email: nil,
document_number: nil,
phone_number: nil,
encrypted_password: "",
confirmation_token: nil,

View File

@@ -10,7 +10,7 @@ class Verification::Management::Document
delegate :username, :email, to: :user, allow_nil: true
def user
@user = User.by_document(document_type, document_number).first
@user = User.active.by_document(document_type, document_number).first
end
def user?

View File

@@ -41,7 +41,7 @@
</p>
<div class="debate-description">
<%= link_to debate.description, debate %>
<%= debate.description %>
<div class="truncate"></div>
</div>
<%= render "shared/tags", taggable: debate, limit: 5 %>

View File

@@ -1,23 +1,41 @@
<% voted_classes = css_classes_for_vote(@debate_votes, debate) %>
<div class="votes">
<div class="in-favor inline-block">
<%= link_to vote_debate_path(debate, value: 'yes'),
class: "like #{voted_classes[:in_favor]}", title: t('votes.agree'), method: "post", remote: true do %>
<span class="icon-like">
<span class="sr-only"><%= t('votes.agree') %></span>
</span>
<span class="percentage"><%= votes_percentage('likes', debate) %></span>
<% if user_signed_in? %>
<%= link_to vote_debate_path(debate, value: 'yes'),
class: "like #{voted_classes[:in_favor]}", title: t('votes.agree'), method: "post", remote: true do %>
<span class="icon-like">
<span class="sr-only"><%= t('votes.agree') %></span>
</span>
<span class="percentage"><%= votes_percentage('likes', debate) %></span>
<% end %>
<% else %>
<div class="like">
<span class="icon-like">
<span class="sr-only"><%= t('votes.agree') %></span>
</span>
<span class="percentage"><%= votes_percentage('likes', debate) %></span>
</div>
<% end %>
</div>
<span class="divider"></span>
<div class="against inline-block">
<%= link_to vote_debate_path(debate, value: 'no'), class: "unlike #{voted_classes[:against]}", title: t('votes.disagree'), method: "post", remote: true do %>
<span class="icon-unlike">
<span class="sr-only"><%= t('votes.disagree') %></span>
</span>
<span class="percentage"><%= votes_percentage('dislikes', debate) %></span>
<% if user_signed_in? %>
<%= link_to vote_debate_path(debate, value: 'no'), class: "unlike #{voted_classes[:against]}", title: t('votes.disagree'), method: "post", remote: true do %>
<span class="icon-unlike">
<span class="sr-only"><%= t('votes.disagree') %></span>
</span>
<span class="percentage"><%= votes_percentage('dislikes', debate) %></span>
<% end %>
<% else %>
<div class="unlike">
<span class="icon-unlike">
<span class="sr-only"><%= t('votes.disagree') %></span>
</span>
<span class="percentage"><%= votes_percentage('dislikes', debate) %></span>
</div>
<% end %>
</div>
@@ -39,10 +57,12 @@
</p>
</div>
<% elsif !user_signed_in? %>
<div class="participation-not-allowed" style='display:none' aria-hidden="false">
<%= t("votes.unauthenticated",
signin: link_to(t("votes.signin"), new_user_session_path),
signup: link_to(t("votes.signup"), new_user_registration_path)).html_safe %>
<div tabindex="0">
<div class="participation-not-allowed" style='display:none' aria-hidden="false">
<%= t("votes.unauthenticated",
signin: link_to(t("votes.signin"), new_user_session_path),
signup: link_to(t("votes.signup"), new_user_registration_path)).html_safe %>
</div>
</div>
<% end %>
</div>

View File

@@ -1,22 +1,19 @@
<%= paginator.render do -%>
<div class="pagination-centered">
<nav>
<h2 class="sr-only"><%= t("shared.outline.pagination") %></h2>
<ul class="pagination text-center margin-top" aria-label="Pagination">
<%= first_page_tag unless current_page.first? %>
<%= prev_page_tag unless current_page.first? %>
<ul class="pagination text-center margin-top" aria-label="Pagination">
<%= first_page_tag unless current_page.first? %>
<%= prev_page_tag unless current_page.first? %>
<% each_page do |page| -%>
<% if page.left_outer? || page.right_outer? || page.inside_window? -%>
<%= page_tag page %>
<% elsif !page.was_truncated? -%>
<%= gap_tag %>
<% end -%>
<% each_page do |page| -%>
<% if page.left_outer? || page.right_outer? || page.inside_window? -%>
<%= page_tag page %>
<% elsif !page.was_truncated? -%>
<%= gap_tag %>
<% end -%>
<% end -%>
<%= next_page_tag unless current_page.last? %>
<%= last_page_tag unless current_page.last? %>
</ul>
</nav>
<%= next_page_tag unless current_page.last? %>
<%= last_page_tag unless current_page.last? %>
</ul>
</div>
<% end -%>

View File

@@ -40,7 +40,7 @@
</tr>
<tr>
<td class="text-center">S</td>
<td>Presupuestos ciudadanos</td>
<td>Presupuestos participativos</td>
</tr>
<tr>
<td class="text-center">I</td>

View File

@@ -8,8 +8,8 @@
</div>
<div class="small-12 medium-9 column">
<h1>¿Cómo funcionan los presupuestos ciudadanos?</h1>
<h1>¿Cómo funcionan los Presupuestos participativos?</h1>
<h2 id="i">Explicación detallada del proceso</h2>
<p>Próximamente se podrá encontrar aquí una descripción del proceso de participación ciudadana en los presupuestos.</p>
<p>Descripción del proceso de participación ciudadana en los presupuestos.</p>
</div>
</div>

View File

@@ -1,3 +1,4 @@
<% provide :title do %><%= t("proposal_ballots.title") %><% end %>
<div class="expanded no-margin-top margin-bottom dark-heading">
<div class="row" data-equalizer>
<div class="small-12 medium-6 column padding" data-equalizer-watch>

View File

@@ -44,7 +44,7 @@
<% end %>
</p>
<div class="proposal-description">
<p><%= link_to proposal.summary, namespaced_proposal_path(proposal) %></p>
<p><%= proposal.summary %></p>
<div class="truncate"></div>
</div>
<% end %>
@@ -53,20 +53,22 @@
</div>
<div id="<%= dom_id(proposal) %>_votes" class="small-12 medium-3 column supports-container">
<div class="supports text-center">
<% if proposal.successfull? %>
<% if proposal.successfull? %>
<div class="padding text-center">
<p>
<%= t("proposal_ballots.successfull",
voting: link_to(t("proposal_ballots.voting"), proposal_ballots_path)).html_safe %>
</p>
<% elsif proposal.archived? %>
</div>
<% elsif proposal.archived? %>
<div class="padding text-center">
<strong><%= t("proposals.proposal.supports", count: proposal.total_votes) %></strong>
<p><%= t("proposals.proposal.archived") %></p>
<% else %>
<%= render 'votes',
{ proposal: proposal, vote_url: vote_proposal_path(proposal, value: 'yes') } %>
<% end %>
</div>
</div>
<% else %>
<%= render 'votes',
{ proposal: proposal, vote_url: vote_proposal_path(proposal, value: 'yes') } %>
<% end %>
</div>
</div>
</div>

View File

@@ -1,56 +1,66 @@
<div class="progress small-12 round">
<span class="meter" style="width: <%= progress_bar_percentage(proposal) %>%;"></span>
<span class="percentage">
<%= supports_percentage(proposal) %>&nbsp;/&nbsp;<%= t("proposals.proposal.total_percent") %>
</span>
</div>
<div class="supports text-center">
<div class="progress small-12 round">
<span class="meter" style="width: <%= progress_bar_percentage(proposal) %>%;"></span>
<span class="percentage">
<%= supports_percentage(proposal) %>&nbsp;/&nbsp;<%= t("proposals.proposal.total_percent") %>
</span>
</div>
<span class="total-supports">
<%= t("proposals.proposal.supports", count: proposal.total_votes) %>&nbsp;
<span>
<abbr title="<%= t("proposals.proposal.reason_for_supports_necessary") %>">
<%= t("proposals.proposal.supports_necessary", number: number_with_delimiter(Proposal.votes_needed_for_success)) %>
</abbr>
<span class="total-supports">
<%= t("proposals.proposal.supports", count: proposal.total_votes) %>&nbsp;
<span>
<abbr title="<%= t("proposals.proposal.reason_for_supports_necessary") %>">
<%= t("proposals.proposal.supports_necessary", number: number_with_delimiter(Proposal.votes_needed_for_success)) %>
</abbr>
</span>
</span>
</span>
<div class="in-favor">
<% if voted_for?(@proposal_votes, proposal) %>
<div class="supported callout success">
<%= t("proposals.proposal.already_supported") %>
</div>
<% else %>
<%= link_to vote_url,
class: "button button-support small expanded",
title: t('proposals.proposal.support_title'), method: "post", remote: true do %>
<%= t("proposals.proposal.support") %>
<div class="in-favor">
<% if voted_for?(@proposal_votes, proposal) %>
<div class="supported callout success">
<%= t("proposals.proposal.already_supported") %>
</div>
<% elsif user_signed_in? && proposal.votable_by?(current_user) %>
<%= link_to vote_url,
class: "button button-support small expanded",
title: t('proposals.proposal.support_title'), method: "post", remote: true do %>
<%= t("proposals.proposal.support") %>
<% end %>
<% else %>
<div class="button button-support small expanded">
<%= t("proposals.proposal.support") %>
</div>
<% end %>
</div>
<% if user_signed_in? && current_user.organization? %>
<div class="participation-not-allowed" style='display:none' aria-hidden="false">
<p>
<%= t("votes.organizations") %>
</p>
</div>
<% elsif user_signed_in? && !proposal.votable_by?(current_user) %>
<div tabindex="0">
<div class="participation-not-allowed" style='display:none' aria-hidden="false">
<p>
<%= t("votes.verified_only",
verify_account: link_to(t("votes.verify_account"), verification_path )).html_safe %>
</p>
</div>
</div>
<% elsif !user_signed_in? %>
<div tabindex="0">
<div class="participation-not-allowed" style='display:none' aria-hidden="false">
<%= t("votes.unauthenticated",
signin: link_to(t("votes.signin"), new_user_session_path),
signup: link_to(t("votes.signup"), new_user_registration_path)).html_safe %>
</div>
</div>
<% end %>
<% if voted_for?(@proposal_votes, proposal) && setting['twitter_handle'] %>
<div class="share-supported">
<%= social_share_button_tag("#{proposal.title} #{setting['twitter_hashtag']}", url: proposal_url(proposal), via: setting['twitter_handle']) %>
</div>
<% end %>
</div>
<% if user_signed_in? && current_user.organization? %>
<div class="participation-not-allowed" style='display:none' aria-hidden="false">
<p>
<%= t("votes.organizations") %>
</p>
</div>
<% elsif user_signed_in? && !proposal.votable_by?(current_user)%>
<div class="participation-not-allowed" style='display:none' aria-hidden="false">
<p>
<%= t("votes.verified_only",
verify_account: link_to(t("votes.verify_account"), verification_path )).html_safe %>
</p>
</div>
<% elsif !user_signed_in? %>
<div class="participation-not-allowed" style='display:none' aria-hidden="false">
<%= t("votes.unauthenticated",
signin: link_to(t("votes.signin"), new_user_session_path),
signup: link_to(t("votes.signup"), new_user_registration_path)).html_safe %>
</div>
<% end %>
<% if voted_for?(@proposal_votes, proposal) && setting['twitter_handle'] %>
<div class="share-supported">
<%= social_share_button_tag("#{proposal.title} #{setting['twitter_hashtag']}", url: proposal_url(proposal), via: setting['twitter_handle']) %>
</div>
<% end %>

View File

@@ -102,17 +102,21 @@
<aside class="small-12 medium-3 column">
<div class="sidebar-divider"></div>
<h2><%= t("votes.supports") %></h2>
<div id="<%= dom_id(@proposal) %>_votes" class="supports text-center">
<div id="<%= dom_id(@proposal) %>_votes">
<% if @proposal.successfull? %>
<p>
<%= t("proposal_ballots.successfull",
voting: link_to(t("proposal_ballots.voting"), proposal_ballots_path)).html_safe %>
</p>
<div class="padding text-center">
<p>
<%= t("proposal_ballots.successfull",
voting: link_to(t("proposal_ballots.voting"), proposal_ballots_path)).html_safe %>
</p>
</div>
<% elsif @proposal.archived? %>
<p>
<strong><%= t("proposals.proposal.supports", count: @proposal.total_votes) %></strong>
</p>
<p><%= t("proposals.proposal.archived") %></p>
<div class="padding text-center">
<p>
<strong><%= t("proposals.proposal.supports", count: @proposal.total_votes) %></strong>
</p>
<p><%= t("proposals.proposal.archived") %></p>
</div>
<% else %>
<%= render 'votes',
{ proposal: @proposal, vote_url: vote_proposal_path(@proposal, value: 'yes') } %>

View File

@@ -29,19 +29,21 @@
</div>
<div id='js-custom-date' class='small-12 large-8 column' style="display: none">
<div class='small-12 large-6 column'>
<label><%= t("shared.advanced_search.from") %></label>
<%= text_field_tag 'advanced_search[date_min]',
params[:advanced_search].try(:[], :date_min),
placeholder: t("shared.advanced_search.date_placeholder"),
class: 'js-calendar' %>
</div>
<div class='small-12 large-6 column'>
<label><%= t("shared.advanced_search.to") %></label>
<%= text_field_tag 'advanced_search[date_max]',
params[:advanced_search].try(:[], :date_max),
placeholder: t("shared.advanced_search.date_placeholder"),
class: 'js-calendar' %>
<div class="row">
<div class='small-12 large-6 column'>
<label><%= t("shared.advanced_search.from") %> (<%= t("shared.advanced_search.date_placeholder") %>)</label>
<%= text_field_tag 'advanced_search[date_min]',
params[:advanced_search].try(:[], :date_min),
placeholder: t("shared.advanced_search.date_placeholder"),
class: 'js-calendar' %>
</div>
<div class='small-12 large-6 column'>
<label><%= t("shared.advanced_search.to") %> (<%= t("shared.advanced_search.date_placeholder") %>)</label>
<%= text_field_tag 'advanced_search[date_max]',
params[:advanced_search].try(:[], :date_max),
placeholder: t("shared.advanced_search.date_placeholder"),
class: 'js-calendar' %>
</div>
</div>
</div>
</div>

View File

@@ -10,6 +10,6 @@
</div>
<div class="sidebar-divider"></div>
<h3 class="sidebar-title"><%= t("spending_proposals.index.sidebar.feasibility") %></h3>
<h2 class="sidebar-title"><%= t("spending_proposals.index.sidebar.feasibility") %></h2>
<br>
<%= link_to t('spending_proposals.index.sidebar.unfeasible'), spending_proposals_path(unfeasible: '1') %>

View File

@@ -455,7 +455,6 @@ en:
debates: Debates
proposals: Proposals
budget: Participatory budget
pagination: Pagination
searcher: Searcher
social:
blog: Blog

View File

@@ -212,7 +212,7 @@ es:
proposals: Propuestas
proposal_ballot: Votaciones
see_all: Ver propuestas
spending_proposals: Presupuestos ciudadanos
spending_proposals: Presupuestos participativos
legacy_legislation:
help:
alt: Selecciona el texto que quieres comentar y pulsa en el botón con el lápiz.
@@ -454,8 +454,7 @@ es:
outline:
debates: Debates
proposals: Propuestas
budget: Presupuestos ciudadanos
pagination: Paginación
budget: Presupuestos participativos
searcher: Buscador
social:
blog: Blog

View File

@@ -17,7 +17,8 @@ feature 'Debates' do
debates.each do |debate|
within('#debates') do
expect(page).to have_content debate.title
expect(page).to have_css("a[href='#{debate_path(debate)}']", text: debate.description)
expect(page).to have_content debate.description
expect(page).to have_css("a[href='#{debate_path(debate)}']", text: debate.title)
end
end
end

View File

@@ -100,9 +100,9 @@ feature 'Proposals' do
within("#proposals") do
expect(page).to have_css('.proposal', count: 1)
expect(page).to have_content(proposal1.title)
expect(page).to have_content(proposal1.summary)
expect(page).to_not have_content(proposal2.title)
expect(page).to have_css("a[href='#{management_proposal_path(proposal1)}']", text: proposal1.title)
expect(page).to have_css("a[href='#{management_proposal_path(proposal1)}']", text: proposal1.summary)
end
end
@@ -127,9 +127,9 @@ feature 'Proposals' do
within("#proposals") do
expect(page).to have_css('.proposal', count: 2)
expect(page).to have_css("a[href='#{management_proposal_path(proposal1)}']", text: proposal1.title)
expect(page).to have_css("a[href='#{management_proposal_path(proposal1)}']", text: proposal1.summary)
expect(page).to have_content(proposal1.summary)
expect(page).to have_css("a[href='#{management_proposal_path(proposal2)}']", text: proposal2.title)
expect(page).to have_css("a[href='#{management_proposal_path(proposal2)}']", text: proposal2.summary)
expect(page).to have_content(proposal2.summary)
end
end

View File

@@ -22,8 +22,8 @@ feature 'Proposals' do
proposals.each do |proposal|
within('#proposals') do
expect(page).to have_content proposal.title
expect(page).to have_content proposal.summary
expect(page).to have_css("a[href='#{proposal_path(proposal)}']", text: proposal.title)
expect(page).to have_css("a[href='#{proposal_path(proposal)}']", text: proposal.summary)
end
end
end

View File

@@ -102,4 +102,24 @@ feature 'Residence' do
expect(page).to have_content "You have reached the maximum number of attempts. Please try again later."
expect(current_path).to eq(account_path)
end
scenario 'Error when trying to verify a deregistered account' do
create(:user, document_number: '12345678Z', document_type: '1', erased_at: Time.now)
login_as(create(:user))
visit account_path
click_link 'Verify my account'
fill_in 'residence_document_number', with: "12345678Z"
select 'DNI', from: 'residence_document_type'
select_date '31-December-1980', from: 'residence_date_of_birth'
fill_in 'residence_postal_code', with: '28013'
check 'residence_terms_of_service'
click_button 'Verify residence'
expect(page).to_not have_content 'Residence verified'
expect(page).to have_content 'has already been taken'
end
end

View File

@@ -336,7 +336,7 @@ describe SpendingProposal do
it "does not get updated if the user is erased" do
user.erase
expect(user.document_number).to be_blank
expect(user.erased_at).to be
spending_proposal.touch
expect(spending_proposal.responsible_name).to eq("123456")
end

View File

@@ -415,48 +415,58 @@ describe User do
end
describe "#erase" do
it "anonymizes a user and marks him as hidden" do
it "erases user information and marks him as erased" do
user = create(:user,
username: "manolo",
email: "a@a.com",
unconfirmed_email: "a@a.com",
document_number: "1234",
phone_number: "5678",
confirmed_phone: "5678",
unconfirmed_phone: "5678",
encrypted_password: "foobar",
confirmation_token: "token1",
reset_password_token: "token2",
email_verification_token: "token3",
confirmed_phone:"5678",
unconfirmed_phone:"5678")
email_verification_token: "token3")
user.erase('a test')
user.reload
expect(user.erase_reason).to eq('a test')
expect(user.erased_at).to be
expect(user.erased_at).to be
expect(user.username).to be_nil
expect(user.email).to be_nil
expect(user.unconfirmed_email).to be_nil
expect(user.document_number).to be_nil
expect(user.phone_number).to be_nil
expect(user.confirmed_phone).to be_nil
expect(user.unconfirmed_phone).to be_nil
expect(user.encrypted_password).to be_empty
expect(user.confirmation_token).to be_nil
expect(user.reset_password_token).to be_nil
expect(user.email_verification_token).to be_nil
end
it "destroys associated identities" do
it "maintains associated identification document" do
user = create(:user,
document_number: "1234",
document_type: "1")
user.erase
user.reload
expect(user.erased_at).to be
expect(user.document_number).to be
expect(user.document_type).to be
end
it "destroys associated social network identities" do
user = create(:user)
identity = create(:identity, user: user)
user.erase('an identity test')
expect(Identity.exists?(identity.id)).to_not be
end
end
end

View File

@@ -156,7 +156,7 @@ module CommonActions
def expect_message_you_need_to_sign_in
expect(page).to have_content 'You must Sign in or Sign up to continue'
expect(page).to have_selector('.in-favor a', visible: false)
expect(page).to have_selector('.in-favor', visible: false)
end
def expect_message_you_need_to_sign_in_to_vote_comments
@@ -172,7 +172,7 @@ module CommonActions
def expect_message_only_verified_can_vote_proposals
expect(page).to have_content 'Only verified users can vote on proposals'
expect(page).to have_selector('.in-favor a', visible: false)
expect(page).to have_selector('.in-favor', visible: false)
end
def expect_message_voting_not_allowed