Skip to content

Refactor Conditional Questions Tests #3522

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

Draft
wants to merge 9 commits into
base: conditional-question-fix-for-removing-questions-bug-rails7
Choose a base branch
from

Conversation

aaronskiba
Copy link
Contributor

Changes proposed in this PR:

  • Conditional question fix for removing questions bug rails7 #3516 adds a lot of test coverage within spec/features/questions/conditions_questions_spec.rb and spec/controllers/answers_controller_with_conditional_questions_spec.rb. This PR attempts to refactor those files by applying DRY principles.
  • spec/support/helpers/conditional_questions_helper.rb has been created to facilitate the shared logic between the two aforementioned files.
  • The only actual change is the addition of @non_conditional_questions[:radiobutton][index].id to some remove_data: values. (I am not sure why these :radiobutton options were absent in the first place and could add them back if needed.)

@aaronskiba aaronskiba marked this pull request as ready for review May 6, 2025 19:59
@aaronskiba aaronskiba requested a review from johnpinto1 May 6, 2025 19:59
@johnpinto1
Copy link
Contributor

* The only actual change is the addition of `@non_conditional_questions[:radiobutton][index].id` to some `remove_data: ` values. (I am not sure why these `:radiobutton` options were absent in the first place and could add them back if needed.)

Please add. That was a slip up on my part.

@aaronskiba aaronskiba marked this pull request as draft May 7, 2025 15:19
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