spec/helpers/argyle_helper_spec.rb in argyle-0.1.0 vs spec/helpers/argyle_helper_spec.rb in argyle-0.2.0
- old
+ new
@@ -43,9 +43,14 @@
end
it "returns the form and script HTML" do
expect(helper.plaid_link(@options)).to eq("<form id=\"ohai\" action=\"/plaid/index\" accept-charset=\"UTF-8\" method=\"post\"><input name=\"utf8\" type=\"hidden\" value=\"✓\" /><script src=\"https://cdn.plaid.com/link/stable/link-initialize.js\" data-client-name=\"ohai\" data-form-id=\"ohai\" data-key=\"key\" data-product=\"auth\" data-env=\"tartan\" data-webhook=\"http://myhook.com\" data-token=\"myToken\">\n//<![CDATA[\n\n//]]>\n</script>")
end
+
+ it "accepts data attributes" do
+ @options.merge!({ :data => { :longtail => true } })
+ expect(helper.plaid_link(@options)).to eq("<form id=\"ohai\" action=\"/plaid/index\" accept-charset=\"UTF-8\" method=\"post\"><input name=\"utf8\" type=\"hidden\" value=\"✓\" /><script src=\"https://cdn.plaid.com/link/stable/link-initialize.js\" data-client-name=\"ohai\" data-form-id=\"ohai\" data-key=\"key\" data-product=\"auth\" data-env=\"tartan\" data-webhook=\"http://myhook.com\" data-token=\"myToken\" data-longtail=\"true\">\n//<![CDATA[\n\n//]]>\n</script>")
+ end
end
describe "#plaid_link_form" do
it "returns plaid form with specified action" do
expect(helper.plaid_link_form('myId', plaid_index_path)).to eq('<form id="myId" action="/plaid/index" accept-charset="UTF-8" method="post"><input name="utf8" type="hidden" value="✓" />')