From 59e43ca09ae58b636d85cb42e0e921b96e8213d1 Mon Sep 17 00:00:00 2001 From: Arron Fletcher Date: Fri, 9 Nov 2018 15:17:49 +0000 Subject: [PATCH 01/14] added postmark gem --- Gemfile | 2 ++ Gemfile.lock | 8 ++++++++ 2 files changed, 10 insertions(+) diff --git a/Gemfile b/Gemfile index c6b62f1..6f08cac 100644 --- a/Gemfile +++ b/Gemfile @@ -9,6 +9,8 @@ gem "rails", "~> 5.2.0" gem "pg" # Use Puma as the app server gem "puma", "~> 3.11" +# Use Postmark for delivering SMTP emails +gem 'postmark-rails' # Use SCSS for stylesheets gem "sass-rails", "~> 5.0" diff --git a/Gemfile.lock b/Gemfile.lock index dfb4373..56b2dc4 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -108,6 +108,7 @@ GEM jbuilder (2.7.0) activesupport (>= 4.2.0) multi_json (>= 1.2) + json (2.1.0) launchy (2.4.3) addressable (~> 2.3) libv8 (6.7.288.46.1) @@ -136,6 +137,12 @@ GEM mini_portile2 (~> 2.3.0) pg (1.0.0) popper_js (1.14.3) + postmark (1.14.0) + json + rake + postmark-rails (0.18.0) + actionmailer (>= 3.0.0) + postmark (~> 1.14.0) pry (0.11.3) coderay (~> 1.1.0) method_source (~> 0.9.0) @@ -265,6 +272,7 @@ DEPENDENCIES listen (>= 3.0.5, < 3.2) mini_racer pg + postmark-rails pry-rails puma (~> 3.11) rails (~> 5.2.0) From dd79dc5d26beb3c372f123881ca4f558ce93a264 Mon Sep 17 00:00:00 2001 From: Arron Fletcher Date: Fri, 9 Nov 2018 15:53:27 +0000 Subject: [PATCH 02/14] added postmark config to application.rb --- config/application.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/config/application.rb b/config/application.rb index fe89050..0ab466d 100644 --- a/config/application.rb +++ b/config/application.rb @@ -17,5 +17,7 @@ class Application < Rails::Application # the framework and any gems in your application. config.action_mailer.default_url_options = { host: "localhost:4000" } config.action_mailer.asset_host = "http://localhost:4000" + config.action_mailer.delivery_method = :postmark + config.action_mailer.postmark_settings = { :api_token => "POSTMARK-SERVER-API-TOKEN-HERE" } end end From 636e06672b7fbb75550f606ff2e235f1ab4a564c Mon Sep 17 00:00:00 2001 From: Arron Fletcher Date: Fri, 23 Nov 2018 11:08:25 +0000 Subject: [PATCH 03/14] updated notification mailer and spec --- .DS_Store | Bin 0 -> 8196 bytes app/.DS_Store | Bin 6148 -> 6148 bytes app/assets/.DS_Store | Bin 6148 -> 6148 bytes app/mailers/notification_mailer.rb | 8 ++++++-- spec/mailers/notification_mailer_spec.rb | 4 ++-- 5 files changed, 8 insertions(+), 4 deletions(-) create mode 100644 .DS_Store diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..54d9e7259755835feb85e00fe6c75269791f54d6 GIT binary patch literal 8196 zcmeI1-)a*<6vodavE9@bqloS0-Uwc_lBg7l2r;&lf`XW;h)Uf});4yt8}g@7V7Hw_0{)aX!Z;0aSDMng4oAQda0DCyN5By{9|Z8u=Hi|5-dCfpb_5)O|B?Vd zAADSFtJ+SKm5&ZoG6jGwpj#HS<(Ge0pF3cy+D?>34~kH(u*y~F6hr9TK`3{OSG9hk zta2wISH?VgWuY?^p;HgxOF4T1CAie7QAv@#mqsjRR1mD{(* ztNv)Cys_%9SIXmY(ObS=xwrGC{o&*2)A;i@wQr%H9dt?EpVZ&c(%U<#cau0x_R+)Y zJcZPv#6t4}BUv> zicEDbu+)pD8d1cEzd?tlAMp|RY8-(WJG5dUreUknnH;jJMes_ovxxQ(H@60eBBGud zgJ2q2zsoqP0mq7ZANsZ9*s+Uu)Z@>=nt@qmXIQjmIK@v=%lch`UsrNcad)xW8lq0X zq)!#B-=?OyHWL(HhTt6L7~o7X$A+Z^M?>q;6YTL2d*pL9^{Mj7GW130x9C1?(j(Xz z(J)KHqktWBFuxUv05Lp zb!Sk?XpjGf-TNP>+7(CO3@8Z xwS8P~aB*SXL|N&AN~YtmG98CK`G+CeKBVkZ)pnvRdQjXC0TP3&9D#pI;4dXMQh@*f literal 0 HcmV?d00001 diff --git a/app/.DS_Store b/app/.DS_Store index 24ba02c77b01b7fa4affc7984066895626d75bdd..86bde5f5503995e6cbf7ea8653fd48054fe8b4ae 100644 GIT binary patch delta 71 zcmZoMXffCj%))qbatKRM8XF_ge bRdr2m-OS1VS>zdKZI)+!!L*r`<3B$D`@$AV delta 73 zcmZoMXffCj%))qjatKR+N!m$$weo8Ru-4WqrZ4nVsV=KL8-?7Q6re diff --git a/app/assets/.DS_Store b/app/assets/.DS_Store index 33e632c256c745b2913f57097cb1f046fbe65990..bf09025bbbfb2f38cb650ef48480da3d7968a495 100644 GIT binary patch delta 33 ocmZoMXffFEpGCyP&`d|c(AcO}N1@u%z*0xS%+O%7FzZJl0H-7gL;wH) delta 33 ocmZoMXffFEpGCyfQb)ni*vzn2N1@u>+(1Xc#Mo@JFzZJl0H?eOP5=M^ diff --git a/app/mailers/notification_mailer.rb b/app/mailers/notification_mailer.rb index 3d59108..94b3274 100644 --- a/app/mailers/notification_mailer.rb +++ b/app/mailers/notification_mailer.rb @@ -1,11 +1,15 @@ class NotificationMailer < ApplicationMailer - default from: "notifications@example.com" def notification_email(article) @article = article notifications = Notification.all notifications.each do |notification| - mail(to: notification.email, subject: "New blog post!!!") + mail( + to: notification.email, + subject: "Arrons blog has been updated!", + from: "arron.fletcher@shiftcommerce.com", + track_opens: "true" + ) end end end diff --git a/spec/mailers/notification_mailer_spec.rb b/spec/mailers/notification_mailer_spec.rb index f2e0250..87dc1a9 100644 --- a/spec/mailers/notification_mailer_spec.rb +++ b/spec/mailers/notification_mailer_spec.rb @@ -7,9 +7,9 @@ let(:mail) { NotificationMailer.notification_email(article) } it "renders the headers" do - expect(mail.subject).to eq("New blog post!!!") + expect(mail.subject).to eq("Arrons blog has been updated!") expect(mail.to).to eq([notification.email]) - expect(mail.from).to eq(["notifications@example.com"]) + expect(mail.from).to eq(["arron.fletcher@shiftcommerce.com"]) end it "renders the body" do From 3be7ecaf361e12494729bf455d8879e6c95bc702 Mon Sep 17 00:00:00 2001 From: Arron Fletcher Date: Fri, 23 Nov 2018 11:27:43 +0000 Subject: [PATCH 04/14] updated smtp settings and .env --- .env | 4 +++- config/application.rb | 17 +++++++++++++---- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/.env b/.env index 70fc800..1fa63eb 100644 --- a/.env +++ b/.env @@ -1,2 +1,4 @@ ADMIN_NAME=admin -ADMIN_PASSWORD=password \ No newline at end of file +ADMIN_PASSWORD=password +SMTP_NAME=b0b1194d-c30f-45b1-9713-f19be59d9e9e +SMTP_PASSWORD=b0b1194d-c30f-45b1-9713-f19be59d9e9e \ No newline at end of file diff --git a/config/application.rb b/config/application.rb index 0ab466d..6e0faeb 100644 --- a/config/application.rb +++ b/config/application.rb @@ -15,9 +15,18 @@ class Application < Rails::Application # Application configuration can go into files in config/initializers # -- all .rb files in that directory are automatically loaded after loading # the framework and any gems in your application. - config.action_mailer.default_url_options = { host: "localhost:4000" } - config.action_mailer.asset_host = "http://localhost:4000" - config.action_mailer.delivery_method = :postmark - config.action_mailer.postmark_settings = { :api_token => "POSTMARK-SERVER-API-TOKEN-HERE" } + + # Not sure if I need this line as method already set in config/environments/development.rb + config.action_mailer.delivery_method = :smtp + + # implemented settings based on https://postmarkapp.com/developer/user-guide/sending-email/sending-with-smtp + config.action_mailer.postmark_settings = { + address: "smtp.postmarkapp.com", + port: 25, + user_name: ENV.fetch("SMTP_USERNAME"), + password: ENV.fetch("SMTP_PASSWORD"), + authentication: "plain", + enable_starttls_auto: true + } end end From 2fa3c4eaff2ebc418c2a5e936c6a63c5e01c4e01 Mon Sep 17 00:00:00 2001 From: Arron Fletcher Date: Fri, 23 Nov 2018 11:37:47 +0000 Subject: [PATCH 05/14] reimplemented config.action_mailer.asset_host as specs failing without --- config/application.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/config/application.rb b/config/application.rb index 6e0faeb..5bf7f9b 100644 --- a/config/application.rb +++ b/config/application.rb @@ -15,7 +15,9 @@ class Application < Rails::Application # Application configuration can go into files in config/initializers # -- all .rb files in that directory are automatically loaded after loading # the framework and any gems in your application. - + config.action_mailer.default_url_options = { host: "localhost:4000" } + config.action_mailer.asset_host = "http://localhost:4000" + # Not sure if I need this line as method already set in config/environments/development.rb config.action_mailer.delivery_method = :smtp @@ -23,7 +25,7 @@ class Application < Rails::Application config.action_mailer.postmark_settings = { address: "smtp.postmarkapp.com", port: 25, - user_name: ENV.fetch("SMTP_USERNAME"), + user_name: ENV.fetch("SMTP_NAME"), password: ENV.fetch("SMTP_PASSWORD"), authentication: "plain", enable_starttls_auto: true From c18ab4fad02e10314303165dd095a8e6351b7ad1 Mon Sep 17 00:00:00 2001 From: Arron Fletcher Date: Fri, 23 Nov 2018 11:46:00 +0000 Subject: [PATCH 06/14] added MAILER_HOST to .env --- .env | 1 + config/application.rb | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.env b/.env index 1fa63eb..3cb1715 100644 --- a/.env +++ b/.env @@ -1,4 +1,5 @@ ADMIN_NAME=admin ADMIN_PASSWORD=password +MAILER_HOST=http://localhost:4000 SMTP_NAME=b0b1194d-c30f-45b1-9713-f19be59d9e9e SMTP_PASSWORD=b0b1194d-c30f-45b1-9713-f19be59d9e9e \ No newline at end of file diff --git a/config/application.rb b/config/application.rb index 5bf7f9b..606a80c 100644 --- a/config/application.rb +++ b/config/application.rb @@ -15,9 +15,9 @@ class Application < Rails::Application # Application configuration can go into files in config/initializers # -- all .rb files in that directory are automatically loaded after loading # the framework and any gems in your application. - config.action_mailer.default_url_options = { host: "localhost:4000" } - config.action_mailer.asset_host = "http://localhost:4000" - + config.action_mailer.default_url_options = { host: ENV.fetch("MAILER_HOST") } + config.action_mailer.asset_host = ENV.fetch("MAILER_HOST") + # Not sure if I need this line as method already set in config/environments/development.rb config.action_mailer.delivery_method = :smtp From f053763e069b8ddba7fd82d5f130fd4c3bae738a Mon Sep 17 00:00:00 2001 From: Arron Fletcher Date: Fri, 30 Nov 2018 12:30:03 +0000 Subject: [PATCH 07/14] fixed smtp settings --- config/application.rb | 2 +- config/environments/development.rb | 9 +++++++++ config/environments/production.rb | 9 +++++++++ 3 files changed, 19 insertions(+), 1 deletion(-) diff --git a/config/application.rb b/config/application.rb index 606a80c..cfdfc50 100644 --- a/config/application.rb +++ b/config/application.rb @@ -22,7 +22,7 @@ class Application < Rails::Application config.action_mailer.delivery_method = :smtp # implemented settings based on https://postmarkapp.com/developer/user-guide/sending-email/sending-with-smtp - config.action_mailer.postmark_settings = { + config.action_mailer.smtp_settings = { address: "smtp.postmarkapp.com", port: 25, user_name: ENV.fetch("SMTP_NAME"), diff --git a/config/environments/development.rb b/config/environments/development.rb index 31f7724..f87e8d0 100644 --- a/config/environments/development.rb +++ b/config/environments/development.rb @@ -60,4 +60,13 @@ config.file_watcher = ActiveSupport::EventedFileUpdateChecker config.action_mailer.delivery_method = :smtp + + config.action_mailer.smtp_settings = { + address: "smtp.postmarkapp.com", + port: 25, + user_name: ENV.fetch("SMTP_NAME"), + password: ENV.fetch("SMTP_PASSWORD"), + authentication: "plain", + enable_starttls_auto: true + } end diff --git a/config/environments/production.rb b/config/environments/production.rb index b169aab..8aae300 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -91,4 +91,13 @@ # Do not dump schema after migrations. config.active_record.dump_schema_after_migration = false + + config.action_mailer.smtp_settings = { + address: "smtp.postmarkapp.com", + port: 25, + user_name: ENV.fetch("SMTP_NAME"), + password: ENV.fetch("SMTP_PASSWORD"), + authentication: "plain", + enable_starttls_auto: true + } end From cb5eb7aa8ca541f961c0b204cf80b740b35ac17c Mon Sep 17 00:00:00 2001 From: Arron Fletcher Date: Fri, 30 Nov 2018 16:10:05 +0000 Subject: [PATCH 08/14] added .env to .gitignore, removed postmark gem, copied smtp settings to development & prod. Added unit test --- .gitignore | 5 ++++- Gemfile | 2 -- app/mailers/notification_mailer.rb | 1 - config/environments/development.rb | 7 ++++++- config/environments/production.rb | 7 +++++++ spec/unit/models/articles_spec.rb | 9 ++++++++- 6 files changed, 25 insertions(+), 6 deletions(-) diff --git a/.gitignore b/.gitignore index d1fe9dd..21473eb 100644 --- a/.gitignore +++ b/.gitignore @@ -33,4 +33,7 @@ procoders-unit1.md # Ignore Ruby Style Guide - STYLEGUIDE.md +STYLEGUIDE.md + +# Ignore .env +.env diff --git a/Gemfile b/Gemfile index 6f08cac..c6b62f1 100644 --- a/Gemfile +++ b/Gemfile @@ -9,8 +9,6 @@ gem "rails", "~> 5.2.0" gem "pg" # Use Puma as the app server gem "puma", "~> 3.11" -# Use Postmark for delivering SMTP emails -gem 'postmark-rails' # Use SCSS for stylesheets gem "sass-rails", "~> 5.0" diff --git a/app/mailers/notification_mailer.rb b/app/mailers/notification_mailer.rb index 94b3274..ace5510 100644 --- a/app/mailers/notification_mailer.rb +++ b/app/mailers/notification_mailer.rb @@ -8,7 +8,6 @@ def notification_email(article) to: notification.email, subject: "Arrons blog has been updated!", from: "arron.fletcher@shiftcommerce.com", - track_opens: "true" ) end end diff --git a/config/environments/development.rb b/config/environments/development.rb index f87e8d0..fff6254 100644 --- a/config/environments/development.rb +++ b/config/environments/development.rb @@ -58,9 +58,14 @@ # Use an evented file watcher to asynchronously detect changes in source code, # routes, locales, etc. This feature depends on the listen gem. config.file_watcher = ActiveSupport::EventedFileUpdateChecker - + + config.action_mailer.default_url_options = { host: ENV.fetch("MAILER_HOST") } + config.action_mailer.asset_host = ENV.fetch("MAILER_HOST") + + # Not sure if I need this line as method already set in config/environments/development.rb config.action_mailer.delivery_method = :smtp + # implemented settings based on https://postmarkapp.com/developer/user-guide/sending-email/sending-with-smtp config.action_mailer.smtp_settings = { address: "smtp.postmarkapp.com", port: 25, diff --git a/config/environments/production.rb b/config/environments/production.rb index 8aae300..0ebb64b 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -92,6 +92,13 @@ # Do not dump schema after migrations. config.active_record.dump_schema_after_migration = false + config.action_mailer.default_url_options = { host: ENV.fetch("MAILER_HOST") } + config.action_mailer.asset_host = ENV.fetch("MAILER_HOST") + + # Not sure if I need this line as method already set in config/environments/development.rb + config.action_mailer.delivery_method = :smtp + + # implemented settings based on https://postmarkapp.com/developer/user-guide/sending-email/sending-with-smtp config.action_mailer.smtp_settings = { address: "smtp.postmarkapp.com", port: 25, diff --git a/spec/unit/models/articles_spec.rb b/spec/unit/models/articles_spec.rb index 9b4c1b3..8621e38 100644 --- a/spec/unit/models/articles_spec.rb +++ b/spec/unit/models/articles_spec.rb @@ -14,8 +14,15 @@ RSpec.describe Article, :type => :model do it "edit article" do - @article = Article.new(title: "Testing", text:"test123") + @article = Article.new(title: "Testing", text: "test123") @article.update(title: "Testing123", text: "123121231") expect(@article).to have_attributes(title: "Testing123") end +end + +RSpec.describe Article, :type => :model do + it "sends out an email when an article is created" do + @article = Article.new(title: "New Article", text: "new article") + expect(@article).to respond_to(:send_notification) + end end \ No newline at end of file From 102bc5402f965e2225894eb813846a63b5ffbcad Mon Sep 17 00:00:00 2001 From: Arron Fletcher Date: Tue, 4 Dec 2018 09:19:57 +0000 Subject: [PATCH 09/14] [WIP] adding unit spec for sending out email when article is created --- spec/unit/models/articles_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/unit/models/articles_spec.rb b/spec/unit/models/articles_spec.rb index 8621e38..be7a995 100644 --- a/spec/unit/models/articles_spec.rb +++ b/spec/unit/models/articles_spec.rb @@ -23,6 +23,6 @@ RSpec.describe Article, :type => :model do it "sends out an email when an article is created" do @article = Article.new(title: "New Article", text: "new article") - expect(@article).to respond_to(:send_notification) + expect(Article).to receive(:send_notification).with(no_args).once end end \ No newline at end of file From ad2b8a015bfb819cb46acf3ccc14d0e82580067c Mon Sep 17 00:00:00 2001 From: Arron Fletcher Date: Fri, 11 Jan 2019 09:47:28 +0000 Subject: [PATCH 10/14] fixed article_spec.rb --- spec/unit/models/articles_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/unit/models/articles_spec.rb b/spec/unit/models/articles_spec.rb index be7a995..8621e38 100644 --- a/spec/unit/models/articles_spec.rb +++ b/spec/unit/models/articles_spec.rb @@ -23,6 +23,6 @@ RSpec.describe Article, :type => :model do it "sends out an email when an article is created" do @article = Article.new(title: "New Article", text: "new article") - expect(Article).to receive(:send_notification).with(no_args).once + expect(@article).to respond_to(:send_notification) end end \ No newline at end of file From 8ede1f976fe0529a92fa9fbf6e0fadaca059c788 Mon Sep 17 00:00:00 2001 From: Arron Fletcher Date: Fri, 11 Jan 2019 11:36:26 +0000 Subject: [PATCH 11/14] updated articles_spec.rb --- Gemfile.lock | 8 ----- app/mailers/notification_mailer.rb | 4 +-- spec/unit/models/articles_spec.rb | 48 +++++++++++++++++------------- 3 files changed, 30 insertions(+), 30 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 56b2dc4..dfb4373 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -108,7 +108,6 @@ GEM jbuilder (2.7.0) activesupport (>= 4.2.0) multi_json (>= 1.2) - json (2.1.0) launchy (2.4.3) addressable (~> 2.3) libv8 (6.7.288.46.1) @@ -137,12 +136,6 @@ GEM mini_portile2 (~> 2.3.0) pg (1.0.0) popper_js (1.14.3) - postmark (1.14.0) - json - rake - postmark-rails (0.18.0) - actionmailer (>= 3.0.0) - postmark (~> 1.14.0) pry (0.11.3) coderay (~> 1.1.0) method_source (~> 0.9.0) @@ -272,7 +265,6 @@ DEPENDENCIES listen (>= 3.0.5, < 3.2) mini_racer pg - postmark-rails pry-rails puma (~> 3.11) rails (~> 5.2.0) diff --git a/app/mailers/notification_mailer.rb b/app/mailers/notification_mailer.rb index ace5510..59c9b2a 100644 --- a/app/mailers/notification_mailer.rb +++ b/app/mailers/notification_mailer.rb @@ -2,8 +2,8 @@ class NotificationMailer < ApplicationMailer def notification_email(article) @article = article - notifications = Notification.all - notifications.each do |notification| + + Notification.in_batches.each_record do |notification| mail( to: notification.email, subject: "Arrons blog has been updated!", diff --git a/spec/unit/models/articles_spec.rb b/spec/unit/models/articles_spec.rb index 8621e38..cda6264 100644 --- a/spec/unit/models/articles_spec.rb +++ b/spec/unit/models/articles_spec.rb @@ -1,28 +1,36 @@ require "rails_helper" -RSpec.describe Article, :type => :model do - it "creates new article" do - expect(Article.new(title: "Testing", text: "Test" )).to be_valid - end -end +RSpec.describe Article, type: :model do + describe "creating a new valid article" do + let(:article) { build(:article) } -RSpec.describe Article, :type => :model do - it "wont create article because of article params" do - expect(Article.new(title: "Test", text: "Test" )).not_to be_valid + it "should be valid" do + expect(article).to be_valid + end end -end -RSpec.describe Article, :type => :model do - it "edit article" do - @article = Article.new(title: "Testing", text: "test123") - @article.update(title: "Testing123", text: "123121231") - expect(@article).to have_attributes(title: "Testing123") + describe "creating an article" do + it "sends out an email when an article is created" do + create(:notification) + expect{create(:article)}.to change{ActionMailer::Base.deliveries.count}.by(1) + end end -end -RSpec.describe Article, :type => :model do - it "sends out an email when an article is created" do - @article = Article.new(title: "New Article", text: "new article") - expect(@article).to respond_to(:send_notification) + describe "creating an invalid article" do + let(:article) { build(:article, title: "Test") } + + it "should be invalid" do + expect(article).not_to be_valid + end + end + + describe "editing an article with valid data" do + let!(:article) { create(:article) } + + it "should be updated" do + article.update(title: "Testing123", text: "123121231") + + expect(article).to have_attributes(title: "Testing123") + end end -end \ No newline at end of file +end From d054598744182336faa8eca84cfa0380c1a29c89 Mon Sep 17 00:00:00 2001 From: Arron Fletcher Date: Fri, 11 Jan 2019 14:49:21 +0000 Subject: [PATCH 12/14] attempt to fix codeship --- spec/unit/models/articles_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/unit/models/articles_spec.rb b/spec/unit/models/articles_spec.rb index cda6264..ee35ec9 100644 --- a/spec/unit/models/articles_spec.rb +++ b/spec/unit/models/articles_spec.rb @@ -27,7 +27,7 @@ describe "editing an article with valid data" do let!(:article) { create(:article) } - it "should be updated" do + it "should update" do article.update(title: "Testing123", text: "123121231") expect(article).to have_attributes(title: "Testing123") From 9243ec95d4c660fae86e49814b5f268ed6d073b9 Mon Sep 17 00:00:00 2001 From: Arron Fletcher Date: Fri, 11 Jan 2019 14:57:49 +0000 Subject: [PATCH 13/14] delete .env added to .gitignore for future --- .env | 5 ----- 1 file changed, 5 deletions(-) delete mode 100644 .env diff --git a/.env b/.env deleted file mode 100644 index 3cb1715..0000000 --- a/.env +++ /dev/null @@ -1,5 +0,0 @@ -ADMIN_NAME=admin -ADMIN_PASSWORD=password -MAILER_HOST=http://localhost:4000 -SMTP_NAME=b0b1194d-c30f-45b1-9713-f19be59d9e9e -SMTP_PASSWORD=b0b1194d-c30f-45b1-9713-f19be59d9e9e \ No newline at end of file From 4d10fb145b3422360a24f6444e49808a6559a523 Mon Sep 17 00:00:00 2001 From: Arron Fletcher Date: Fri, 11 Jan 2019 15:45:38 +0000 Subject: [PATCH 14/14] removed unwanted comment from application.rb, deleted .env --- .env | 5 ----- config/application.rb | 2 -- 2 files changed, 7 deletions(-) delete mode 100644 .env diff --git a/.env b/.env deleted file mode 100644 index 3cb1715..0000000 --- a/.env +++ /dev/null @@ -1,5 +0,0 @@ -ADMIN_NAME=admin -ADMIN_PASSWORD=password -MAILER_HOST=http://localhost:4000 -SMTP_NAME=b0b1194d-c30f-45b1-9713-f19be59d9e9e -SMTP_PASSWORD=b0b1194d-c30f-45b1-9713-f19be59d9e9e \ No newline at end of file diff --git a/config/application.rb b/config/application.rb index cfdfc50..c94622d 100644 --- a/config/application.rb +++ b/config/application.rb @@ -17,8 +17,6 @@ class Application < Rails::Application # the framework and any gems in your application. config.action_mailer.default_url_options = { host: ENV.fetch("MAILER_HOST") } config.action_mailer.asset_host = ENV.fetch("MAILER_HOST") - - # Not sure if I need this line as method already set in config/environments/development.rb config.action_mailer.delivery_method = :smtp # implemented settings based on https://postmarkapp.com/developer/user-guide/sending-email/sending-with-smtp