-
Notifications
You must be signed in to change notification settings - Fork 4
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
Feature/ignore custom route #54
Conversation
Hey! Thank you! Again, I can review this at the end of the day. But at the first look I see it is ok. You can run rubocop in your local before upload the changes, so you can be sure you fix it ;) |
And, please. Can you make a simple test for this feature? Like add a route to excluded paths, then check that your function returns what you expected? The file does not exist, so you should be create it. Something like /tests/lib/oas_rails/extractores/oas_route_extractor_test.rb. You can check the others files too. |
I can try, but i never write a test ahah. I'm going how make that 👯♂️ |
Don't worry, just look the others tests and you will know how to make it |
I couldn't do make the tests, because it's necessary to reload the app every time you modify the config file.. sorry |
mm I don't understand. If you show me what you try then I can help you. But I mean, you can do a simple test like this seudo code: def test_ignored_paths
OasRails.config.ignored_paths = ["usersController#index"]
assert Extractors::RouteExtractor.ignore_custom_paths("/users")
assert_not Extractors::RouteExtractor.ignore_custom_paths("/projects")
# then you can reset to default if needed
OasRails.config.ignored_paths = []
end And try to test every branch in the method. You can look this Is it what you can't do? |
It's a private method. I can use it ? And I going rename because is not for path, is for ignore controller#action |
aa ok, I am sorry, I didn't see that. Then you can test it with the |
it's all done 🤟 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After resolve this, we are ok with your feature! Thanks again!
CHANGELOG.md
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hey! This file is created automatically. There is no need for touch it. I think you open it and your code editor formatted it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i don't touch that, idk?? I restore from main that file
hey @Metalzoid thank you! I will release a new version at the night. |
We have problems :( Why it fails in main and not here?
Do you know what could be happening here? https://github.com/a-chacon/oas_rails/actions/runs/10620740013/job/29441251829?pr=53 |
Oh yes, I see. M'y bad ! The test works with test environment (route you are created on the test environment). The result is write in brut, not auto calculated. |
yes! don't worry. We leave the release for the weekend. I really appreciate your interest in helping with this. About the failing tests. Mm give it a look. All the tests run with the test environment, so could be another thing. |
Adding =
I hope the code is clean enough, don't hesitate to correct and explain to me if it doesn't suit you so that I can improve :)