Remove map page in debates
The map feature was never implemented for debates (only for proposals and budget investments) and it was crashing for debates because the page didn't load the geozones. And we don't have a "geozone" field in the debates form either. So we're removing the map page alongside its (pending implementation) tests.
This commit is contained in:
@@ -4,7 +4,7 @@ class DebatesController < ApplicationController
|
||||
include FlagActions
|
||||
include Translatable
|
||||
|
||||
before_action :authenticate_user!, except: [:index, :show, :map]
|
||||
before_action :authenticate_user!, except: [:index, :show]
|
||||
before_action :set_view, only: :index
|
||||
before_action :debates_recommendations, only: :index, if: :current_user
|
||||
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
<%= render "shared/map", new_url_path: new_debate_path %>
|
||||
@@ -8,7 +8,6 @@ resources :debates do
|
||||
end
|
||||
|
||||
collection do
|
||||
get :map
|
||||
get :suggest
|
||||
put "recommendations/disable", only: :index, controller: "debates", action: :disable_recommendations
|
||||
end
|
||||
|
||||
@@ -87,7 +87,6 @@ describe TagCloud do
|
||||
end
|
||||
|
||||
xit "returns tags scoped by category for debates"
|
||||
xit "returns tags scoped by geozone for debates"
|
||||
|
||||
it "orders tags by count" do
|
||||
3.times { create(:proposal, tag_list: "participation") }
|
||||
|
||||
@@ -668,69 +668,6 @@ describe "Debates" do
|
||||
expect(page).to have_content("User deleted")
|
||||
end
|
||||
|
||||
context "Filter" do
|
||||
context "By geozone" do
|
||||
let(:california) { Geozone.create(name: "California") }
|
||||
let(:new_york) { Geozone.create(name: "New York") }
|
||||
|
||||
before do
|
||||
create(:debate, geozone: california, title: "Bigger sequoias")
|
||||
create(:debate, geozone: california, title: "Green beach")
|
||||
create(:debate, geozone: new_york, title: "Sully monument")
|
||||
end
|
||||
|
||||
pending "From map" do
|
||||
visit debates_path
|
||||
|
||||
click_link "map"
|
||||
within("#html_map") do
|
||||
url = find("area[title='California']")[:href]
|
||||
visit url
|
||||
end
|
||||
|
||||
within("#debates") do
|
||||
expect(page).to have_css(".debate", count: 2)
|
||||
expect(page).to have_content("Bigger sequoias")
|
||||
expect(page).to have_content("Green beach")
|
||||
expect(page).not_to have_content("Sully monument")
|
||||
end
|
||||
end
|
||||
|
||||
pending "From geozone list" do
|
||||
visit debates_path
|
||||
|
||||
click_link "map"
|
||||
within("#geozones") do
|
||||
click_link "California"
|
||||
end
|
||||
within("#debates") do
|
||||
expect(page).to have_css(".debate", count: 2)
|
||||
expect(page).to have_content("Bigger sequoias")
|
||||
expect(page).to have_content("Green beach")
|
||||
expect(page).not_to have_content("Sully monument")
|
||||
end
|
||||
end
|
||||
|
||||
pending "From debate" do
|
||||
debate = create(:debate, geozone: california, title: "Surf college")
|
||||
|
||||
visit debate_path(debate)
|
||||
|
||||
within("#geozone") do
|
||||
click_link "California"
|
||||
end
|
||||
|
||||
within("#debates") do
|
||||
expect(page).to have_css(".debate", count: 3)
|
||||
expect(page).to have_content("Surf college")
|
||||
expect(page).to have_content("Bigger sequoias")
|
||||
expect(page).to have_content("Green beach")
|
||||
expect(page).not_to have_content("Sully monument")
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
context "Suggesting debates" do
|
||||
scenario "Shows up to 5 suggestions" do
|
||||
create(:debate, title: "First debate has 1 vote", cached_votes_up: 1)
|
||||
|
||||
Reference in New Issue
Block a user