diff --git a/app/controllers/guides_controller.rb b/app/controllers/guides_controller.rb
new file mode 100644
index 000000000..0a03955e9
--- /dev/null
+++ b/app/controllers/guides_controller.rb
@@ -0,0 +1,8 @@
+class GuidesController < ApplicationController
+
+ skip_authorization_check
+
+ def new
+ end
+
+end
\ No newline at end of file
diff --git a/app/helpers/guides_helper.rb b/app/helpers/guides_helper.rb
new file mode 100644
index 000000000..67658f52a
--- /dev/null
+++ b/app/helpers/guides_helper.rb
@@ -0,0 +1,19 @@
+module GuidesHelper
+
+ def new_proposal_guide
+ if feature?("guides")
+ new_guide_path
+ else
+ new_proposal_path
+ end
+ end
+
+ def new_budget_investment_guide
+ if feature?("guides")
+ new_guide_path
+ else
+ new_budget_investment_path(current_budget)
+ end
+ end
+
+end
\ No newline at end of file
diff --git a/app/views/budgets/index.html.erb b/app/views/budgets/index.html.erb
index 2b1905e29..345731170 100644
--- a/app/views/budgets/index.html.erb
+++ b/app/views/budgets/index.html.erb
@@ -27,7 +27,7 @@
<% if current_user %>
<% if current_user.level_two_or_three_verified? %>
<%= link_to t("budgets.investments.index.sidebar.create"),
- new_budget_investment_path(@budget),
+ new_budget_investment_guide,
class: "button margin-top expanded" %>
<% else %>
diff --git a/app/views/guides/new.html.erb b/app/views/guides/new.html.erb
new file mode 100644
index 000000000..3e62296bd
--- /dev/null
+++ b/app/views/guides/new.html.erb
@@ -0,0 +1,11 @@
+<% if current_budget %>
+
+ <%= link_to t("guides.new_budget_investment"),
+ new_budget_investment_path(current_budget) %>
+
+<% end %>
+
+
+ <%= link_to t("guides.new_proposal"),
+ new_proposal_path %>
+
\ No newline at end of file
diff --git a/app/views/proposals/index.html.erb b/app/views/proposals/index.html.erb
index b5710dfc7..ec9645369 100644
--- a/app/views/proposals/index.html.erb
+++ b/app/views/proposals/index.html.erb
@@ -63,7 +63,9 @@
<% if @proposals.any? %>
- <%= link_to t("proposals.index.start_proposal"), new_proposal_path, class: 'button expanded' %>
+ <%= link_to t("proposals.index.start_proposal"),
+ new_proposal_guide,
+ class: 'button expanded' %>
<% end %>
@@ -92,7 +94,9 @@
- <%= link_to t("proposals.index.start_proposal"), new_proposal_path, class: 'button expanded' %>
+ <%= link_to t("proposals.index.start_proposal"),
+ new_proposal_guide,
+ class: 'button expanded' %>
<% if params[:retired].blank? %>
<%= render 'categories' %>
<%= render "shared/tag_cloud", taggable: 'proposal' %>
diff --git a/config/locales/en/guides.yml b/config/locales/en/guides.yml
new file mode 100644
index 000000000..229bd15a3
--- /dev/null
+++ b/config/locales/en/guides.yml
@@ -0,0 +1,4 @@
+en:
+ guides:
+ new_proposal: I want to create a proposal
+ new_budget_investment: I want to create a budget investment
\ No newline at end of file
diff --git a/config/locales/es/guides.yml b/config/locales/es/guides.yml
new file mode 100644
index 000000000..b845e03f7
--- /dev/null
+++ b/config/locales/es/guides.yml
@@ -0,0 +1,4 @@
+es:
+ guides:
+ new_proposal: Quiero crear una propuesta
+ new_budget_investment: Quiero crear un nuevo proyecto de gasto
\ No newline at end of file
diff --git a/config/routes.rb b/config/routes.rb
index c85deab68..73d1443d2 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -18,6 +18,7 @@ Rails.application.routes.draw do
draw :direct_upload
draw :document
draw :graphql
+ draw :guide
draw :legislation
draw :management
draw :moderation
diff --git a/config/routes/guide.rb b/config/routes/guide.rb
new file mode 100644
index 000000000..65a514072
--- /dev/null
+++ b/config/routes/guide.rb
@@ -0,0 +1 @@
+resources :guides, only: :new
diff --git a/db/dev_seeds.rb b/db/dev_seeds.rb
index 940771d5b..5af1ef939 100644
--- a/db/dev_seeds.rb
+++ b/db/dev_seeds.rb
@@ -37,6 +37,7 @@ section "Creating Settings" do
Setting.create(key: 'url', value: 'http://localhost:3000')
Setting.create(key: 'org_name', value: 'CONSUL')
Setting.create(key: 'place_name', value: 'City')
+
Setting.create(key: 'feature.debates', value: "true")
Setting.create(key: 'feature.proposals', value: "true")
Setting.create(key: 'feature.polls', value: "true")
@@ -53,6 +54,8 @@ section "Creating Settings" do
Setting.create(key: 'feature.map', value: "true")
Setting.create(key: 'feature.allow_images', value: "true")
Setting.create(key: 'feature.public_stats', value: "true")
+ Setting.create(key: 'feature.guides', value: nil)
+
Setting.create(key: 'per_page_code_head', value: "")
Setting.create(key: 'per_page_code_body', value: "")
Setting.create(key: 'comments_body_max_length', value: '1000')
diff --git a/db/seeds.rb b/db/seeds.rb
index 529aaa925..008c81bdd 100644
--- a/db/seeds.rb
+++ b/db/seeds.rb
@@ -85,6 +85,7 @@ Setting['feature.user.recommendations'] = true
Setting['feature.community'] = true
Setting['feature.map'] = nil
Setting['feature.allow_images'] = true
+Setting['feature.guides'] = nil
# Spending proposals feature flags
Setting['feature.spending_proposal_features.voting_allowed'] = nil
diff --git a/spec/features/guides_spec.rb b/spec/features/guides_spec.rb
new file mode 100644
index 000000000..48572ee11
--- /dev/null
+++ b/spec/features/guides_spec.rb
@@ -0,0 +1,54 @@
+require 'rails_helper'
+
+feature 'Guide the user to create the correct resource' do
+
+ let(:user) { create(:user, :verified)}
+ let!(:budget) { create(:budget, :accepting) }
+
+ background do
+ Setting['feature.guides'] = true
+ end
+
+ after do
+ Setting['feature.guides'] = nil
+ end
+
+ scenario "Proposal" do
+ login_as(user)
+ visit proposals_path
+
+ click_link "Create a proposal"
+ click_link "I want to create a proposal"
+
+ expect(page).to have_current_path(new_proposal_path)
+ end
+
+ scenario "Budget Investment" do
+ login_as(user)
+ visit budgets_path
+
+ click_link "Create a budget investment"
+ click_link "I want to create a budget investment"
+
+ expect(page).to have_current_path(new_budget_investment_path(budget))
+ end
+
+ scenario "Feature deactivated" do
+ Setting['feature.guides'] = nil
+
+ login_as(user)
+
+ visit proposals_path
+ click_link "Create a proposal"
+
+ expect(page).to_not have_link "I want to create a proposal"
+ expect(page).to have_current_path(new_proposal_path)
+
+ visit budgets_path
+ click_link "Create a budget investment"
+
+ expect(page).to_not have_link "I want to create a new budget investment"
+ expect(page).to have_current_path(new_budget_investment_path(budget))
+ end
+
+end
\ No newline at end of file