<%= social_share_button_tag("#{investment.title} #{setting['twitter_hashtag']}") %>
<% if browser.device.mobile? %>
-
diff --git a/app/views/debates/show.html.erb b/app/views/debates/show.html.erb
index 096369bc3..64eafc0ae 100644
--- a/app/views/debates/show.html.erb
+++ b/app/views/debates/show.html.erb
@@ -53,7 +53,7 @@
<%= social_share_button_tag("#{@debate.title} #{setting['twitter_hashtag']}") %>
<% if browser.device.mobile? %>
-
+
<%= t("social.whatsapp") %>
diff --git a/app/views/proposals/show.html.erb b/app/views/proposals/show.html.erb
index 5d184088d..af1173286 100644
--- a/app/views/proposals/show.html.erb
+++ b/app/views/proposals/show.html.erb
@@ -126,7 +126,7 @@
<%= social_share_button_tag("#{@proposal.title} #{setting['twitter_hashtag']}") %>
<% if browser.device.mobile? %>
-
+
<%= t("social.whatsapp") %>
diff --git a/app/views/shared/_advanced_search.html.erb b/app/views/shared/_advanced_search.html.erb
index 56157c4a7..558adc806 100644
--- a/app/views/shared/_advanced_search.html.erb
+++ b/app/views/shared/_advanced_search.html.erb
@@ -36,7 +36,6 @@
<%= text_field_tag 'advanced_search[date_min]',
params[:advanced_search].try(:[], :date_min),
- type: "date",
class: 'js-calendar' %>
@@ -45,7 +44,6 @@
<%= text_field_tag 'advanced_search[date_max]',
params[:advanced_search].try(:[], :date_max),
- type: "date",
class: 'js-calendar' %>
diff --git a/app/views/spending_proposals/show.html.erb b/app/views/spending_proposals/show.html.erb
index 4cdfb688b..4c5a041d3 100644
--- a/app/views/spending_proposals/show.html.erb
+++ b/app/views/spending_proposals/show.html.erb
@@ -45,7 +45,7 @@
<%= social_share_button_tag("#{@spending_proposal.title} #{setting['twitter_hashtag']}") %>
<% if browser.device.mobile? %>
-
+
<%= t("social.whatsapp") %>
diff --git a/spec/features/budgets/investments_spec.rb b/spec/features/budgets/investments_spec.rb
index 1d812bd7e..5446e0a0a 100644
--- a/spec/features/budgets/investments_spec.rb
+++ b/spec/features/budgets/investments_spec.rb
@@ -405,7 +405,7 @@ feature 'Budget Investments' do
budget.update(phase: "valuating")
end
- scenario "Sidebar in show should display supports text and supports" do
+ scenario "Sidebar in show should display support text and count" do
investment = create(:budget_investment, :selected, budget: budget)
create(:vote, votable: investment)
@@ -417,8 +417,8 @@ feature 'Budget Investments' do
end
end
- scenario "Index should display supports" do
- investment = create(:budget_investment, :selected, budget: budget, heading: heading)
+ scenario "Index should display support count" do
+ investment = create(:budget_investment, budget: budget, heading: heading)
create(:vote, votable: investment)
visit budget_investments_path(budget, heading_id: heading.id)
@@ -428,6 +428,18 @@ feature 'Budget Investments' do
end
end
+ scenario "Show should display support text and count" do
+ investment = create(:budget_investment, budget: budget, heading: heading)
+ create(:vote, votable: investment)
+
+ visit budget_investment_path(budget, investment)
+
+ within("#budget_investment_#{investment.id}") do
+ expect(page).to have_content "Supports"
+ expect(page).to have_content "1 support"
+ end
+ end
+
end
context "Balloting Phase" do
diff --git a/spec/features/debates_spec.rb b/spec/features/debates_spec.rb
index f16f416bf..bc01c94e2 100644
--- a/spec/features/debates_spec.rb
+++ b/spec/features/debates_spec.rb
@@ -640,6 +640,28 @@ feature 'Debates' do
end
end
+ scenario "Search by custom invalid date range", :js do
+ debate1 = create(:debate, created_at: 2.years.ago)
+ debate2 = create(:debate, created_at: 3.days.ago)
+ debate3 = create(:debate, created_at: 9.days.ago)
+
+ visit debates_path
+
+ click_link "Advanced search"
+ select "Customized", from: "js-advanced-search-date-min"
+ fill_in "advanced_search_date_min", with: "9"
+ fill_in "advanced_search_date_max", with: "444444444"
+ click_button "Filter"
+
+ within("#debates") do
+ expect(page).to have_css('.debate', count: 3)
+
+ expect(page).to have_content(debate1.title)
+ expect(page).to have_content(debate2.title)
+ expect(page).to have_content(debate3.title)
+ end
+ end
+
scenario "Search by multiple filters", :js do
ana = create :user, official_level: 1
john = create :user, official_level: 1
diff --git a/spec/features/proposals_spec.rb b/spec/features/proposals_spec.rb
index 18864dc9b..dbc5956cd 100644
--- a/spec/features/proposals_spec.rb
+++ b/spec/features/proposals_spec.rb
@@ -980,6 +980,28 @@ feature 'Proposals' do
end
end
+ scenario "Search by custom invalid date range", :js do
+ proposal1 = create(:proposal, created_at: 2.days.ago)
+ proposal2 = create(:proposal, created_at: 3.days.ago)
+ proposal3 = create(:proposal, created_at: 9.days.ago)
+
+ visit proposals_path
+
+ click_link "Advanced search"
+ select "Customized", from: "js-advanced-search-date-min"
+ fill_in "advanced_search_date_min", with: 4000.years.ago
+ fill_in "advanced_search_date_max", with: "wrong date"
+ click_button "Filter"
+
+ expect(page).to have_content("There are 3 citizen proposals")
+
+ within("#proposals") do
+ expect(page).to have_content(proposal1.title)
+ expect(page).to have_content(proposal2.title)
+ expect(page).to have_content(proposal3.title)
+ end
+ end
+
scenario "Search by multiple filters", :js do
ana = create :user, official_level: 1
john = create :user, official_level: 1
diff --git a/spec/models/budget/investment_spec.rb b/spec/models/budget/investment_spec.rb
index 3ab97c574..fa51f3cab 100644
--- a/spec/models/budget/investment_spec.rb
+++ b/spec/models/budget/investment_spec.rb
@@ -54,7 +54,7 @@ describe Budget::Investment do
expect(investment.group_id).to eq group_2.id
end
- describe "#unfeasibility_explanation" do
+ describe "#unfeasibility_explanation blank" do
it "should be valid if valuation not finished" do
investment.unfeasibility_explanation = ""
investment.valuation_finished = false
@@ -76,6 +76,29 @@ describe Budget::Investment do
end
end
+ describe "#price blank" do
+ it "should be valid if valuation not finished" do
+ investment.price = ""
+ investment.valuation_finished = false
+ expect(investment).to be_valid
+ end
+
+ it "should be valid if valuation finished and unfeasible" do
+ investment.price = ""
+ investment.unfeasibility_explanation = "reason"
+ investment.feasibility = "unfeasible"
+ investment.valuation_finished = true
+ expect(investment).to be_valid
+ end
+
+ it "should not be valid if valuation finished and feasible" do
+ investment.price = ""
+ investment.feasibility = "feasible"
+ investment.valuation_finished = true
+ expect(investment).to_not be_valid
+ end
+ end
+
describe "#code" do
let(:investment) { create(:budget_investment) }