added feature test and permissions for custom_domain

This commit is contained in:
shlok007 2017-08-03 11:15:19 +05:30
parent 364adffdab
commit 52cdb41618
3 changed files with 11 additions and 2 deletions

View file

@ -4,7 +4,7 @@ module Admin
load_resource :program, through: :conference, singleton: true, except: :index load_resource :program, through: :conference, singleton: true, except: :index
load_resource :user, only: [:remove_user] load_resource :user, only: [:remove_user]
def cusrom_domain; end def custom_domain; end
def index def index
# Redirect to new form if there is no conference # Redirect to new form if there is no conference

View file

@ -110,7 +110,7 @@ class AdminAbility
track_ids = Track.joins(:program).where('programs.conference_id IN (?)', conf_ids).pluck(:id) track_ids = Track.joins(:program).where('programs.conference_id IN (?)', conf_ids).pluck(:id)
can :manage, Resource, conference_id: conf_ids 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, Splashpage, conference_id: conf_ids
can :manage, Contact, conference_id: conf_ids can :manage, Contact, conference_id: conf_ids
can :manage, EmailSettings, conference_id: conf_ids can :manage, EmailSettings, conference_id: conf_ids

View file

@ -68,6 +68,15 @@ feature Conference do
expect(conference.short_title).to eq('NewCon') expect(conference.short_title).to eq('NewCon')
expect(Conference.count).to eq(expected_count) expect(Conference.count).to eq(expected_count)
end 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 end
describe 'admin' do describe 'admin' do