|
49 | 49 | end |
50 | 50 | end |
51 | 51 |
|
| 52 | + describe 'GET /events/:id' do |
| 53 | + let(:manager_user) do |
| 54 | + BetterTogether:: User.find_by(email: '[email protected]') || |
| 55 | + create(:better_together_user, :confirmed, :platform_manager, email: '[email protected]') |
| 56 | + end |
| 57 | + |
| 58 | + let(:event) do |
| 59 | + BetterTogether::Event.create!( |
| 60 | + name: 'Neighborhood Clean-up', |
| 61 | + starts_at: 1.day.from_now, |
| 62 | + identifier: SecureRandom.uuid, |
| 63 | + privacy: 'public', |
| 64 | + creator: manager_user.person |
| 65 | + ) |
| 66 | + end |
| 67 | + |
| 68 | + context 'as platform manager', :as_platform_manager do |
| 69 | + it 'shows attendees tab to organizers' do |
| 70 | + get better_together.event_path(event, locale:) |
| 71 | + |
| 72 | + expect(response).to have_http_status(:ok) |
| 73 | + # Look for the attendees tab nav link by id to avoid matching HTML comments |
| 74 | + expect(response.body).to include('id="attendees-tab"') |
| 75 | + end |
| 76 | + end |
| 77 | + |
| 78 | + context 'as regular user', :as_user do |
| 79 | + it 'does not show attendees tab to non-organizer' do |
| 80 | + get better_together.event_path(event, locale:) |
| 81 | + |
| 82 | + expect(response).to have_http_status(:ok) |
| 83 | + expect(response.body).not_to include('id="attendees-tab"') |
| 84 | + end |
| 85 | + end |
| 86 | + end |
| 87 | + |
52 | 88 | describe 'RSVP actions' do |
53 | 89 | let(:user_email) { '[email protected]' } |
54 | 90 | let(:password) { 'password12345' } |
|
0 commit comments