The logic used for the `:reply` ability incompletely duplicated that of
`Survey#active?` and incorrectly assumed that surveys always have start
and end dates.
Resolves:
Failures:
1) Survey as an attendee respond to a survey during registration
Failure/Error: survey.start_date > Time.current || survey.end_date < Time.current
ActionView::Template::Error:
undefined method `>' for nil:NilClass
survey.start_date > Time.current || survey.end_date < Time.current
^
# ./app/models/ability.rb:126:in `block in signed_in'
# ./app/views/surveys/show.html.haml:28:in `block in _app_views_surveys_show_html_haml___3404959267043700678_138180'
# ./app/views/surveys/show.html.haml:19:in `_app_views_surveys_show_html_haml___3404959267043700678_138180'
Failed examples:
rspec ./spec/features/surveys_spec.rb:37 # Survey as an attendee respond to a survey during registration
* Survey period constraints
* Add abilities
* Enforce required questions
* Update survey_submssion updated_at
* Do a full match of possible answer and user reply
Available during registration or after conference
Co-authored-by: Shyukri <shshyukriev@suse.com>
Co-authored-by: Henne <hvogel@opensuse.org>
Co-authored-by: Moises <mdeniz@suse.com>