Conditional question fix for removing questions bug rails7 by johnpinto1 · Pull Request #3516 · DMPRoadmap/roadmap

aaronskiba

John Pinto added 2 commits

April 28, 2025 11:26
    In the case of a conditional question with answers that removed questions from different sections of a phase, any answers of removed questions were not removed, just hidden. Nor were the removed answers deleted in the database.

    Changes:
    - Added code to delete answers in AnswersController and ConditionsHelper in the database.
    - Added javascript code in  answers/edit.js and utils/sectionUpdate.js
      to delete answers for removed questions.

    Rspec tests updated in next commit.
        Changes:
         - added and updated tests for Conditional Questions.
         - Fixed a few broken RSpec tests  by replacing
              click_link 'Write plan'  -->  click_link 'Write Plan'.
         - Updated  CHANGELOG.md.

aaronskiba

aaronskiba

    rendancy and optimise code.

aaronskiba