jekyll-attendease 0.6.25k → 0.6.26a
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/jekyll/attendease_plugin.rb +17 -0
- data/lib/jekyll/attendease_plugin/config_mixin.rb +17 -0
- data/lib/jekyll/attendease_plugin/event_data_generator.rb +101 -98
- data/lib/jekyll/attendease_plugin/organization_data_generator.rb +70 -0
- data/lib/jekyll/attendease_plugin/schedule_generator.rb +3 -1
- data/lib/jekyll/attendease_plugin/site_page_blocks_json.rb +42 -0
- data/lib/jekyll/attendease_plugin/site_pages_generator.rb +1 -1
- data/lib/jekyll/attendease_plugin/sponsor_generator.rb +4 -2
- data/lib/jekyll/attendease_plugin/version.rb +1 -1
- data/spec/lib/jekyll/attendease_plugin/event_data_generator_spec.rb +63 -43
- data/spec/lib/jekyll/attendease_plugin/event_layout_generator_spec.rb +3 -2
- data/spec/lib/jekyll/attendease_plugin/event_template_generator_spec.rb +23 -6
- data/spec/lib/jekyll/attendease_plugin/filters_spec.rb +5 -2
- data/spec/lib/jekyll/attendease_plugin/organization_data_generator_spec.rb +21 -0
- data/spec/lib/jekyll/attendease_plugin/pre_zero_point_six_link_redirect_generator_spec.rb +8 -8
- data/spec/lib/jekyll/attendease_plugin/schedule_generator_spec.rb +179 -142
- data/spec/lib/jekyll/attendease_plugin/site_page_spec.rb +3 -4
- data/spec/lib/jekyll/attendease_plugin/site_pages_generator_spec.rb +7 -10
- data/spec/lib/jekyll/attendease_plugin/sponsor_generator_spec.rb +13 -4
- data/spec/lib/jekyll/attendease_plugin/tags_spec.rb +3 -2
- data/spec/spec_helper.rb +36 -28
- metadata +7 -2
@@ -1,61 +1,81 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
3
|
RSpec.describe Jekyll::AttendeasePlugin::EventDataGenerator do
|
4
|
+
context 'legacy site' do
|
5
|
+
let(:site) { build_site }
|
4
6
|
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
#end
|
10
|
-
it 'populates a site wide presenters array' do
|
11
|
-
expect(@site.data['presenters'].class).to eq(Array)
|
12
|
-
expect(@site.data['presenters'].length).to eq(2)
|
13
|
-
end
|
7
|
+
it 'populates a site wide presenters array' do
|
8
|
+
expect(site.data['presenters'].class).to eq(Array)
|
9
|
+
expect(site.data['presenters'].length).to eq(2)
|
10
|
+
end
|
14
11
|
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
12
|
+
it 'populates a site wide rooms array' do
|
13
|
+
expect(site.data['rooms'].class).to eq(Array)
|
14
|
+
expect(site.data['rooms'].length).to eq(1)
|
15
|
+
end
|
19
16
|
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
17
|
+
it 'populates a site wide sessions array' do
|
18
|
+
expect(site.data['sessions'].class).to eq(Array)
|
19
|
+
expect(site.data['sessions'].length).to eq(3)
|
20
|
+
end
|
24
21
|
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
22
|
+
it 'populates a site wide venues array' do
|
23
|
+
expect(site.data['venues'].class).to eq(Array)
|
24
|
+
expect(site.data['venues'].length).to eq(2)
|
25
|
+
end
|
29
26
|
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
27
|
+
it 'populates a site wide filters array' do
|
28
|
+
expect(site.data['filters'].class).to eq(Array)
|
29
|
+
expect(site.data['filters'].length).to eq(1)
|
30
|
+
end
|
34
31
|
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
32
|
+
it 'populates a site wide days array' do
|
33
|
+
expect(site.config['attendease']['days'].class).to eq(Array)
|
34
|
+
expect(site.config['attendease']['days'].length).to eq(2)
|
35
|
+
end
|
39
36
|
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
37
|
+
it 'populates a site wide sponsors array' do
|
38
|
+
expect(site.data['sponsors'].class).to eq(Array)
|
39
|
+
expect(site.data['sponsors'].length).to eq(1)
|
40
|
+
end
|
44
41
|
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
42
|
+
it 'populates a site wide pages array' do
|
43
|
+
expect(site.data['pages'].class).to eq(Array)
|
44
|
+
expect(site.data['pages'].length).to eq(10)
|
45
|
+
end
|
49
46
|
|
50
|
-
|
51
|
-
|
52
|
-
|
47
|
+
it 'populates a site wide event object' do
|
48
|
+
expect(site.data['event'].class).to eq(Hash)
|
49
|
+
end
|
53
50
|
|
54
|
-
|
55
|
-
|
56
|
-
|
51
|
+
it 'populates a site wide settings object' do
|
52
|
+
expect(site.data['site_settings'].class).to eq(Hash)
|
53
|
+
expect(site.data['site_settings']['look_and_feel']['body_font_family']).to eq('serif')
|
54
|
+
end
|
57
55
|
end
|
58
56
|
|
57
|
+
context 'new cms site' do
|
58
|
+
let(:site) { build_site({ 'attendease' => { 'jekyll33' => true }}) }
|
59
|
+
|
60
|
+
it 'populates a site wide pages array' do
|
61
|
+
expect(site.data['pages'].class).to eq(Array)
|
62
|
+
expect(site.data['pages'].length).to eq(10)
|
63
|
+
end
|
64
|
+
|
65
|
+
it 'populates a site wide event object' do
|
66
|
+
expect(site.data['event'].class).to eq(Hash)
|
67
|
+
end
|
68
|
+
|
69
|
+
it 'populates a site wide settings object' do
|
70
|
+
expect(site.data['site_settings'].class).to eq(Hash)
|
71
|
+
expect(site.data['site_settings']['look_and_feel']['body_font_family']).to eq('serif')
|
72
|
+
end
|
73
|
+
|
74
|
+
it 'does not populate a site wide sponsors array' do
|
75
|
+
expect(site.data['sponsors']).to be_nil
|
76
|
+
end
|
77
|
+
|
78
|
+
end
|
59
79
|
|
60
80
|
end
|
61
81
|
|
@@ -1,16 +1,17 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
3
|
RSpec.describe Jekyll::AttendeasePlugin::EventLayoutGenerator do
|
4
|
+
let(:site) { build_site }
|
4
5
|
|
5
6
|
it 'creates the pre-compiled layout stubs' do
|
6
7
|
%w{ layout register surveys }.each do |layout|
|
7
|
-
expect(File.exists?(File.join(
|
8
|
+
expect(File.exists?(File.join(site.config['destination'], 'attendease_layouts', "#{layout}.html"))).to eq(true)
|
8
9
|
end
|
9
10
|
end
|
10
11
|
|
11
12
|
it 'creates the pre-compiled email layout stubs' do
|
12
13
|
%w{ layout }.each do |layout|
|
13
|
-
expect(File.exists?(File.join(
|
14
|
+
expect(File.exists?(File.join(site.config['destination'], 'attendease_layouts', 'emails', "#{layout}.html"))).to eq(true)
|
14
15
|
end
|
15
16
|
end
|
16
17
|
|
@@ -1,17 +1,34 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
3
|
RSpec.describe Jekyll::AttendeasePlugin::EventTemplateGenerator do
|
4
|
+
context 'event site' do
|
5
|
+
let(:site) { build_site }
|
4
6
|
|
5
|
-
|
6
|
-
|
7
|
+
it 'creates the Attendease template files' do
|
8
|
+
template_files = Dir.chdir(File.join(@template_root, 'attendease')) { Dir.glob('**/**.html') }
|
7
9
|
|
8
|
-
|
9
|
-
|
10
|
+
template_files.each do |template_file|
|
11
|
+
path = File.join(site.config['source'], '_attendease', 'templates', template_file)
|
10
12
|
|
11
|
-
|
12
|
-
|
13
|
+
expect(File.exists?(path)).to eq(true)
|
14
|
+
expect(File.size(path)).to be > 0
|
15
|
+
end
|
13
16
|
end
|
14
17
|
end
|
15
18
|
|
19
|
+
context 'organization site' do
|
20
|
+
let(:site) { build_org_site }
|
21
|
+
|
22
|
+
it 'creates the Attendease template files' do
|
23
|
+
template_files = Dir.chdir(File.join(@template_root, 'attendease')) { Dir.glob('**/**.html') }
|
24
|
+
|
25
|
+
template_files.each do |template_file|
|
26
|
+
path = File.join(site.config['source'], '_attendease', 'templates', template_file)
|
27
|
+
|
28
|
+
expect(File.exists?(path)).to eq(true)
|
29
|
+
expect(File.size(path)).to be > 0
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
16
33
|
end
|
17
34
|
|
@@ -1,10 +1,13 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
|
+
# Error reading file /Users/patrick/work/jekyll-attendease/spec/lib/jekyll/attendease_plugin/fixtures/page.html: No such file or directory @ rb_sysopen - /Users/patrick/work/jekyll-attendease/spec/fixtures/Users/patrick/work/jekyll-attendease/spec/lib/jekyll/attendease_plugin/fixtures/page.html
|
3
4
|
RSpec.describe "Jekyll Attendease filters" do
|
4
|
-
let(:
|
5
|
+
let(:site) { build_site }
|
6
|
+
let(:page) { Jekyll::Page.new(site, fixtures_path.to_s, '', 'page.html') }
|
7
|
+
let(:page_data) { page.data['foo'] }
|
5
8
|
|
6
9
|
def render(content)
|
7
|
-
::Liquid::Template.parse(content).render({'page' =>
|
10
|
+
::Liquid::Template.parse(content).render({'page' => page.data})
|
8
11
|
end
|
9
12
|
|
10
13
|
context "{{ 'foo Bar bat' | slugify %}" do
|
@@ -0,0 +1,21 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
RSpec.describe Jekyll::AttendeasePlugin::OrganizationDataGenerator do
|
4
|
+
context 'new cms site' do
|
5
|
+
let(:site) { build_org_site }
|
6
|
+
|
7
|
+
it 'populates a site wide pages array' do
|
8
|
+
expect(site.data['pages'].class).to eq(Array)
|
9
|
+
expect(site.data['pages'].length).to eq(10)
|
10
|
+
end
|
11
|
+
|
12
|
+
it 'populates a site wide settings object' do
|
13
|
+
expect(site.data['site_settings'].class).to eq(Hash)
|
14
|
+
expect(site.data['site_settings']['look_and_feel']['body_font_family']).to eq('serif')
|
15
|
+
|
16
|
+
require 'pry'
|
17
|
+
binding.pry
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
@@ -1,37 +1,37 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
3
|
RSpec.describe Jekyll::AttendeasePlugin::PreZeroPointSixLinkRedirectGenerator do
|
4
|
+
let(:site) { build_site({ 'attendease' => { 'redirect_ugly_urls' => true } }) }
|
5
|
+
let(:schedule_generator) { find_generator(site, Jekyll::AttendeasePlugin::ScheduleGenerator) }
|
4
6
|
|
5
7
|
context 'in a site with config.attendease.redirect_ugly_urls = true' do
|
6
8
|
before(:all) do
|
7
|
-
@site = build_site({ 'attendease' => { 'redirect_ugly_urls' => true } })
|
8
|
-
@schedule_generator = find_generator(Jekyll::AttendeasePlugin::ScheduleGenerator)
|
9
9
|
end
|
10
10
|
|
11
11
|
it 'creates a redirect file from the old presenter.id URL to the new slug' do
|
12
|
-
file = File.join(
|
12
|
+
file = File.join(site.config['destination'], site.config['attendease']['presenters_path_name'], schedule_generator.schedule_data.presenters.first['id'], 'index.html')
|
13
13
|
|
14
14
|
expect(File.exists?(file)).to eq(true)
|
15
15
|
expect(File.file?(file)).to eq(true)
|
16
|
-
expect(File.read(file)).to include
|
16
|
+
expect(File.read(file)).to include schedule_generator.schedule_data.presenters.first['slug']
|
17
17
|
expect(File.read(file)).to_not include 'My awesome'
|
18
18
|
end
|
19
19
|
|
20
20
|
it 'creates a redirect file from the old venue.id URL to the new slug' do
|
21
|
-
file = File.join(
|
21
|
+
file = File.join(site.config['destination'], site.config['attendease']['venues_path_name'], schedule_generator.schedule_data.venues.first['id'], 'index.html')
|
22
22
|
|
23
23
|
expect(File.exists?(file)).to eq(true)
|
24
24
|
expect(File.file?(file)).to eq(true)
|
25
|
-
expect(File.read(file)).to include
|
25
|
+
expect(File.read(file)).to include schedule_generator.schedule_data.venues.first['slug']
|
26
26
|
expect(File.read(file)).to_not include 'My awesome'
|
27
27
|
end
|
28
28
|
|
29
29
|
it 'creates a redirect file from the old session.code URL to the new slug' do
|
30
|
-
file = File.join(
|
30
|
+
file = File.join(site.config['destination'], site.config['attendease']['schedule_path_name'], schedule_generator.schedule_data.sessions.first['code'], 'index.html')
|
31
31
|
|
32
32
|
expect(File.exists?(file)).to eq(true)
|
33
33
|
expect(File.file?(file)).to eq(true)
|
34
|
-
expect(File.read(file)).to include
|
34
|
+
expect(File.read(file)).to include schedule_generator.schedule_data.sessions.first['slug']
|
35
35
|
expect(File.read(file)).to_not include 'My awesome'
|
36
36
|
end
|
37
37
|
end
|
@@ -1,205 +1,242 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
3
|
RSpec.describe Jekyll::AttendeasePlugin::ScheduleGenerator do
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
file = File.join(@site.dest, @site.config['attendease']['presenters_path_name'], @index_file)
|
17
|
-
expect(File.exists?(file)).to eq(true)
|
18
|
-
expect(File.file?(file)).to eq(true)
|
19
|
-
end
|
20
|
-
|
21
|
-
it 'creates a presenter page' do
|
22
|
-
file = File.join(@site.dest, @site.config['attendease']['presenters_path_name'], @presenter_slug)
|
23
|
-
expect(File.exists?(file)).to eq(true)
|
24
|
-
expect(File.file?(file)).to eq(true)
|
25
|
-
end
|
26
|
-
|
27
|
-
it 'creates a schedule index page' do
|
28
|
-
file = File.join(@site.dest, @site.config['attendease']['schedule_path_name'], @index_file)
|
29
|
-
expect(File.exists?(file)).to eq(true)
|
30
|
-
expect(File.file?(file)).to eq(true)
|
31
|
-
end
|
32
|
-
|
33
|
-
it 'creates a schedule day index page' do
|
34
|
-
file = File.join(@site.dest, @site.config['attendease']['schedule_path_name'], @date, @index_file)
|
35
|
-
expect(File.exists?(file)).to eq(true)
|
36
|
-
expect(File.file?(file)).to eq(true)
|
37
|
-
expect(File.read(File.join(@site.dest, @site.config['attendease']['schedule_path_name'], @index_file))).to include 'attendease-session-and-instance'
|
38
|
-
end
|
39
|
-
|
40
|
-
it 'creates a schedule sessions index page' do
|
41
|
-
file = File.join(@site.dest, @site.config['attendease']['schedule_path_name'], 'sessions', @index_file)
|
42
|
-
expect(File.exists?(file)).to eq(true)
|
43
|
-
expect(File.file?(file)).to eq(true)
|
44
|
-
end
|
45
|
-
|
46
|
-
it 'creates a schedule session page' do
|
47
|
-
file = File.join(@site.dest, @site.config['attendease']['schedule_path_name'], 'sessions', @session_slug)
|
48
|
-
expect(File.exists?(file)).to eq(true)
|
49
|
-
expect(File.file?(file)).to eq(true)
|
50
|
-
end
|
51
|
-
|
52
|
-
context 'with a localized name' do
|
53
|
-
before do
|
54
|
-
@session_slug_localized = @schedule_generator.schedule_data.sessions.last['slug']
|
55
|
-
@presenter_slug_localized = @schedule_generator.schedule_data.presenters.last['slug']
|
56
|
-
@venue_slug_localized = @schedule_generator.schedule_data.venues.last['slug']
|
57
|
-
end
|
58
|
-
|
59
|
-
it 'should use the session code' do
|
60
|
-
expect(@session_slug_localized).to eq('420.html')
|
61
|
-
end
|
62
|
-
|
63
|
-
it 'creates a schedule session page for the name' do
|
64
|
-
file = File.join(@site.dest, @site.config['attendease']['schedule_path_name'], 'sessions', @session_slug_localized)
|
4
|
+
context 'legacy event sites' do
|
5
|
+
let(:site) { build_site({ 'attendease' => { 'redirect_ugly_urls' => true } }) }
|
6
|
+
let(:schedule_generator) { find_generator(site, Jekyll::AttendeasePlugin::ScheduleGenerator) }
|
7
|
+
let(:index_file) { 'index.html' }
|
8
|
+
let(:date) { schedule_generator.schedule_data.event['dates'].first['date'] }
|
9
|
+
let(:session_slug) { schedule_generator.schedule_data.sessions.first['slug'] }
|
10
|
+
let(:presenter_slug) { schedule_generator.schedule_data.presenters.first['slug'] }
|
11
|
+
let(:presenter_social) { schedule_generator.schedule_data.presenters.first['social'] }
|
12
|
+
let(:venue_slug) { schedule_generator.schedule_data.venues.first['slug'] }
|
13
|
+
|
14
|
+
it 'creates a presenters index page' do
|
15
|
+
file = File.join(site.dest, site.config['attendease']['presenters_path_name'], index_file)
|
65
16
|
expect(File.exists?(file)).to eq(true)
|
66
17
|
expect(File.file?(file)).to eq(true)
|
67
18
|
end
|
68
19
|
|
69
|
-
it 'should use the presenter id' do
|
70
|
-
expect(@presenter_slug_localized).to eq('53bc134b02c8bc9994000055.html')
|
71
|
-
end
|
72
|
-
|
73
20
|
it 'creates a presenter page' do
|
74
|
-
file = File.join(
|
21
|
+
file = File.join(site.dest, site.config['attendease']['presenters_path_name'], presenter_slug)
|
75
22
|
expect(File.exists?(file)).to eq(true)
|
76
23
|
expect(File.file?(file)).to eq(true)
|
77
24
|
end
|
78
25
|
|
79
|
-
it '
|
80
|
-
|
81
|
-
end
|
82
|
-
|
83
|
-
it 'creates a venue page' do
|
84
|
-
file = File.join(@site.dest, @site.config['attendease']['venues_path_name'], @venue_slug_localized)
|
26
|
+
it 'creates a schedule index page' do
|
27
|
+
file = File.join(site.dest, site.config['attendease']['schedule_path_name'], index_file)
|
85
28
|
expect(File.exists?(file)).to eq(true)
|
86
29
|
expect(File.file?(file)).to eq(true)
|
87
30
|
end
|
88
|
-
end
|
89
|
-
|
90
|
-
context 'presenter linking' do
|
91
|
-
it 'links presenters correctly from the presenter index page' do
|
92
|
-
expect(File.read(File.join(@site.dest, @site.config['attendease']['presenters_path_name'], @index_file))).to include @presenter_slug
|
93
|
-
end
|
94
|
-
|
95
|
-
it 'links presenters correctly from the session page' do
|
96
|
-
expect(File.read(File.join(@site.dest, @site.config['attendease']['schedule_path_name'], 'sessions', @session_slug))).to include @presenter_slug
|
97
|
-
end
|
98
|
-
end
|
99
31
|
|
100
|
-
|
101
|
-
|
102
|
-
file = File.join(@site.dest, @site.config['attendease']['venue_path_name'], @index_file)
|
32
|
+
it 'creates a schedule day index page' do
|
33
|
+
file = File.join(site.dest, site.config['attendease']['schedule_path_name'], date, index_file)
|
103
34
|
expect(File.exists?(file)).to eq(true)
|
104
35
|
expect(File.file?(file)).to eq(true)
|
36
|
+
expect(File.read(File.join(site.dest, site.config['attendease']['schedule_path_name'], index_file))).to include 'attendease-session-and-instance'
|
105
37
|
end
|
106
|
-
end
|
107
38
|
|
108
|
-
|
109
|
-
|
110
|
-
file = File.join(@site.dest, @site.config['attendease']['venues_path_name'], @index_file)
|
39
|
+
it 'creates a schedule sessions index page' do
|
40
|
+
file = File.join(site.dest, site.config['attendease']['schedule_path_name'], 'sessions', index_file)
|
111
41
|
expect(File.exists?(file)).to eq(true)
|
112
42
|
expect(File.file?(file)).to eq(true)
|
113
43
|
end
|
114
44
|
|
115
|
-
it 'creates a
|
116
|
-
file = File.join(
|
45
|
+
it 'creates a schedule session page' do
|
46
|
+
file = File.join(site.dest, site.config['attendease']['schedule_path_name'], 'sessions', session_slug)
|
117
47
|
expect(File.exists?(file)).to eq(true)
|
118
48
|
expect(File.file?(file)).to eq(true)
|
119
49
|
end
|
120
|
-
end
|
121
50
|
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
51
|
+
it 'makes all data available to the entire site' do
|
52
|
+
expect(site.config['attendease']['event']['id']).to eq('foobar')
|
53
|
+
%w{ site event sessions presenters rooms filters venues sponsors lingo }.each do |key|
|
54
|
+
expect(site.config['attendease'].include?(key)).to eq(true)
|
55
|
+
end
|
56
|
+
end
|
126
57
|
|
127
|
-
|
128
|
-
|
58
|
+
context 'with a localized name' do
|
59
|
+
let(:session_slug_localized) { schedule_generator.schedule_data.sessions.last['slug'] }
|
60
|
+
let(:presenter_slug_localized) { schedule_generator.schedule_data.presenters.last['slug'] }
|
61
|
+
let(:venue_slug_localized) { schedule_generator.schedule_data.venues.last['slug'] }
|
62
|
+
|
63
|
+
it 'should use the session code' do
|
64
|
+
expect(session_slug_localized).to eq('420.html')
|
65
|
+
end
|
66
|
+
|
67
|
+
it 'creates a schedule session page for the name' do
|
68
|
+
file = File.join(site.dest, site.config['attendease']['schedule_path_name'], 'sessions', session_slug_localized)
|
69
|
+
expect(File.exists?(file)).to eq(true)
|
70
|
+
expect(File.file?(file)).to eq(true)
|
71
|
+
end
|
72
|
+
|
73
|
+
it 'should use the presenter id' do
|
74
|
+
expect(presenter_slug_localized).to eq('53bc134b02c8bc9994000055.html')
|
75
|
+
end
|
76
|
+
|
77
|
+
it 'creates a presenter page' do
|
78
|
+
file = File.join(site.dest, site.config['attendease']['presenters_path_name'], presenter_slug_localized)
|
79
|
+
expect(File.exists?(file)).to eq(true)
|
80
|
+
expect(File.file?(file)).to eq(true)
|
81
|
+
end
|
82
|
+
|
83
|
+
it 'should use the venue id' do
|
84
|
+
expect(venue_slug_localized).to eq('53bc120d02c8bc9994000032.html')
|
85
|
+
end
|
86
|
+
|
87
|
+
it 'creates a venue page' do
|
88
|
+
file = File.join(site.dest, site.config['attendease']['venues_path_name'], venue_slug_localized)
|
89
|
+
expect(File.exists?(file)).to eq(true)
|
90
|
+
expect(File.file?(file)).to eq(true)
|
91
|
+
end
|
129
92
|
end
|
130
93
|
|
131
|
-
|
132
|
-
|
133
|
-
|
94
|
+
context 'presenter linking' do
|
95
|
+
it 'links presenters correctly from the presenter index page' do
|
96
|
+
expect(File.read(File.join(site.dest, site.config['attendease']['presenters_path_name'], index_file))).to include presenter_slug
|
97
|
+
end
|
134
98
|
|
135
|
-
|
136
|
-
|
99
|
+
it 'links presenters correctly from the session page' do
|
100
|
+
expect(File.read(File.join(site.dest, site.config['attendease']['schedule_path_name'], 'sessions', session_slug))).to include presenter_slug
|
101
|
+
end
|
137
102
|
end
|
138
|
-
end
|
139
103
|
|
140
|
-
|
141
|
-
|
142
|
-
|
104
|
+
# can't easily test this since we need to provide a different data set.
|
105
|
+
#context 'a single venue' do
|
106
|
+
#it 'creates a venue index page' do
|
107
|
+
#file = File.join(site.dest, site.config['attendease']['venue_path_name'], index_file)
|
108
|
+
#expect(File.exists?(file)).to eq(true)
|
109
|
+
#expect(File.file?(file)).to eq(true)
|
110
|
+
#end
|
111
|
+
#end
|
112
|
+
|
113
|
+
context 'multiple venues' do
|
114
|
+
it 'creates a venue index page' do
|
115
|
+
file = File.join(site.dest, site.config['attendease']['venues_path_name'], index_file)
|
116
|
+
expect(File.exists?(file)).to eq(true)
|
117
|
+
expect(File.file?(file)).to eq(true)
|
118
|
+
end
|
119
|
+
|
120
|
+
it 'creates a venue page' do
|
121
|
+
file = File.join(site.dest, site.config['attendease']['venues_path_name'], venue_slug)
|
122
|
+
expect(File.exists?(file)).to eq(true)
|
123
|
+
expect(File.file?(file)).to eq(true)
|
124
|
+
end
|
143
125
|
end
|
144
126
|
|
145
|
-
|
146
|
-
|
127
|
+
context 'presenter social links' do
|
128
|
+
it 'includes the included social links' do
|
129
|
+
expect(File.read(File.join(site.dest, site.config['attendease']['presenters_path_name'], index_file))).to include "twitter.com/#{presenter_social['twitter']}"
|
130
|
+
expect(File.read(File.join(site.dest, site.config['attendease']['presenters_path_name'], index_file))).to include "facebook.com/#{presenter_social['facebook']}"
|
131
|
+
|
132
|
+
expect(File.read(File.join(site.dest, site.config['attendease']['presenters_path_name'], presenter_slug))).to include "twitter.com/#{presenter_social['twitter']}"
|
133
|
+
expect(File.read(File.join(site.dest, site.config['attendease']['presenters_path_name'], presenter_slug))).to include "facebook.com/#{presenter_social['facebook']}"
|
134
|
+
end
|
135
|
+
|
136
|
+
it 'does not include social links that are not there' do
|
137
|
+
expect(File.read(File.join(site.dest, site.config['attendease']['presenters_path_name'], index_file))).to_not include "linkedin"
|
138
|
+
expect(File.read(File.join(site.dest, site.config['attendease']['presenters_path_name'], index_file))).to_not include "googleplus"
|
139
|
+
|
140
|
+
expect(File.read(File.join(site.dest, site.config['attendease']['presenters_path_name'], presenter_slug))).to_not include "linkedin"
|
141
|
+
expect(File.read(File.join(site.dest, site.config['attendease']['presenters_path_name'], presenter_slug))).to_not include "googleplus"
|
142
|
+
end
|
147
143
|
end
|
148
144
|
|
149
|
-
|
150
|
-
|
145
|
+
context 'venue linking' do
|
146
|
+
it 'links venues correctly from the venue index page' do
|
147
|
+
expect(File.read(File.join(site.dest, site.config['attendease']['venues_path_name'], index_file))).to include venue_slug
|
148
|
+
end
|
149
|
+
|
150
|
+
it 'links venues correctly from the presenter page' do
|
151
|
+
expect(File.read(File.join(site.dest, site.config['attendease']['presenters_path_name'], presenter_slug))).to include venue_slug
|
152
|
+
end
|
153
|
+
|
154
|
+
it 'links venues correctly from the session page' do
|
155
|
+
expect(File.read(File.join(site.dest, site.config['attendease']['schedule_path_name'], 'sessions', session_slug))).to include venue_slug
|
156
|
+
end
|
151
157
|
end
|
152
|
-
end
|
153
158
|
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
159
|
+
context 'in a site with attendease.show_schedule_index = true' do
|
160
|
+
it 'creates the day index page and show schedule widget' do
|
161
|
+
site = build_site({ 'attendease' => { 'show_schedule_index' => true } })
|
162
|
+
expect(File.read(File.join(site.dest, site.config['attendease']['schedule_path_name'], index_file))).to include 'attendease-schedule-widget'
|
163
|
+
end
|
158
164
|
end
|
159
|
-
end
|
160
165
|
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
+
context 'in a site with attendease.session_slug_uses_code = true' do
|
167
|
+
it 'creates a schedule session page' do
|
168
|
+
site = build_site({ 'attendease' => { 'session_slug_uses_code' => true } })
|
169
|
+
schedule_generator = find_generator(site, described_class)
|
170
|
+
session_slug = schedule_generator.schedule_data.sessions.first['slug']
|
166
171
|
|
167
|
-
|
172
|
+
expect(File.exists?(File.join(site.dest, site.config['attendease']['schedule_path_name'], 'sessions', session_slug))).to eq(true)
|
173
|
+
end
|
168
174
|
end
|
169
175
|
end
|
170
176
|
|
171
|
-
context '
|
172
|
-
|
173
|
-
|
177
|
+
context 'CMS event sites' do
|
178
|
+
let(:site) { build_site({ 'attendease' => { 'jekyll33' => true } }) }
|
179
|
+
|
180
|
+
it 'does not create a schedule folder' do
|
181
|
+
expect(File.exists?(File.join(site.dest, 'schedule', 'index.html'))).to eq(false)
|
182
|
+
end
|
174
183
|
|
175
|
-
|
184
|
+
it 'does not create a presenters folder' do
|
185
|
+
expect(File.exists?(File.join(site.dest, 'presenters', 'index.html'))).to eq(false)
|
176
186
|
end
|
177
187
|
|
178
|
-
it '
|
179
|
-
|
188
|
+
it 'does not create a venues folder' do
|
189
|
+
expect(File.exists?(File.join(site.dest, 'venues', 'index.html'))).to eq(false)
|
190
|
+
end
|
180
191
|
|
181
|
-
|
192
|
+
it 'does not create a sponsors folder' do
|
193
|
+
expect(File.exists?(File.join(site.dest, 'sponsors', 'index.html'))).to eq(false)
|
182
194
|
end
|
195
|
+
end
|
196
|
+
context 'in a site with the page paths set to nil' do
|
197
|
+
let(:site) { build_site({ 'attendease' => {
|
198
|
+
'schedule_path_name' => false,
|
199
|
+
'presenters_path_name' => false,
|
200
|
+
'venues_path_name' => false,
|
201
|
+
'venue_path_name' => false,
|
202
|
+
'sponsors_path_name' => false
|
203
|
+
} }) }
|
183
204
|
|
184
|
-
it '
|
185
|
-
|
205
|
+
it 'does not create a schedule folder' do
|
206
|
+
expect(File.exists?(File.join(site.dest, 'schedule', 'index.html'))).to eq(false)
|
207
|
+
end
|
186
208
|
|
187
|
-
|
209
|
+
it 'does not create a presenters folder' do
|
210
|
+
expect(File.exists?(File.join(site.dest, 'presenters', 'index.html'))).to eq(false)
|
188
211
|
end
|
189
212
|
|
190
|
-
it '
|
191
|
-
|
213
|
+
it 'does not create a venues folder' do
|
214
|
+
expect(File.exists?(File.join(site.dest, 'venues', 'index.html'))).to eq(false)
|
215
|
+
end
|
192
216
|
|
193
|
-
|
217
|
+
it 'does not create a sponsors folder' do
|
218
|
+
expect(File.exists?(File.join(site.dest, 'sponsors', 'index.html'))).to eq(false)
|
194
219
|
end
|
195
220
|
end
|
196
221
|
|
197
|
-
|
198
|
-
|
222
|
+
context 'organization mode site' do
|
223
|
+
let(:site) { build_org_site }
|
224
|
+
|
225
|
+
it 'does not create a schedule folder' do
|
226
|
+
expect(File.exists?(File.join(site.dest, 'schedule', 'index.html'))).to eq(false)
|
227
|
+
end
|
228
|
+
|
229
|
+
it 'does not create a presenters folder' do
|
230
|
+
expect(File.exists?(File.join(site.dest, 'presenters', 'index.html'))).to eq(false)
|
231
|
+
end
|
232
|
+
|
233
|
+
it 'does not create a venues folder' do
|
234
|
+
expect(File.exists?(File.join(site.dest, 'venues', 'index.html'))).to eq(false)
|
235
|
+
end
|
199
236
|
|
200
|
-
|
201
|
-
|
202
|
-
expect(@site.config['attendease'].include?(key)).to eq(true)
|
237
|
+
it 'does not create a sponsors folder' do
|
238
|
+
expect(File.exists?(File.join(site.dest, 'sponsors', 'index.html'))).to eq(false)
|
203
239
|
end
|
240
|
+
|
204
241
|
end
|
205
242
|
end
|