Non-admin proposal flow uses Ability, not AdminAbility, so organizers and CFP users could edit proposals but could not create event commercials.
Closes#3143.
Signed-off-by: Mridankan Mandal <xerontitan90@gmail.com>
Both iCalendar routes were unusable:
* `/conferences/.../schedule.ics` raised
`NoMethodError: undefined method 'icalendar_proposals'` because the
`ConferenceHelper#icalendar_proposals` helper isn't auto-included in
controllers; the action crashed before rendering.
* `/calendar.ics` silently redirected to `/`. The controller goes
through `load_and_authorize_resource`, which authorises `:calendar`
on `Conference` and is rejected for anonymous visitors because no
ability grants it — CanCan's `AccessDenied` rescue redirects to
root.
The helper is invoked through the controller `helpers` proxy so it
works in both contexts, and the calendar action is opted out of
resource loading and explicitly marked as not requiring authorization
since it serves a public feed across conferences. The helper is also
hardened so that proposals missing a room, difficulty level, track,
event type or scheduled time produce a valid event instead of
crashing the whole feed.
I think it's a bit overkill to test this line from Admin::VersionsController 30 times.
```
PaperTrail::Version.where(conference_id: @conference.id).accessible_by(current_ability)
```
Let's do it once...
Fails with:
1) Event as an conference organizer create a proposal
Failure/Error: raise ActionController::MissingExactTemplate, message
ActionController::MissingExactTemplate:
Admin::EventsController#new is missing a template for request formats: text/html
re #2975
Fails with:
1) User admin behaves like admin ability edits a user
Failure/Error: raise ActionController::MissingExactTemplate, message
ActionController::MissingExactTemplate:
Admin::UsersController#edit is missing a template for request formats: text/html
re #2975
Setting the default host resolves:
Missing host to link to! Please provide the :host parameter, set
default_url_options[:host], or set :only_path to true
Configuring RSpec to use the default host resolves:
Expected response to be a redirect to <http://test.host/…>
but was a redirect to <http://localhost/…>.
Effective API changes:
- nil serializes to null, not empty string
- dates serialize to IETF RFC 3339 with millisecond precision, not
second precision surrounded by spaces