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

Rails edge compatibility #941

Closed
1 task done
tagliala opened this issue Aug 8, 2024 · 2 comments
Closed
1 task done

Rails edge compatibility #941

tagliala opened this issue Aug 8, 2024 · 2 comments
Assignees
Labels

Comments

@tagliala
Copy link
Contributor

tagliala commented Aug 8, 2024

Steps to reproduce*

Run test suite against rails edge

Expected behavior*

Tests pass

Actual behavior*

Failure:
ClientSideValidations::FormForActionViewHelpersTest#test_http_method [test/action_view/cases/test_form_for_helpers.rb:57]:
Expected: <form action="/posts" accept-charset="UTF-8" method="post" data-client-side-validations="{&quot;html_settings&quot;:{&quot;type&quot;:&quot;ActionView::Helpers::FormBuilder&quot;,&quot;input_tag&quot;:&quot;\u003cdiv class=\&quot;field_with_errors\&quot;\u003e\u003cspan id=\&quot;input_tag\&quot;\u003e\u003c/span\u003e\u003c/div\u003e&quot;,&quot;label_tag&quot;:&quot;\u003cdiv class=\&quot;field_with_errors\&quot;\u003e\u003clabel id=\&quot;label_tag\&quot;\u003e\u003c/label\u003e\u003c/div\u003e&quot;},&quot;number_format&quot;:{&quot;separator&quot;:&quot;.&quot;,&quot;delimiter&quot;:&quot;,&quot;},&quot;validators&quot;:{&quot;post[cost]&quot;:{&quot;presence&quot;:[{&quot;message&quot;:&quot;can&#39;t be blank&quot;}]}}}" novalidate="novalidate" id="new_post" class="new_post"><input type="hidden" autocomplete="off" value="patch" name="_method" /><textarea name="post[cost]" id="post_cost">
</textarea></form>
Actual: <form class="new_post" id="new_post" action="/posts" accept-charset="UTF-8" novalidate="novalidate" data-client-side-validations="{&quot;html_settings&quot;:{&quot;type&quot;:&quot;ActionView::Helpers::FormBuilder&quot;,&quot;input_tag&quot;:&quot;\u003cdiv class=\&quot;field_with_errors\&quot;\u003e\u003cspan id=\&quot;input_tag\&quot;\u003e\u003c/span\u003e\u003c/div\u003e&quot;,&quot;label_tag&quot;:&quot;\u003cdiv class=\&quot;field_with_errors\&quot;\u003e\u003clabel id=\&quot;label_tag\&quot;\u003e\u003c/label\u003e\u003c/div\u003e&quot;},&quot;number_format&quot;:{&quot;separator&quot;:&quot;.&quot;,&quot;delimiter&quot;:&quot;,&quot;},&quot;validators&quot;:{}}" method="post"><input type="hidden" name="_method" value="patch" autocomplete="off" /><textarea name="post[cost]" id="post_cost">
</textarea></form>

bin/rails test action_view/cases/test_form_for_helpers.rb:46

........................................................................................................................................................................................................................................F

Failure:
ClientSideValidations::FormWithActionViewHelpersTest#test_form_with_text_area [test/action_view/cases/test_form_with_helpers.rb:95]:
Expected: <form action="/posts" accept-charset="UTF-8" method="post" data-client-side-validations="{&quot;html_settings&quot;:{&quot;type&quot;:&quot;ActionView::Helpers::FormBuilder&quot;,&quot;input_tag&quot;:&quot;\u003cdiv class=\&quot;field_with_errors\&quot;\u003e\u003cspan id=\&quot;input_tag\&quot;\u003e\u003c/span\u003e\u003c/div\u003e&quot;,&quot;label_tag&quot;:&quot;\u003cdiv class=\&quot;field_with_errors\&quot;\u003e\u003clabel id=\&quot;label_tag\&quot;\u003e\u003c/label\u003e\u003c/div\u003e&quot;},&quot;number_format&quot;:{&quot;separator&quot;:&quot;.&quot;,&quot;delimiter&quot;:&quot;,&quot;},&quot;validators&quot;:{&quot;post[cost]&quot;:{&quot;presence&quot;:[{&quot;message&quot;:&quot;can&#[39](https://github.com/DavyJonesLocker/client_side_validations/actions/runs/10290681313/job/28481203853#step:4:40);t be blank&quot;}]}}}" novalidate="novalidate"><textarea name="post[cost]" id="post_cost">
</textarea></form>
Actual: <form action="/posts" accept-charset="UTF-8" novalidate="novalidate" data-client-side-validations="{&quot;html_settings&quot;:{&quot;type&quot;:&quot;ActionView::Helpers::FormBuilder&quot;,&quot;input_tag&quot;:&quot;\u003cdiv class=\&quot;field_with_errors\&quot;\u003e\u003cspan id=\&quot;input_tag\&quot;\u003e\u003c/span\u003e\u003c/div\u003e&quot;,&quot;label_tag&quot;:&quot;\u003cdiv class=\&quot;field_with_errors\&quot;\u003e\u003clabel id=\&quot;label_tag\&quot;\u003e\u003c/label\u003e\u003c/div\u003e&quot;},&quot;number_format&quot;:{&quot;separator&quot;:&quot;.&quot;,&quot;delimiter&quot;:&quot;,&quot;},&quot;validators&quot;:{}}" method="post"><textarea name="post[cost]" id="post_cost">
</textarea></form>

