diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 224ff26eb..3e1b78d31 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -114,8 +114,4 @@ class ApplicationController < ActionController::Base store_location_for(:user, request.path) end end - - def redirect_timestamp_spam - redirect_to root_path, notice: InvisibleCaptcha.timestamp_error_message - end end diff --git a/app/controllers/debates_controller.rb b/app/controllers/debates_controller.rb index 67f40ce6c..e077e5e8a 100644 --- a/app/controllers/debates_controller.rb +++ b/app/controllers/debates_controller.rb @@ -11,7 +11,7 @@ class DebatesController < ApplicationController feature_flag :debates - invisible_captcha only: [:create, :update], honeypot: :subtitle, on_timestamp_spam: :redirect_timestamp_spam + invisible_captcha only: [:create, :update], honeypot: :subtitle has_orders %w{hot_score confidence_score created_at relevance}, only: :index has_orders %w{most_voted newest oldest}, only: :show diff --git a/app/controllers/organizations/registrations_controller.rb b/app/controllers/organizations/registrations_controller.rb index 29d45a108..503c26bc0 100644 --- a/app/controllers/organizations/registrations_controller.rb +++ b/app/controllers/organizations/registrations_controller.rb @@ -1,6 +1,6 @@ class Organizations::RegistrationsController < Devise::RegistrationsController - invisible_captcha only: [:create], honeypot: :address, scope: :user, on_timestamp_spam: :redirect_timestamp_spam + invisible_captcha only: [:create], honeypot: :address, scope: :user def new super do |user| diff --git a/app/controllers/proposals_controller.rb b/app/controllers/proposals_controller.rb index 78b6977c8..2c349bd60 100644 --- a/app/controllers/proposals_controller.rb +++ b/app/controllers/proposals_controller.rb @@ -11,7 +11,7 @@ class ProposalsController < ApplicationController before_action :load_geozones, only: [:edit, :map, :summary] before_action :authenticate_user!, except: [:index, :show, :map, :summary] - invisible_captcha only: [:create, :update], honeypot: :subtitle, on_timestamp_spam: :redirect_timestamp_spam + invisible_captcha only: [:create, :update], honeypot: :subtitle has_orders %w{hot_score confidence_score created_at relevance}, only: :index has_orders %w{most_voted newest oldest}, only: :show diff --git a/app/controllers/spending_proposals_controller.rb b/app/controllers/spending_proposals_controller.rb index 870e32814..3f590f414 100644 --- a/app/controllers/spending_proposals_controller.rb +++ b/app/controllers/spending_proposals_controller.rb @@ -8,7 +8,7 @@ class SpendingProposalsController < ApplicationController feature_flag :spending_proposals - invisible_captcha only: [:create, :update], honeypot: :subtitle, on_timestamp_spam: :redirect_timestamp_spam + invisible_captcha only: [:create, :update], honeypot: :subtitle respond_to :html, :js diff --git a/app/controllers/users/registrations_controller.rb b/app/controllers/users/registrations_controller.rb index 0c1e067fb..2b25a5126 100644 --- a/app/controllers/users/registrations_controller.rb +++ b/app/controllers/users/registrations_controller.rb @@ -1,7 +1,7 @@ class Users::RegistrationsController < Devise::RegistrationsController prepend_before_action :authenticate_scope!, only: [:edit, :update, :destroy, :finish_signup, :do_finish_signup] - invisible_captcha only: [:create], honeypot: :family_name, scope: :user, on_timestamp_spam: :redirect_timestamp_spam + invisible_captcha only: [:create], honeypot: :family_name, scope: :user def new super do |user| diff --git a/spec/features/debates_spec.rb b/spec/features/debates_spec.rb index 3c88b1a95..d20c1c302 100644 --- a/spec/features/debates_spec.rb +++ b/spec/features/debates_spec.rb @@ -139,7 +139,7 @@ feature 'Debates' do expect(page).to have_content 'Sorry, that was too quick! Please resubmit' - expect(current_path).to eq(proposals_path) + expect(current_path).to eq(new_debate_path) end scenario 'Errors on create' do diff --git a/spec/features/organizations_spec.rb b/spec/features/organizations_spec.rb index 3a84d7adf..0a7a2bcc7 100644 --- a/spec/features/organizations_spec.rb +++ b/spec/features/organizations_spec.rb @@ -55,7 +55,7 @@ feature 'Organizations' do expect(page).to have_content 'Sorry, that was too quick! Please resubmit' - expect(current_path).to eq(root_path) + expect(current_path).to eq(new_organization_registration_path) end scenario 'Errors on create' do diff --git a/spec/features/proposals_spec.rb b/spec/features/proposals_spec.rb index c5a202543..c7be4956b 100644 --- a/spec/features/proposals_spec.rb +++ b/spec/features/proposals_spec.rb @@ -185,7 +185,7 @@ feature 'Proposals' do expect(page).to have_content 'Sorry, that was too quick! Please resubmit' - expect(current_path).to eq(proposals_path) + expect(current_path).to eq(new_proposal_path) end scenario 'Responsible name is stored for anonymous users' do diff --git a/spec/features/registration_form_spec.rb b/spec/features/registration_form_spec.rb index 42a5645dc..4f258e601 100644 --- a/spec/features/registration_form_spec.rb +++ b/spec/features/registration_form_spec.rb @@ -75,7 +75,7 @@ feature 'Registration form' do expect(page).to have_content 'Sorry, that was too quick! Please resubmit' - expect(current_path).to eq(root_path) + expect(current_path).to eq(new_user_registration_path) end diff --git a/spec/features/spending_proposals_spec.rb b/spec/features/spending_proposals_spec.rb index 392a3f56f..8b52bd014 100644 --- a/spec/features/spending_proposals_spec.rb +++ b/spec/features/spending_proposals_spec.rb @@ -141,7 +141,7 @@ feature 'Spending proposals' do click_button 'Create' expect(page).to have_content 'Sorry, that was too quick! Please resubmit' - expect(current_path).to eq(proposals_path) + expect(current_path).to eq(new_spending_proposal_path) end scenario 'Create notice' do