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 5 fix announcement service #326

Merged
merged 10 commits into from
Jun 20, 2024

Conversation

yuenmichelle1
Copy link
Collaborator

@yuenmichelle1 yuenmichelle1 commented Jun 18, 2024

These changes were geared to get announcement_service.rb tests to pass. (Because of shared examples/specs were laid out on talk, it may be possible more tests have passed because of this).

Changes:

  • Rails 4 -> 5, parameters no longer inherit from HashWithIndifferentAccess. So hash methods like fetch, slice etc. will no longer work.
    - We call .to_h on params in order to be able to run hash methods.

Changes:
1) Rails 4 -> 5, parameters no longer inherit from HashWithIndifferentAccess
2) response.json no longer is valid in Rails 5. response's class in Rails 4 is ActionController::TestResponse in Rails 5, response's class is ActionDispatch::TestResponse
3) Starting Rails 5, responses will default to 204s unless specified otherwise. And status of 204 will return response.content_type as nil
…onse in Rails 4. Rails 5 test responses are instances of ActionDispatch::TestResponse
@yuenmichelle1 yuenmichelle1 marked this pull request as ready for review June 18, 2024 19:02
@yuenmichelle1 yuenmichelle1 requested a review from Tooyosi June 18, 2024 19:03
@yuenmichelle1 yuenmichelle1 merged commit 5668253 into master Jun 20, 2024
1 of 2 checks passed
@yuenmichelle1 yuenmichelle1 deleted the rails-5---fix-announcement-service branch July 18, 2024 20:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants