-
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. - Updated RSpec tests for Conditional Questions functionality.
- Loading branch information
John Pinto
committed
Oct 25, 2024
1 parent
56759df
commit d2f80fc
Showing
11 changed files
with
1,215 additions
and
7 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
513 changes: 513 additions & 0 deletions
513
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 |
---|---|---|
|
@@ -26,7 +26,22 @@ | |
|
||
FactoryBot.define do | ||
factory :condition do | ||
option_list { nil } | ||
remove_data { nil } | ||
option_list { [] } | ||
remove_data { [] } | ||
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.