-
Notifications
You must be signed in to change notification settings - Fork 10
/
visit_event_series_spec.rb
42 lines (34 loc) · 1.1 KB
/
visit_event_series_spec.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# frozen_string_literal: true
require "rails_helper"
RSpec.describe "visit an event series page" do
let(:user) { users(:third_user) }
let(:owner) { users(:fourth_user) }
let(:steward) { users(:fifth_user) }
let(:admin) { users(:admin_user) }
before do
organization.update(created_by: owner.id)
organization.stewards << steward
end
let(:person_1) { people(:series_finisher) }
let(:person_2) { people(:slow_finisher) }
let(:person_3) { people(:finished_second) }
let(:organization) { subject_series.organization }
let(:events) { subject_series.events }
context "when the user is a visitor" do
context "when all categories are populated" do
let(:subject_series) { event_series(:d30_short_series) }
scenario "Visit the page" do
visit organization_event_series_path(organization, subject_series)
verify_page_header
verify_event_links
end
end
end
def verify_page_header
verify_content_present(subject_series)
verify_content_present(organization)
end
def verify_event_links
events.each(&method(:verify_link_present))
end
end