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

fix error when fixture has erb #75

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

erwinrr
Copy link

@erwinrr erwinrr commented Jan 30, 2025

my /test/fixtures/users.yml file which has erb makes it break.

<% password_digest = BCrypt::Password.create("password") %>

one:
  email_address: [email protected]
  password_digest: <%= password_digest %>

two:
  email_address: [email protected]
  password_digest: <%= password_digest %>

after making this change it works again

Copy link
Owner

@a-chacon a-chacon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, can you add a test for it please? I think currently the tests just works with the factories, not fixtures. So you should create a specific test for this method in test/lib/oas_rails/spec/media_type_test.rb, the file already have some commented code you can use ;)

Any question or problem just tell me!

@@ -1,3 +1,4 @@
include 'erb'
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It should be require 'erb'. The tests failed because of it, apparently. And I am not sure if you need to require it here, Does not do it rails and zeitwerk?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

OAS crashes due to inability to handle nested resources in routes (Error is actually erb in fixtures)
2 participants