-
Notifications
You must be signed in to change notification settings - Fork 109
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix for bugs in the Conditional Questions functionality:
- In case of conditional question with checkbox answers the removed questions were not being removed from view, nor was the answer to these questions (which persisted in the db. Changes: - Fixed the broken functionality in the method remove_answers_list in app/helpers/conditions_helper.rb. - Removed and destroyed the answers of the removed questions. - Added more tests for Conditional Questions functionality.
- Loading branch information
John Pinto
committed
Sep 20, 2024
1 parent
56759df
commit 61dec4b
Showing
11 changed files
with
917 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
425 changes: 425 additions & 0 deletions
425
spec/controllers/answers_controller_with_conditional_questions_spec.rb
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,5 +28,20 @@ | |
factory :condition do | ||
option_list { nil } | ||
remove_data { nil } | ||
action_type { nil } | ||
# the webhook_data is a Json string of form: | ||
# '{"name":"Joe Bloggs","email":"[email protected]","subject":"Large data volume","message":"A message."}' | ||
trait :webhook do | ||
action_type { 'add_webhook' } | ||
webhook_data do | ||
# Generates string from hash | ||
JSON.generate({ | ||
name: Faker::Name.name, | ||
email: Faker::Internet.email, | ||
subject: Faker::Lorem.sentence(word_count: 4), | ||
message: Faker::Lorem.paragraph(sentence_count: 2) | ||
}) | ||
end | ||
end | ||
end | ||
end |
Oops, something went wrong.