osem-fcy/app
Andrew Kvalheim b565be2f46 Correct assumption of survey start and end dates
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
2022-03-16 14:12:01 -07:00
..
assets Retire semantic_form_for 2022-02-24 15:52:34 +01:00
controllers Update UserDatatable for ajax-datatables-rails 1 2022-03-06 23:12:02 -08:00
datatables Update UserDatatable for ajax-datatables-rails 1 2022-03-06 23:12:02 -08:00
helpers Fix selectized users on booth/proposal forms 2022-03-03 16:48:49 +01:00
jobs Add frozen_string_literal magic comment 2018-05-09 06:54:26 -07:00
mailers Rubocop autocorrections 2018-11-16 09:06:05 -08:00
models Correct assumption of survey start and end dates 2022-03-16 14:12:01 -07:00
pdfs Fix ticket PDF spec 2022-02-23 14:36:06 +01:00
serializers Required changes for consistent controller & feature results 2018-11-20 17:30:56 -08:00
uploaders Rename deprecated CarrierWave methods 2021-08-18 14:10:31 +02:00
views Associate form label with its control 2022-03-16 14:12:01 -07:00