Skip to content

Commit

Permalink
Saving calendar import mode on admin page (#1253)
Browse files Browse the repository at this point in the history
A small fix
  • Loading branch information
ivankocienski authored May 19, 2022
1 parent 3de476e commit 6556f56
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 1 deletion.
2 changes: 1 addition & 1 deletion app/controllers/admin/calendars_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ def calendar_params
:place_id,
:is_facebook_page,
:facebook_page_id,
:is_working,
:importer_mode,
:public_contact_name,
:public_contact_phone,
:public_contact_email,
Expand Down
22 changes: 22 additions & 0 deletions test/integration/admin/calendars_integration_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -119,4 +119,26 @@ class Admin::CalendarsTest < ActionDispatch::IntegrationTest

assert_select 'option', @partner.name, count: 1
end

test "partner : can see which importer is selected" do
@calendar.update! importer_mode: 'ical'

sign_in @partner_admin
get edit_admin_calendar_path(@calendar)

assert_select 'option[value="ical"][selected="selected"]', nil, count: 1
end

test "partner : can change importer" do
sign_in @partner_admin

params = { calendar: @calendar.attributes }
params[:calendar]['importer_mode'] = 'eventbrite'

put admin_calendar_path(@calendar), params: params

@calendar.reload
assert_equal 'eventbrite', @calendar.importer_mode
end

end

0 comments on commit 6556f56

Please sign in to comment.