Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename regular to normal #75

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions lib/rails_cloudflare_turnstile/configuration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class Configuration
# Timeout for operations with Cloudflare
attr_accessor :timeout

# size for the widget (:regular or :compact)
# size for the widget (:normal or :compact)
attr_accessor :size

# theme for the widget (:auto, :light, or :dark)
Expand All @@ -33,7 +33,7 @@ def initialize
@enabled = nil
@mock_enabled = nil
@timeout = 5.0
@size = :regular
@size = :normal
@theme = :auto
@validation_url = "https://challenges.cloudflare.com/turnstile/v0/siteverify"
end
Expand All @@ -42,7 +42,7 @@ def validate!
raise "Must set site key" if @site_key.nil?
raise "Must set secret key" if @secret_key.nil?
@size = @size.to_sym
raise "Size must be one of ':regular' or ':compact'" unless [:regular, :compact].include? @size
raise "Size must be one of ':normal' or ':compact'" unless [:normal, :compact].include? @size
raise "Theme must be one of :auto, :light, or :dark" unless [:auto, :light, :dark].include? @theme
end

Expand Down
2 changes: 1 addition & 1 deletion spec/rails_cloudflare_turnstile/view_helpers_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def image_tag(name)

describe "#cloudflare_turnstile" do
it do
expect(subject.cloudflare_turnstile(action: "an-action")).to eq "<div class=\"cloudflare-turnstile\"><div class=\"cf-turnstile\" data-sitekey=\"a_public_key\" data-size=\"regular\" data-action=\"an-action\" data-theme=\"auto\"></div></div>"
expect(subject.cloudflare_turnstile(action: "an-action")).to eq "<div class=\"cloudflare-turnstile\"><div class=\"cf-turnstile\" data-sitekey=\"a_public_key\" data-size=\"normal\" data-action=\"an-action\" data-theme=\"auto\"></div></div>"
end
end
end
Expand Down