Sha256: 93701a95abd592a109429c8ced237c6e207e438c51d581fba52e608db71cd1e6
Contents?: true
Size: 1.52 KB
Versions: 1
Compression:
Stored size: 1.52 KB
Contents
# coding: utf-8 # models for use in tests class Widget < ActiveRecord::Base # uses textcaptcha.yml file for configuration acts_as_textcaptcha end class Comment < ActiveRecord::Base # inline options (symbol keys) with api_key only acts_as_textcaptcha :api_key => '8u5ixtdnq9csc84cok0owswgo', :bcrypt_salt => '$2a$10$j0bmycH.SVfD1b5mpEGPpe' end class Review < ActiveRecord::Base # inline options with all possible options acts_as_textcaptcha 'api_key' => '8u5ixtdnq9csc84cok0owswgo', 'bcrypt_salt' => '$2a$10$j0bmycH.SVfD1b5mpEGPpe', 'bcrypt_cost' => '3', 'questions' => [{ 'question' => 'The green hat is what color?', 'answers' => 'green' }] end class Note < ActiveRecord::Base # inline options (string keys) with user defined questions only (no textcaptcha service) acts_as_textcaptcha 'questions' => [{ 'question' => '1+1', 'answers' => '2,two' }], 'bcrypt_salt' => '$2a$10$j0bmycH.SVfD1b5mpEGPpe' # allows toggling perform_textcaptcha on/off (default on) attr_accessor :turn_off_captcha def perform_textcaptcha? !turn_off_captcha end end class Contact # non active record object (symbol keys), no API used include ActiveModel::Validations include ActiveModel::Conversion extend ActsAsTextcaptcha::Textcaptcha acts_as_textcaptcha :questions => [{ :question => 'one+1', :answers => "2,two,апельсин" }], :bcrypt_salt => '$2a$10$j0bmycH.SVfD1b5mpEGPpe' end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
acts_as_textcaptcha-3.0.3 | test/test_models.rb |