Repository navigation
Conversation
…s ONLY we are not in a testing mode
|
I ran into a bug when I tried to run (previously passing) tests after adding the Thanks for your work on this gem @ambethia! |
|
Also, let me know if you want a test for this. I just wrap the one section with an if clause, but I'm willing to prove it works. |
|
looks reasonable to me ... a test would be nice though ... |
| script_url += "?hl=#{hl}" unless hl.to_s == "" | ||
| html << %(<script src="#{script_url}" async defer></script>\n) unless options.delete(:script) == false | ||
| fallback_uri = "#{script_url.chomp('.js')}/fallback?k=#{site_key}" | ||
| attributes["class"] = %(g-recaptcha #{options.delete(:class)}) |
There was a problem hiding this comment.
can just use quotes instead of %(
| it "doesn't render script tag when in test mode" do | ||
| html = invisible_recaptcha_tags(env: "test") | ||
| html.wont_include("<script") | ||
| html.wont_include(" data-sitekey=\"#{Recaptcha.configuration.site_key}\"") |
There was a problem hiding this comment.
can make this more generic "data-sitekey"
| html.must_include(" data-sitekey=\"#{Recaptcha.configuration.site_key}\"") | ||
| end | ||
|
|
||
| it "doesn't render script tag when in test mode" do |
There was a problem hiding this comment.
more like "when verification is disabled" ?
|
sweet! |
5fa644b to
198547a
Compare
|
Thanks for the review @grosser! |
|
4.4.0 ... hope nobody comes and complains about their "usecase" :D |
…recaptcha_tags-to-be-used-in-test Fix invisible_recaptcha_tags to work in testing modes
Add relevant javascript and markup options to invisible_recaptcha_tags ONLY we are not in a testing mode