Skip to content

Commit 7ae6eaf

Browse files
committed
Add Honeybadger
Reason for Change ================= * We should monitor our website for errors and outages Changes ======= * Add honeybadger gem Minor ===== * Add amazing_print gem for debugging * Add a context block for the custom subdomain specs * Add an .irbrc https://app.asana.com/0/1202521178011206/1202602453290577/f
1 parent 72262db commit 7ae6eaf

File tree

4 files changed

+39
-29
lines changed

4 files changed

+39
-29
lines changed

.irbrc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
require "amazing_print"
2+
AmazingPrint.irb!

Gemfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ gem 'mime-types-data'
1212
gem 'mime-types'
1313
gem 'rexml'
1414
gem 'matrix'
15+
gem 'honeybadger', '~> 4.0'
1516

1617
# Required until Rails 7 - https://github.com/mikel/mail/pull/1472#issuecomment-1165161541
1718
gem 'net-smtp', require: false
@@ -82,6 +83,7 @@ group :development do
8283
end
8384

8485
group :development, :test do
86+
gem 'amazing_print', require: false
8587
gem 'capybara', '~> 3.33'
8688
gem 'database_cleaner', '~> 1.6'
8789
gem 'dotenv-rails'

Gemfile.lock

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ GEM
8686
zeitwerk (~> 2.3)
8787
addressable (2.8.0)
8888
public_suffix (>= 2.0.2, < 5.0)
89+
amazing_print (1.4.0)
8990
annotate (3.1.1)
9091
activerecord (>= 3.2, < 7.0)
9192
rake (>= 10.4, < 14.0)
@@ -240,6 +241,7 @@ GEM
240241
html2haml (>= 1.0.1)
241242
railties (>= 5.1)
242243
hashie (5.0.0)
244+
honeybadger (4.12.1)
243245
html2haml (2.2.0)
244246
erubis (~> 2.7.0)
245247
haml (>= 4.0, < 6)
@@ -528,6 +530,7 @@ PLATFORMS
528530
DEPENDENCIES
529531
actionview-encoded_mail_to
530532
active_model_serializers (~> 0.10.0)
533+
amazing_print
531534
annotate
532535
aws-sdk-s3
533536
better_errors
@@ -554,6 +557,7 @@ DEPENDENCIES
554557
guard-rspec
555558
haml (~> 5.0)
556559
haml-rails
560+
honeybadger (~> 4.0)
557561
html2haml (~> 2.2)
558562
image_processing (~> 1.2)
559563
jbuilder

spec/features/website/page_viewing_spec.rb

Lines changed: 31 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -20,43 +20,45 @@
2020
expect(page).to have_content('Home Content')
2121
end
2222

23-
scenario 'Public views the landing page from custom domain' do
24-
website.update(domains: 'www.example.com')
25-
create(:page, published_body: 'Home Content', landing: true)
26-
visit root_path
23+
context 'when using a custom domain' do
24+
scenario 'Public views the landing page from custom domain' do
25+
website.update(domains: 'www.example.com')
26+
create(:page, published_body: 'Home Content', landing: true)
27+
visit root_path
2728

28-
expect(page).to have_content('Home Content')
29-
end
29+
expect(page).to have_content('Home Content')
30+
end
3031

31-
scenario 'Public views the landing page for an older website on custom domain' do
32-
website.update(domains: 'www.example.com')
33-
old_home_page = create(:page, published_body: 'Old Website', landing: true)
34-
website.update(navigation_links: [old_home_page.slug])
32+
scenario 'Public views the landing page for an older website on custom domain' do
33+
website.update(domains: 'www.example.com')
34+
old_home_page = create(:page, published_body: 'Old Website', landing: true)
35+
website.update(navigation_links: [old_home_page.slug])
3536

36-
new_website = create(:website, domains: 'www.example.com')
37-
new_home_page = create(:page,
38-
website: new_website,
39-
published_body: 'New Website',
40-
landing: true)
37+
new_website = create(:website, domains: 'www.example.com')
38+
new_home_page = create(:page,
39+
website: new_website,
40+
published_body: 'New Website',
41+
landing: true)
4142

42-
new_website.update(navigation_links: [new_home_page.slug])
43-
visit root_path
44-
expect(page).to have_content('New Website')
43+
new_website.update(navigation_links: [new_home_page.slug])
44+
visit root_path
45+
expect(page).to have_content('New Website')
4546

46-
click_on(new_home_page.name, match: :first)
47-
expect(page).to have_content('New Website')
47+
click_on(new_home_page.name, match: :first)
48+
expect(page).to have_content('New Website')
4849

49-
visit landing_path(slug: website.event.slug)
50-
expect(page).to have_content('Old Website')
50+
visit landing_path(slug: website.event.slug)
51+
expect(page).to have_content('Old Website')
5152

52-
click_on(old_home_page.name, match: :first)
53-
expect(page).to have_content('Old Website')
54-
end
53+
click_on(old_home_page.name, match: :first)
54+
expect(page).to have_content('Old Website')
55+
end
5556

56-
scenario 'Public gets not found message for wrong path on subdomain' do
57-
website.update(domains: 'www.example.com')
57+
scenario 'Public gets not found message for wrong path on subdomain' do
58+
website.update(domains: 'www.example.com')
5859

59-
visit landing_path(slug: website.event.slug)
60-
expect(page).to have_content("Page Not Found")
60+
visit landing_path(slug: website.event.slug)
61+
expect(page).to have_content("Page Not Found")
62+
end
6163
end
6264
end

0 commit comments

Comments
 (0)