bin/rails test action_view/cases/test_form_with_helpers.rb:85

System configuration*

Rails version: Edge

Ruby version: all compatible

Client Side Validations version: main

Code snippet from your model of the validations*

n/a

The whole form code from your template*

n/a

The resulting HTML*

n/a

Browser's development console output*

  • I confirm that my browser's development console output does not contain errors

Additional JavaScript Libraries*

Repository demostrating the issue

Debugging CSV issues is a time consuming task. If you want to speed up things, please
provide a link to a repository showing the issue.


* Failure to include this requirement may result in the issue being closed.

@tagliala tagliala added the bug label Aug 8, 2024
@tagliala tagliala self-assigned this Aug 8, 2024
@tagliala
Copy link
Contributor Author

tagliala commented Aug 8, 2024

rails/rails@fa476ce275

rails/rails#52467

Error:
ClientSideValidations::LegacyFormWithActionViewHelpersTest#test_form_with_text_area:
NoMethodError: undefined method `text_area' for an instance of ActionView::Helpers::FormBuilder
    test/action_view/cases/test_legacy_form_with_helpers.rb:26:in `block in test_form_with_text_area'
    /Users/geremia/dev/rails/actionview/lib/action_view/helpers/capture_helper.rb:50:in `block in capture'
    /Users/geremia/dev/rails/actionview/lib/action_view/buffers.rb:75:in `capture'
    /Users/geremia/dev/rails/actionview/lib/action_view/helpers/capture_helper.rb:50:in `capture'
    /Users/geremia/dev/rails/actionview/lib/action_view/helpers/form_helper.rb:775:in `form_with'
    lib/client_side_validations/action_view/form_with_helper.rb:8:in `form_with'
    test/action_view/cases/helper.rb:42:in `form_with'
    test/action_view/cases/test_legacy_form_with_helpers.rb:25:in `test_form_with_text_area'

rails/rails@3278a40d38

F

Failure:
ClientSideValidations::FormWithActionViewHelpersTest#test_form_with_text_area [test/action_view/cases/test_form_with_helpers.rb:95]:
Expected: <form action="/posts" accept-charset="UTF-8" method="post" data-client-side-validations="{&quot;html_settings&quot;:{&quot;type&quot;:&quot;ActionView::Helpers::FormBuilder&quot;,&quot;input_tag&quot;:&quot;\u003cdiv class=\&quot;field_with_errors\&quot;\u003e\u003cspan id=\&quot;input_tag\&quot;\u003e\u003c/span\u003e\u003c/div\u003e&quot;,&quot;label_tag&quot;:&quot;\u003cdiv class=\&quot;field_with_errors\&quot;\u003e\u003clabel id=\&quot;label_tag\&quot;\u003e\u003c/label\u003e\u003c/div\u003e&quot;},&quot;number_format&quot;:{&quot;separator&quot;:&quot;.&quot;,&quot;delimiter&quot;:&quot;,&quot;},&quot;validators&quot;:{&quot;post[cost]&quot;:{&quot;presence&quot;:[{&quot;message&quot;:&quot;can&#39;t be blank&quot;}]}}}" novalidate="novalidate"><textarea name="post[cost]" id="post_cost">
</textarea></form>
Actual: <form action="/posts" accept-charset="UTF-8" novalidate="novalidate" data-client-side-validations="{&quot;html_settings&quot;:{&quot;type&quot;:&quot;ActionView::Helpers::FormBuilder&quot;,&quot;input_tag&quot;:&quot;\u003cdiv class=\&quot;field_with_errors\&quot;\u003e\u003cspan id=\&quot;input_tag\&quot;\u003e\u003c/span\u003e\u003c/div\u003e&quot;,&quot;label_tag&quot;:&quot;\u003cdiv class=\&quot;field_with_errors\&quot;\u003e\u003clabel id=\&quot;label_tag\&quot;\u003e\u003c/label\u003e\u003c/div\u003e&quot;},&quot;number_format&quot;:{&quot;separator&quot;:&quot;.&quot;,&quot;delimiter&quot;:&quot;,&quot;},&quot;validators&quot;:{}}" method="post"><textarea name="post[cost]" id="post_cost">
</textarea></form>

tagliala added a commit that referenced this issue Aug 8, 2024
Use a simple text field instead of the more complex textarea in specs
that are not related to textarea.

This will simplify the test suite and prevent unrelated failures

Ref: #941
tagliala added a commit that referenced this issue Aug 8, 2024
Use a simple text field instead of the more complex textarea in specs
that are not related to textarea.

This will simplify the test suite and prevent unrelated failures

Ref: #941
@tagliala
Copy link
Contributor Author

Difference:

&quot;post[cost]&quot;:{&quot;presence&quot;:[{&quot;message&quot;:&quot;can&#39;t be blank&quot;}]}

tagliala added a commit that referenced this issue Aug 13, 2024
tagliala added a commit that referenced this issue Aug 20, 2024
tagliala added a commit that referenced this issue Oct 13, 2024
tagliala added a commit that referenced this issue Nov 12, 2024
tagliala added a commit that referenced this issue Nov 12, 2024
- Add class parameter to Uniqueness validator as per rails/rails#53598
- Test new edge methods textarea and checkbox
- Allow new Rails 8 helper names like `textarea` (close #941)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant