Uses invisible_captcha's default "foo fast" action

This commit is contained in:
kikito
2016-04-28 12:47:04 +02:00
parent 8bcbe86064
commit 9ac6e2d60b
11 changed files with 10 additions and 14 deletions

View File

@@ -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

View File

@@ -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

View File

@@ -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|

View File

@@ -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

View File

@@ -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

View File

@@ -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|

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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