From ab339fadb08ee4cacdcc65852e00092dabccfd7f Mon Sep 17 00:00:00 2001 From: Nishanth Vijayan Date: Sun, 3 Apr 2016 13:24:07 +0530 Subject: [PATCH] Fix typos: volunteer_coordinator to volunteers_coordinator --- app/helpers/application_helper.rb | 2 +- app/models/ability.rb | 6 +++--- spec/features/ability_spec.rb | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 3fd34c53..32c62e16 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -278,7 +278,7 @@ module ApplicationHelper end def can_manage_volunteers(conference) - if (current_user.has_role? :organizer, conference) || (current_user.has_role? :volunteer_coordinator, conference) + if (current_user.has_role? :organizer, conference) || (current_user.has_role? :volunteers_coordinator, conference) true else false diff --git a/app/models/ability.rb b/app/models/ability.rb index ef569ec7..07dfca1d 100644 --- a/app/models/ability.rb +++ b/app/models/ability.rb @@ -9,7 +9,7 @@ class Ability # user.is_organizer? or user.has_role? :organizer # user.is_cfp_of? Conference or user.has_role? :cfp, Conference # user.is_info_desk_of? Conference - # user.is_volunteer_coordinator_of? Conference + # user.is_volunteers_coordinator_of? Conference # user.is_attendee_of? Conference # The following is wrong because a user will only have 'cfp' role for a specific conference # user.is_cfp? # This is always false @@ -104,7 +104,7 @@ class Ability signed_in_with_organizer_role(user) if user.has_role? :organizer, :any signed_in_with_cfp_role(user) if user.has_role? :cfp, :any signed_in_with_info_desk_role(user) if user.has_role? :info_desk, :any - signed_in_with_volunteers_coordinator_role(user) if user.has_role? :volunteer_coordinator, :any + signed_in_with_volunteers_coordinator_role(user) if user.has_role? :volunteers_coordinator, :any # for users with any role can :access, Admin @@ -240,7 +240,7 @@ class Ability # ids of all the conferences for which the user has the 'volunteers_coordinator' role conf_ids_for_volunteers_coordinator = [] conf_ids_for_volunteers_coordinator = - Conference.with_role(:volunteer_coordinator, user).pluck(:id) if user.has_role? :volunteer_coordinator, :any + Conference.with_role(:volunteers_coordinator, user).pluck(:id) if user.has_role? :volunteers_coordinator, :any can :manage, Vposition, conference_id: conf_ids_for_volunteers_coordinator can :manage, Vday, conference_id: conf_ids_for_volunteers_coordinator diff --git a/spec/features/ability_spec.rb b/spec/features/ability_spec.rb index fac2e4e7..60248c30 100644 --- a/spec/features/ability_spec.rb +++ b/spec/features/ability_spec.rb @@ -11,13 +11,13 @@ feature 'Has correct abilities' do let(:role_organizer) { Role.find_by(name: 'organizer', resource: conference1) } let(:role_cfp) { Role.find_by(name: 'cfp', resource: conference2) } let(:role_info_desk) { Role.find_by(name: 'info_desk', resource: conference3) } - let(:role_volunteer_coordinator) { Role.find_by(name: 'volunteers_coordinator', resource: conference4) } + let(:role_volunteers_coordinator) { Role.find_by(name: 'volunteers_coordinator', resource: conference4) } let(:user) { create(:user) } let(:user_organizer) { create(:user, role_ids: [role_organizer.id]) } let(:user_cfp) { create(:user, role_ids: [role_cfp.id]) } let(:user_info_desk) { create(:user, role_ids: [role_info_desk.id]) } - let(:user_volunteer_coordinator) { create(:user, role_ids: [role_volunteer_coordinator.id]) } + let(:user_volunteers_coordinator) { create(:user, role_ids: [role_volunteers_coordinator.id]) } scenario 'when user has no role' do sign_in user