almanack 1.1.0 → 1.1.1
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
- checksums.yaml.gz.sig +0 -0
- data/.gitignore +12 -17
- data/.rspec +3 -0
- data/.travis.yml +2 -0
- data/CODE_OF_CONDUCT.md +74 -0
- data/Gemfile +1 -1
- data/Gemfile.lock +123 -0
- data/LICENSE.txt +17 -18
- data/README.md +22 -4
- data/Rakefile +16 -0
- data/almanack.gemspec +18 -8
- data/bin/console +14 -0
- data/bin/setup +8 -0
- data/bin/test +2 -0
- data/certs/aupajo.pem +25 -0
- data/{bin → exe}/almanack +0 -0
- data/lib/almanack/version.rb +1 -1
- data.tar.gz.sig +0 -0
- metadata +62 -59
- metadata.gz.sig +3 -0
- data/spec/almanack_spec.rb +0 -8
- data/spec/calendar_spec.rb +0 -71
- data/spec/configuration_spec.rb +0 -113
- data/spec/event_source/ical_feed_spec.rb +0 -40
- data/spec/event_source/meetup_group_spec.rb +0 -63
- data/spec/event_source/static_spec.rb +0 -41
- data/spec/event_spec.rb +0 -121
- data/spec/features/api_feature_spec.rb +0 -24
- data/spec/features/calendar_feature_spec.rb +0 -44
- data/spec/features/sass_features_spec.rb +0 -15
- data/spec/features/subscription_feature_spec.rb +0 -60
- data/spec/fixtures/responses/google_calendar.yml +0 -1896
- data/spec/fixtures/responses/meetup-without-location.yml +0 -11880
- data/spec/fixtures/responses/meetup.yml +0 -1437
- data/spec/fixtures/themes/sassy/stylesheets/imported.scss +0 -0
- data/spec/fixtures/themes/sassy/stylesheets/imports.scss +0 -1
- data/spec/representation/json_feed_spec.rb +0 -44
- data/spec/serialized_transformation_spec.rb +0 -45
- data/spec/spec_helper.rb +0 -21
- data/spec/support/event_matchers.rb +0 -54
- data/spec/support/server_support.rb +0 -10
- data/spec/support/time_comparison_matchers.rb +0 -14
@@ -1,44 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
describe "Viewing a calendar", :feature do
|
4
|
-
before { Almanack.reset! }
|
5
|
-
|
6
|
-
it "displays all upcoming events" do
|
7
|
-
now = Time.now
|
8
|
-
|
9
|
-
Almanack.config.add_events [
|
10
|
-
{ title: "Hogswatch", start_time: now },
|
11
|
-
{ title: "Soul Cake Tuesday", start_time: now + 10 * 24 * 60 * 60 },
|
12
|
-
{ title: "Eve of Small Gods", start_time: now + 30 * 24 * 60 * 60 },
|
13
|
-
]
|
14
|
-
|
15
|
-
Timecop.freeze(now) do
|
16
|
-
get "/"
|
17
|
-
end
|
18
|
-
|
19
|
-
expect(last_response).to have_event_on_page("Hogswatch")
|
20
|
-
expect(last_response).to have_event_on_page("Soul Cake Tuesday")
|
21
|
-
expect(last_response).to have_event_on_page("Eve of Small Gods")
|
22
|
-
end
|
23
|
-
|
24
|
-
it "displays events from an iCal feed" do
|
25
|
-
Almanack.config.add_ical_feed "https://www.google.com/calendar/ical/61s2re9bfk01abmla4d17tojuo%40group.calendar.google.com/public/basic.ics"
|
26
|
-
|
27
|
-
Timecop.freeze(2014, 4, 3) do
|
28
|
-
VCR.use_cassette('google_calendar') do
|
29
|
-
get "/"
|
30
|
-
end
|
31
|
-
end
|
32
|
-
|
33
|
-
expect(last_response).to have_event_on_page("Ruby Meetup @catalyst - Tanks! Guns!")
|
34
|
-
expect(last_response).to have_event_on_page("The Foundation")
|
35
|
-
expect(last_response).to have_event_on_page("WikiHouse/NZ weekly meet-up")
|
36
|
-
expect(last_response).to have_event_on_page("Christchurch Python Meetup")
|
37
|
-
expect(last_response).to have_event_on_page("Coffee & Jam")
|
38
|
-
end
|
39
|
-
|
40
|
-
it "allows being embedded in an iframe" do
|
41
|
-
get "/"
|
42
|
-
expect(last_response.headers).to_not have_key("X-Frame-Options")
|
43
|
-
end
|
44
|
-
end
|
@@ -1,15 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
describe "Sass rendering", :feature do
|
4
|
-
before { Almanack.reset! }
|
5
|
-
|
6
|
-
it "can import sass" do
|
7
|
-
allow(Almanack.config).to receive(:theme_root) { fixture_theme('sassy') }
|
8
|
-
get "/stylesheets/imports.css"
|
9
|
-
raise last_response.errors unless last_response.errors.empty?
|
10
|
-
end
|
11
|
-
|
12
|
-
def fixture_theme(name)
|
13
|
-
Pathname(__dir__).parent.join('fixtures', 'themes', name)
|
14
|
-
end
|
15
|
-
end
|
@@ -1,60 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
describe "Consolidated iCal feed", :feature do
|
4
|
-
let(:now) { Time.now }
|
5
|
-
let(:parsed_feed) { RiCal.parse_string(Almanack.calendar.ical_feed) }
|
6
|
-
let(:parsed_cal) { parsed_feed.first }
|
7
|
-
let(:parsed_events) { parsed_cal.events }
|
8
|
-
|
9
|
-
before do
|
10
|
-
Timecop.freeze(now)
|
11
|
-
|
12
|
-
Almanack.reset!
|
13
|
-
|
14
|
-
Almanack.config.add_events [
|
15
|
-
{ title: "Basic", start_time: now },
|
16
|
-
{ title: "Almost a year away", start_time: now + 364 * 24 * 60 * 60 },
|
17
|
-
{ title: "Over a year away", start_time: now + 366 * 24 * 60 * 60 },
|
18
|
-
{
|
19
|
-
title: "Complex",
|
20
|
-
start_time: now,
|
21
|
-
end_time: now + 30 * 24 * 60 * 60,
|
22
|
-
description: "Body",
|
23
|
-
location: "CA"
|
24
|
-
}
|
25
|
-
]
|
26
|
-
end
|
27
|
-
|
28
|
-
after { Timecop.return }
|
29
|
-
|
30
|
-
it "should contain one calendar entity" do
|
31
|
-
expect(parsed_feed.length).to eq(1)
|
32
|
-
expect(parsed_feed.first).to be_an_instance_of(RiCal::Component::Calendar)
|
33
|
-
end
|
34
|
-
|
35
|
-
it "contains a year's worth of events" do
|
36
|
-
expect(parsed_events.length).to eq(3)
|
37
|
-
expect(parsed_events.map(&:summary)).to_not include("Over a year away")
|
38
|
-
end
|
39
|
-
|
40
|
-
it "contains all available event information" do
|
41
|
-
complex_event = parsed_events.find { |e| e.summary == 'Complex' }
|
42
|
-
expect(complex_event.dtstart).to eq_time(now)
|
43
|
-
expect(complex_event.dtend).to eq_time(now + 30 * 24 * 60 * 60)
|
44
|
-
expect(complex_event.description).to eq('Body')
|
45
|
-
expect(complex_event.location).to eq('CA')
|
46
|
-
end
|
47
|
-
|
48
|
-
it "treats missing end dates as three hours from the start date" do
|
49
|
-
three_hours_from_now = now + 3 * 60 * 60
|
50
|
-
basic_event = parsed_events.find { |e| e.summary == 'Basic' }
|
51
|
-
expect(basic_event.dtend).to eq_time(three_hours_from_now)
|
52
|
-
end
|
53
|
-
|
54
|
-
it "can be accessed from the server" do
|
55
|
-
allow(Almanack.calendar).to receive(:ical_feed) { "feed" }
|
56
|
-
get "/feed.ics"
|
57
|
-
expect(last_response.body).to eq("feed")
|
58
|
-
expect(last_response.headers["Content-Type"]).to include("text/calendar")
|
59
|
-
end
|
60
|
-
end
|