Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Administrador consulta lista de inscritos em um determinado workshop #29

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions spec/features/admin_views_workshop_attendee_list_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
require 'rails_helper'

feature 'Admin view workshop attendees list' do
scenario 'workshop has no attendees' do
workshop = create(:workshop)
user = create(:user)

login_as user, scope: :user
visit root_path
click_on I18n.t('home.index.list_workshops')
click_on I18n.t('workshops.index.show')

expect(page).to have_content('Nenhum participante inscrito')
end
scenario 'workshop has one attendee' do
user = create(:user)
attendee = create(:attendee)
workshop = create(:workshop, name: 'Rails 101', attendees: 1, status: :active)
workshop.enrollments.create(attendee: attendee)

login_as user, scope: :user
visit root_path
click_on I18n.t('home.index.list_workshops')
click_on I18n.t('workshops.index.show')

expect(page).to have_content(attendee.name)
end
end