mirror of
https://github.com/openSUSE/osem.git
synced 2026-08-17 21:54:06 +00:00
Display roles in registration list
This commit is contained in:
parent
10ef898a0d
commit
7c38622e8f
2 changed files with 25 additions and 0 deletions
|
|
@ -28,6 +28,10 @@
|
|||
= registration.id
|
||||
%td
|
||||
= registration.name
|
||||
- @conference.roles.each do |role|
|
||||
- role.users.each do |user|
|
||||
- if user == registration.user
|
||||
%span.label.label-info= role.name.titleize
|
||||
%td
|
||||
= registration.email
|
||||
%td
|
||||
|
|
|
|||
21
spec/views/admin/registrations/index.html.haml_spec.rb
Normal file
21
spec/views/admin/registrations/index.html.haml_spec.rb
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
require 'spec_helper'
|
||||
|
||||
describe 'admin/registrations/index' do
|
||||
let(:conference) { create(:conference, roles: [role1, role2]) }
|
||||
let(:user) { create(:user) }
|
||||
let(:role1) { create(:organizer_role, users: [user]) }
|
||||
let(:role2) { create(:cfp_role, users: [user]) }
|
||||
|
||||
before :each do
|
||||
assign :conference, conference
|
||||
assign :registrations, [create(:registration, user: user, conference: conference)]
|
||||
|
||||
render
|
||||
end
|
||||
|
||||
it 'renders index' do
|
||||
expect(rendered).to have_selector('table tbody td', text: user.name)
|
||||
expect(rendered).to have_selector('table tbody td span:nth-of-type(1)', text: role1.name.titleize)
|
||||
expect(rendered).to have_selector('table tbody td span:nth-of-type(2)', text: role2.name.titleize)
|
||||
end
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue