From d15e876ae81cf9ee04f107fe378bf1531c059847 Mon Sep 17 00:00:00 2001 From: Jason Lee Date: Wed, 15 Feb 2017 12:31:25 +0800 Subject: [PATCH] Fix typo, and add test for ActionView --- lib/rucaptcha.rb | 2 +- spec/view_spec.rb | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 spec/view_spec.rb diff --git a/lib/rucaptcha.rb b/lib/rucaptcha.rb index de55b5b..98d0bfd 100644 --- a/lib/rucaptcha.rb +++ b/lib/rucaptcha.rb @@ -39,6 +39,6 @@ ActiveSupport.on_load(:action_controller) do ActionController::Base.send :include, RuCaptcha::ControllerHelpers end -ActiveSupport.on_load(:active_view) do +ActiveSupport.on_load(:action_view) do include RuCaptcha::ViewHelpers end diff --git a/spec/view_spec.rb b/spec/view_spec.rb new file mode 100644 index 0000000..296c641 --- /dev/null +++ b/spec/view_spec.rb @@ -0,0 +1,10 @@ +require 'spec_helper' + +describe ActionView::Base do + describe '.rucaptcha_input_tag' do + it 'should work' do + view = ActionView::Base.new + expect(view.respond_to?(:rucaptcha_input_tag)).to eq true + end + end +end