From 52cdb41618b12e02b1f2e2f5938be62dca084978 Mon Sep 17 00:00:00 2001 From: shlok007 Date: Thu, 3 Aug 2017 11:15:19 +0530 Subject: [PATCH] added feature test and permissions for custom_domain --- app/controllers/admin/conferences_controller.rb | 2 +- app/models/admin_ability.rb | 2 +- spec/features/conference_spec.rb | 9 +++++++++ 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/app/controllers/admin/conferences_controller.rb b/app/controllers/admin/conferences_controller.rb index 3c900a45..c4239394 100644 --- a/app/controllers/admin/conferences_controller.rb +++ b/app/controllers/admin/conferences_controller.rb @@ -4,7 +4,7 @@ module Admin load_resource :program, through: :conference, singleton: true, except: :index load_resource :user, only: [:remove_user] - def cusrom_domain; end + def custom_domain; end def index # Redirect to new form if there is no conference diff --git a/app/models/admin_ability.rb b/app/models/admin_ability.rb index 4244d049..52bc6a9d 100644 --- a/app/models/admin_ability.rb +++ b/app/models/admin_ability.rb @@ -110,7 +110,7 @@ class AdminAbility track_ids = Track.joins(:program).where('programs.conference_id IN (?)', conf_ids).pluck(:id) can :manage, Resource, conference_id: conf_ids - can [:read, :update, :destroy], Conference, id: conf_ids + can [:read, :update, :destroy, :custom_domin], Conference, id: conf_ids can :manage, Splashpage, conference_id: conf_ids can :manage, Contact, conference_id: conf_ids can :manage, EmailSettings, conference_id: conf_ids diff --git a/spec/features/conference_spec.rb b/spec/features/conference_spec.rb index d17ce5fc..4c0f0fd4 100644 --- a/spec/features/conference_spec.rb +++ b/spec/features/conference_spec.rb @@ -68,6 +68,15 @@ feature Conference do expect(conference.short_title).to eq('NewCon') expect(Conference.count).to eq(expected_count) end + + scenario 'show custom domain of a conference', feature: true, js: true do + conference = create(:conference, custom_domain: 'mydomain.conf') + sign_in user + + visit custom_domain_admin_conference_path(conference.short_title) + + expect(page).to have_text('mydomain.conf') + end end describe 'admin' do