mirror of
https://github.com/openSUSE/osem.git
synced 2026-08-13 19:54:02 +00:00
Fix get_roles method of User model
Previous implementation was associating resources with all
the roles regardless of user role in the resource. ie:
if user is cfp member of conf1, the method was returning:
{ organizer => conf1,
cfp => conf1,
Info Desk => conf1,
Volunteers Coordinator => conf1
}
This commit is contained in:
parent
3c356cbaaf
commit
7e04a267cb
4 changed files with 19 additions and 6 deletions
10
spec/helpers/application_helper_spec.rb
Normal file
10
spec/helpers/application_helper_spec.rb
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
require 'spec_helper'
|
||||
|
||||
describe ApplicationHelper, type: :helper do
|
||||
describe 'show_roles' do
|
||||
it 'formats the hash passed' do
|
||||
roles = { 'organizer' => ['oSC16', 'oSC15'], 'cfp' => ['oSC16'] }
|
||||
expect(show_roles(roles)).to eq 'Organizer (oSC16, oSC15), Cfp (oSC16)'
|
||||
end
|
||||
end
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue