From 6903ac1418599c887b1012e314333af6d5728490 Mon Sep 17 00:00:00 2001 From: Adrian Hinz Date: Tue, 15 Mar 2022 14:24:58 +0100 Subject: [PATCH] Added email notifications for new dotations --- app/assets/javascripts/email_filter.js | 2 + app/controllers/dotations_controller.rb | 2 + app/controllers/email_filter_controller.rb | 11 ++++++ app/controllers/home_controller.rb | 14 +++++++ app/helpers/email_filter_helper.rb | 2 + app/jobs/generate_pdf_job.rb | 7 ++++ app/jobs/notify_emails_job.rb | 10 +++++ app/jobs/send_notify_email_job.rb | 18 +++++++++ app/mailers/new_dotation_mailer.rb | 26 +++++++++++++ app/models/dotation.rb | 5 +++ app/models/filter_for_email.rb | 28 ++++++++++++++ app/models/sent_email_filter.rb | 24 ++++++++++++ app/services/notify_email_service.rb | 36 ++++++++++++++++++ app/views/email_filter/unsubscribe.html.erb | 38 +++++++++++++++++++ app/views/home/_filter_form.html.erb | 30 +-------------- app/views/home/emailfilter.js.erb | 1 + app/views/home/index.html.erb | 30 ++++++++++++++- app/views/layouts/mailer.html.erb | 4 +- .../notification_email.html.erb | 34 +++++++++++++++++ .../notification_email.text.erb | 0 .../welcome_email.html.erb | 30 +++++++++++++++ .../welcome_email.text.erb | 1 + config/application.rb | 1 - config/config.yml | 1 + config/environment.rb | 2 + config/environments/development.rb | 13 ++++++- config/routes.rb | 4 +- ...20220311073147_create_filter_for_emails.rb | 11 ++++++ ...0220311073315_create_sent_email_filters.rb | 10 +++++ db/schema.rb | 26 ++++++++++--- .../email_filter_controller_test.rb | 9 +++++ test/fixtures/filter_for_emails.yml | 11 ++++++ test/fixtures/sent_email_filters.yml | 9 +++++ test/jobs/generate_pdf_job_test.rb | 7 ++++ test/jobs/send_notify_email_job_test.rb | 7 ++++ test/mailers/new_dotation_mailer_test.rb | 7 ++++ .../previews/new_dotation_mailer_preview.rb | 4 ++ test/models/filter_for_email_test.rb | 7 ++++ test/models/sent_email_filter_test.rb | 7 ++++ 39 files changed, 448 insertions(+), 41 deletions(-) create mode 100644 app/assets/javascripts/email_filter.js create mode 100644 app/controllers/email_filter_controller.rb create mode 100644 app/helpers/email_filter_helper.rb create mode 100644 app/jobs/generate_pdf_job.rb create mode 100644 app/jobs/notify_emails_job.rb create mode 100644 app/jobs/send_notify_email_job.rb create mode 100644 app/mailers/new_dotation_mailer.rb create mode 100644 app/models/filter_for_email.rb create mode 100644 app/models/sent_email_filter.rb create mode 100644 app/services/notify_email_service.rb create mode 100644 app/views/email_filter/unsubscribe.html.erb create mode 100644 app/views/home/emailfilter.js.erb create mode 100644 app/views/new_dotation_mailer/notification_email.html.erb create mode 100644 app/views/new_dotation_mailer/notification_email.text.erb create mode 100644 app/views/new_dotation_mailer/welcome_email.html.erb create mode 100644 app/views/new_dotation_mailer/welcome_email.text.erb create mode 100644 config/config.yml create mode 100644 db/migrate/20220311073147_create_filter_for_emails.rb create mode 100644 db/migrate/20220311073315_create_sent_email_filters.rb create mode 100644 test/controllers/email_filter_controller_test.rb create mode 100644 test/fixtures/filter_for_emails.yml create mode 100644 test/fixtures/sent_email_filters.yml create mode 100644 test/jobs/generate_pdf_job_test.rb create mode 100644 test/jobs/send_notify_email_job_test.rb create mode 100644 test/mailers/new_dotation_mailer_test.rb create mode 100644 test/mailers/previews/new_dotation_mailer_preview.rb create mode 100644 test/models/filter_for_email_test.rb create mode 100644 test/models/sent_email_filter_test.rb diff --git a/app/assets/javascripts/email_filter.js b/app/assets/javascripts/email_filter.js new file mode 100644 index 0000000..dee720f --- /dev/null +++ b/app/assets/javascripts/email_filter.js @@ -0,0 +1,2 @@ +// Place all the behaviors and hooks related to the matching controller here. +// All this logic will automatically be available in application.js. diff --git a/app/controllers/dotations_controller.rb b/app/controllers/dotations_controller.rb index 7be3372..417d3e9 100644 --- a/app/controllers/dotations_controller.rb +++ b/app/controllers/dotations_controller.rb @@ -37,6 +37,8 @@ class DotationsController < ApplicationController false end @dotation.save + + NotifyEmailsJob.perform_later(@dotation.id) if @dotation.active.eql?(true) end # POST /dotations or /dotations.json diff --git a/app/controllers/email_filter_controller.rb b/app/controllers/email_filter_controller.rb new file mode 100644 index 0000000..8cfdc3e --- /dev/null +++ b/app/controllers/email_filter_controller.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +# Emails +class EmailFilterController < ApplicationController + layout 'home_layout' + def unsubscribe + @email_filter = + FilterForEmail.by_email(params[:i]).by_unique(params[:k]).first + @email_filter.destroy unless @email_filter.blank? + end +end diff --git a/app/controllers/home_controller.rb b/app/controllers/home_controller.rb index 0427664..c90e58c 100644 --- a/app/controllers/home_controller.rb +++ b/app/controllers/home_controller.rb @@ -5,13 +5,17 @@ class HomeController < ApplicationController layout 'home_layout' def index + require 'json' prepare_filters + cookies[:filter] = JSON.generate(build_filter_hash) @dotations = Dotation.extra_search(params[:search]).public_dot .point_desc.end_date_asc.page(params[:page]) end def search + require 'json' prepare_filters + cookies[:filter] = JSON.generate(build_filter_hash) @dotations = Dotation.search_with_filters(build_filter_hash).public_dot .point_desc.end_date_asc.page(params[:page]) end @@ -23,6 +27,16 @@ class HomeController < ApplicationController @company_sizes = CompanySize.all end + def emailfilter + require 'json' + @emailfilter = FilterForEmail.new( + email: params[:email_filter_inp], + filters: JSON.parse(cookies[:filter]) + ) + @emailfilter.save + SendNotifyEmailJob.perform_later(@emailfilter.id, 1) + end + private def prepare_filters diff --git a/app/helpers/email_filter_helper.rb b/app/helpers/email_filter_helper.rb new file mode 100644 index 0000000..be546f8 --- /dev/null +++ b/app/helpers/email_filter_helper.rb @@ -0,0 +1,2 @@ +module EmailFilterHelper +end diff --git a/app/jobs/generate_pdf_job.rb b/app/jobs/generate_pdf_job.rb new file mode 100644 index 0000000..df66749 --- /dev/null +++ b/app/jobs/generate_pdf_job.rb @@ -0,0 +1,7 @@ +class GeneratePdfJob < ApplicationJob + queue_as :default + + def perform(*args) + # Do something later + end +end diff --git a/app/jobs/notify_emails_job.rb b/app/jobs/notify_emails_job.rb new file mode 100644 index 0000000..12d138e --- /dev/null +++ b/app/jobs/notify_emails_job.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +# Job for async email notifications +class NotifyEmailsJob < ApplicationJob + queue_as :default + + def perform(dotation_id) + NotifyEmailService.new(dotation_id).call + end +end diff --git a/app/jobs/send_notify_email_job.rb b/app/jobs/send_notify_email_job.rb new file mode 100644 index 0000000..6256857 --- /dev/null +++ b/app/jobs/send_notify_email_job.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +class SendNotifyEmailJob < ApplicationJob + queue_as :default + + def perform(email_id, mail_type) + email_filter = FilterForEmail.where(id: email_id).first + return unless email_filter + + if mail_type == 1 + NewDotationMailer.with(email_filter: email_filter.id).welcome_email + .deliver + elsif mail_type == 2 + NewDotationMailer.with(email_filter: email_filter.id).notification_email + .deliver + end + end +end diff --git a/app/mailers/new_dotation_mailer.rb b/app/mailers/new_dotation_mailer.rb new file mode 100644 index 0000000..b30106a --- /dev/null +++ b/app/mailers/new_dotation_mailer.rb @@ -0,0 +1,26 @@ +# frozen_string_literal: true + +# Mailer for dotations +class NewDotationMailer < ApplicationMailer + default from: 'kalendarzdotacji@gmail.com' + + def welcome_email + @email_filter = FilterForEmail.where(id: params[:email_filter]).first + @email_params = { + i: @email_filter.email, + k: @email_filter.unique_name + } + # @emailfilter = FilterForEmail.find(params[:emailfilter]) + mail(to: @email_filter.email, subject: 'Dodano subskrypcję dla nowych dotacji') + end + + def notification_email + @email_filter = FilterForEmail.where(id: params[:email_filter]).first + @dotation = Dotation.where(id: params[:dotation_id]).first + @email_params = { + i: @email_filter.email, + k: @email_filter.unique_name + } + mail(to: @email_filter.email, subject: 'Pojawiła się nowa dotacja') + end +end diff --git a/app/models/dotation.rb b/app/models/dotation.rb index 597c6da..3a5b5d4 100644 --- a/app/models/dotation.rb +++ b/app/models/dotation.rb @@ -64,6 +64,7 @@ class Dotation < ApplicationRecord scope :point_desc, -> { order(points: :desc) } scope :end_date_asc, -> { order(end_date: :asc) } scope :public_dot, -> { where(active: true) } + scope :by_id, ->(val) { where(id: val) } # == Callbacks ============================================================ # == Class Methods ======================================================== @@ -90,4 +91,8 @@ class Dotation < ApplicationRecord ret end # == Instance Methods ===================================================== + + def safe_id + id + end end diff --git a/app/models/filter_for_email.rb b/app/models/filter_for_email.rb new file mode 100644 index 0000000..7c529e4 --- /dev/null +++ b/app/models/filter_for_email.rb @@ -0,0 +1,28 @@ +# frozen_string_literal: true + +# Emails with filters for customers +class FilterForEmail < ApplicationRecord + # == Constants ============================================================ + + # == Attributes =========================================================== + serialize :filters, Hash + # == Extensions =========================================================== + + # == Relationships ======================================================== + has_many :sent_email_filters, dependent: :destroy + # == Validations ========================================================== + + # == Scopes =============================================================== + scope :by_email, ->(val) { where(email: val) } + scope :by_unique, ->(val) { where(unique_name: val) } + # == Callbacks ============================================================ + after_create :a_create + # == Class Methods ======================================================== + + # == Instance Methods ===================================================== + def a_create + o = [('a'..'z'), ('A'..'Z')].map(&:to_a).flatten + self.unique_name = (0...50).map { o[rand(o.length)] }.join + save + end +end diff --git a/app/models/sent_email_filter.rb b/app/models/sent_email_filter.rb new file mode 100644 index 0000000..253564d --- /dev/null +++ b/app/models/sent_email_filter.rb @@ -0,0 +1,24 @@ +# frozen_string_literal: true + +# sent emails +class SentEmailFilter < ApplicationRecord + # == Constants ============================================================ + + # == Attributes =========================================================== + + # == Extensions =========================================================== + + # == Relationships ======================================================== + belongs_to :dotation + belongs_to :filter_for_email + # == Validations ========================================================== + + # == Scopes =============================================================== + scope :by_dotation, ->(val) { where(dotation_id: val) } + scope :by_filter, ->(val) { where(filter_for_email_id: val) } + # == Callbacks ===================== ======================================= + + # == Class Methods ======================================================== + + # == Instance Methods ===================================================== +end diff --git a/app/services/notify_email_service.rb b/app/services/notify_email_service.rb new file mode 100644 index 0000000..a636385 --- /dev/null +++ b/app/services/notify_email_service.rb @@ -0,0 +1,36 @@ +# frozen_string_literal: true + +# Popup service +class NotifyEmailService + + def initialize(dotation_id) + @dotation_id = dotation_id + end + + def call + check_filters + end + + private + + def check_filters + filter_for_emails = FilterForEmail.all + filter_for_emails.each do |filter_for_email| + hsh = filter_for_email.filters.transform_keys(&:to_sym) + dot = Dotation.search_with_filters(hsh) + .by_id(@dotation_id).public_dot.first + next if dot.blank? + + sef = + SentEmailFilter.by_dotation(dot.id).by_filter(filter_for_email.id).first + + next unless sef.blank? + + SentEmailFilter.create(filter_for_email_id: filter_for_email.id, + dotation_id: dot.id) + NewDotationMailer.with(dotation_id: dot.id, + email_filter: filter_for_email.id) + .notification_email.deliver + end + end +end diff --git a/app/views/email_filter/unsubscribe.html.erb b/app/views/email_filter/unsubscribe.html.erb new file mode 100644 index 0000000..523422b --- /dev/null +++ b/app/views/email_filter/unsubscribe.html.erb @@ -0,0 +1,38 @@ +
+
+
+
+
+
+

Rezygnacja z subskrypcji

+
+
+
+
+
+
+ +
+
+
+
+
+
+
+

Subskrybcje

+
+
+
+
+
+
Informacja
+ Subskrybcja została usunięta +
+
+
+ +
+
+
+
+
diff --git a/app/views/home/_filter_form.html.erb b/app/views/home/_filter_form.html.erb index b837319..61b31c1 100644 --- a/app/views/home/_filter_form.html.erb +++ b/app/views/home/_filter_form.html.erb @@ -42,7 +42,7 @@

- Dominująca działalność firmy + Działalność firmy

@@ -133,36 +133,10 @@
- <% end %> diff --git a/app/views/home/emailfilter.js.erb b/app/views/home/emailfilter.js.erb new file mode 100644 index 0000000..9391d26 --- /dev/null +++ b/app/views/home/emailfilter.js.erb @@ -0,0 +1 @@ +$("#modal-lg").modal('hide'); diff --git a/app/views/home/index.html.erb b/app/views/home/index.html.erb index ba482ba..75f2cef 100644 --- a/app/views/home/index.html.erb +++ b/app/views/home/index.html.erb @@ -13,7 +13,6 @@
-
@@ -33,3 +32,32 @@
+ diff --git a/app/views/layouts/mailer.html.erb b/app/views/layouts/mailer.html.erb index cbd34d2..caaac55 100644 --- a/app/views/layouts/mailer.html.erb +++ b/app/views/layouts/mailer.html.erb @@ -2,9 +2,7 @@ - + diff --git a/app/views/new_dotation_mailer/notification_email.html.erb b/app/views/new_dotation_mailer/notification_email.html.erb new file mode 100644 index 0000000..ea16e7e --- /dev/null +++ b/app/views/new_dotation_mailer/notification_email.html.erb @@ -0,0 +1,34 @@ + + + + + + + + + + + + + + + + + + +
 
+ Witaj, <%= @email_filter.email %>
+ Pojawiła się nowa dotacja, która spełnia warunki Twojego wyszukiwania.
+ Aby zobaczyć tą dotację kliknij <%= link_to 'pokaż dotację', "#{APP_CONFIG['mail_link']}/dotacja/#{@dotation.safe_id}" %> +
 
Jeśli to nie Ty poprosiłeś o dodanie Ciebie do listy, możesz usunąć tą prośbę klikając w link <%= link_to 'Zrezygnuj', "#{APP_CONFIG['mail_link']}/zrezygnuj?#{@email_params.to_query}" %> +
 
+ + + + + + + + + +
 
UWAGA! Prosimy nie odpowiadać na tą wiadomość, została ona automatycznie wygenerowana przez system
diff --git a/app/views/new_dotation_mailer/notification_email.text.erb b/app/views/new_dotation_mailer/notification_email.text.erb new file mode 100644 index 0000000..e69de29 diff --git a/app/views/new_dotation_mailer/welcome_email.html.erb b/app/views/new_dotation_mailer/welcome_email.html.erb new file mode 100644 index 0000000..e2eb838 --- /dev/null +++ b/app/views/new_dotation_mailer/welcome_email.html.erb @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + + + + +
 
Witaj, <%= @email_filter.email %>
przyjęliśmy Twoją prośbę o informowanie Ciebie gdy pojawią się nowe dotacje.
 
Jeśli to nie Ty poprosiłeś o dodanie Ciebie do listy, możesz usunąć tą prośbę klikając w link <%= link_to 'Zrezygnuj', "#{APP_CONFIG['mail_link']}/zrezygnuj?#{@email_params.to_query}" %> +
 
+ + + + + + + + + +
 
UWAGA! Prosimy nie odpowiadać na tą wiadomość, została ona automatycznie wygenerowana przez system
diff --git a/app/views/new_dotation_mailer/welcome_email.text.erb b/app/views/new_dotation_mailer/welcome_email.text.erb new file mode 100644 index 0000000..16a8ff1 --- /dev/null +++ b/app/views/new_dotation_mailer/welcome_email.text.erb @@ -0,0 +1 @@ +Witaj diff --git a/config/application.rb b/config/application.rb index 3c4867f..f38a5a3 100644 --- a/config/application.rb +++ b/config/application.rb @@ -1,7 +1,6 @@ require_relative 'boot' require 'rails/all' - # Require the gems listed in Gemfile, including any gems # you've limited to :test, :development, or :production. Bundler.require(*Rails.groups) diff --git a/config/config.yml b/config/config.yml new file mode 100644 index 0000000..9dd4fdc --- /dev/null +++ b/config/config.yml @@ -0,0 +1 @@ +mail_link: 'http://localhost:3434' diff --git a/config/environment.rb b/config/environment.rb index 426333b..0c2d369 100644 --- a/config/environment.rb +++ b/config/environment.rb @@ -3,3 +3,5 @@ require_relative 'application' # Initialize the Rails application. Rails.application.initialize! + +APP_CONFIG = YAML.load_file("#{Rails.root}/config/config.yml").freeze diff --git a/config/environments/development.rb b/config/environments/development.rb index 0cedac7..0269dc7 100644 --- a/config/environments/development.rb +++ b/config/environments/development.rb @@ -34,8 +34,17 @@ Rails.application.configure do config.action_mailer.raise_delivery_errors = false config.action_mailer.perform_caching = false - config.action_mailer.default_url_options = { host: 'localhost', port: 3000 } - + config.action_mailer.default_url_options = { host: 'localhost', port: 3434 } + config.action_mailer.delivery_method = :smtp + config.action_mailer.smtp_settings = { + address: 'smtp.gmail.com', + port: 587, + domain: 'kalendarzdotacji.pl', + user_name: 'kalendarzdotacji@gmail.com', + password: '498FAvFd4YBapu5', + authentication: 'plain', + enable_starttls_auto: true + } # Print deprecation notices to the Rails logger. config.active_support.deprecation = :log diff --git a/config/routes.rb b/config/routes.rb index 25367ee..0956738 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -1,9 +1,11 @@ Rails.application.routes.draw do - + get 'zrezygnuj' => 'email_filter#unsubscribe' + get 'email_filter/unsubscribe' get 'kontakt' => 'home#contact' get 'dotacja/:id' => 'home#show' get 'home/search' post 'home/search' + post 'home/emailfilter' resources :home, only: %i[index show] devise_for :users resources :company_sizes diff --git a/db/migrate/20220311073147_create_filter_for_emails.rb b/db/migrate/20220311073147_create_filter_for_emails.rb new file mode 100644 index 0000000..4ca713d --- /dev/null +++ b/db/migrate/20220311073147_create_filter_for_emails.rb @@ -0,0 +1,11 @@ +class CreateFilterForEmails < ActiveRecord::Migration[5.2] + def change + create_table :filter_for_emails do |t| + t.string :email + t.string :unique_name + t.text :filters + + t.timestamps + end + end +end diff --git a/db/migrate/20220311073315_create_sent_email_filters.rb b/db/migrate/20220311073315_create_sent_email_filters.rb new file mode 100644 index 0000000..9e4f03a --- /dev/null +++ b/db/migrate/20220311073315_create_sent_email_filters.rb @@ -0,0 +1,10 @@ +class CreateSentEmailFilters < ActiveRecord::Migration[5.2] + def change + create_table :sent_email_filters do |t| + t.bigint :filter_for_email_id + t.bigint :dotation_id + + t.timestamps + end + end +end diff --git a/db/schema.rb b/db/schema.rb index bd57015..c68a60c 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -10,7 +10,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 2022_02_24_074408) do +ActiveRecord::Schema.define(version: 2022_03_11_073315) do create_table "active_storage_attachments", options: "ENGINE=InnoDB DEFAULT CHARSET=utf8", force: :cascade do |t| t.string "name", null: false @@ -75,8 +75,10 @@ ActiveRecord::Schema.define(version: 2022_02_24_074408) do t.string "formal_name" t.date "date_from" t.date "date_to" - t.integer "min_amount" - t.integer "max_amount" + t.bigint "min_amount" + t.integer "min_amount_curr_id", default: 1, null: false + t.bigint "max_amount" + t.integer "max_amount_curr_id", default: 1, null: false t.integer "max_percent" t.text "localization" t.integer "company_size_id" @@ -88,7 +90,7 @@ ActiveRecord::Schema.define(version: 2022_02_24_074408) do t.datetime "announcement_date" t.text "full_descr", limit: 4294967295 t.text "positioning_text", limit: 4294967295 - t.integer "points" + t.integer "points", default: 1 t.datetime "date_of_recruitment" t.boolean "arch", default: false t.boolean "active", default: false @@ -144,9 +146,16 @@ ActiveRecord::Schema.define(version: 2022_02_24_074408) do t.datetime "updated_at", null: false end + create_table "filter_for_emails", options: "ENGINE=InnoDB DEFAULT CHARSET=utf8", force: :cascade do |t| + t.string "email" + t.text "filters" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + end + create_table "partners", options: "ENGINE=InnoDB DEFAULT CHARSET=utf8", force: :cascade do |t| t.string "name" - t.string "description" + t.text "description" t.string "link_url" t.integer "created_by" t.integer "updated_by" @@ -176,6 +185,13 @@ ActiveRecord::Schema.define(version: 2022_02_24_074408) do t.index ["user_id", "role_id"], name: "index_roles_users_on_user_id_and_role_id" end + create_table "sent_email_filters", options: "ENGINE=InnoDB DEFAULT CHARSET=utf8", force: :cascade do |t| + t.bigint "filter_for_email_id" + t.bigint "dotation_id" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + end + create_table "tags", options: "ENGINE=InnoDB DEFAULT CHARSET=utf8", force: :cascade do |t| t.string "name" t.string "description" diff --git a/test/controllers/email_filter_controller_test.rb b/test/controllers/email_filter_controller_test.rb new file mode 100644 index 0000000..c5650c6 --- /dev/null +++ b/test/controllers/email_filter_controller_test.rb @@ -0,0 +1,9 @@ +require 'test_helper' + +class EmailFilterControllerTest < ActionDispatch::IntegrationTest + test "should get unsubscribe" do + get email_filter_unsubscribe_url + assert_response :success + end + +end diff --git a/test/fixtures/filter_for_emails.yml b/test/fixtures/filter_for_emails.yml new file mode 100644 index 0000000..de3f4ae --- /dev/null +++ b/test/fixtures/filter_for_emails.yml @@ -0,0 +1,11 @@ +# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html + +one: + email: MyString + filters: MyText + sended_emails: 1 + +two: + email: MyString + filters: MyText + sended_emails: 1 diff --git a/test/fixtures/sent_email_filters.yml b/test/fixtures/sent_email_filters.yml new file mode 100644 index 0000000..b006aa9 --- /dev/null +++ b/test/fixtures/sent_email_filters.yml @@ -0,0 +1,9 @@ +# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html + +one: + filter_for_email_id: + dotation_id: + +two: + filter_for_email_id: + dotation_id: diff --git a/test/jobs/generate_pdf_job_test.rb b/test/jobs/generate_pdf_job_test.rb new file mode 100644 index 0000000..679a3c3 --- /dev/null +++ b/test/jobs/generate_pdf_job_test.rb @@ -0,0 +1,7 @@ +require 'test_helper' + +class GeneratePdfJobTest < ActiveJob::TestCase + # test "the truth" do + # assert true + # end +end diff --git a/test/jobs/send_notify_email_job_test.rb b/test/jobs/send_notify_email_job_test.rb new file mode 100644 index 0000000..8c67d59 --- /dev/null +++ b/test/jobs/send_notify_email_job_test.rb @@ -0,0 +1,7 @@ +require 'test_helper' + +class SendNotifyEmailJobTest < ActiveJob::TestCase + # test "the truth" do + # assert true + # end +end diff --git a/test/mailers/new_dotation_mailer_test.rb b/test/mailers/new_dotation_mailer_test.rb new file mode 100644 index 0000000..f986de8 --- /dev/null +++ b/test/mailers/new_dotation_mailer_test.rb @@ -0,0 +1,7 @@ +require 'test_helper' + +class NewDotationMailerTest < ActionMailer::TestCase + # test "the truth" do + # assert true + # end +end diff --git a/test/mailers/previews/new_dotation_mailer_preview.rb b/test/mailers/previews/new_dotation_mailer_preview.rb new file mode 100644 index 0000000..7240fa3 --- /dev/null +++ b/test/mailers/previews/new_dotation_mailer_preview.rb @@ -0,0 +1,4 @@ +# Preview all emails at http://localhost:3000/rails/mailers/new_dotation_mailer +class NewDotationMailerPreview < ActionMailer::Preview + +end diff --git a/test/models/filter_for_email_test.rb b/test/models/filter_for_email_test.rb new file mode 100644 index 0000000..6104e5d --- /dev/null +++ b/test/models/filter_for_email_test.rb @@ -0,0 +1,7 @@ +require 'test_helper' + +class FilterForEmailTest < ActiveSupport::TestCase + # test "the truth" do + # assert true + # end +end diff --git a/test/models/sent_email_filter_test.rb b/test/models/sent_email_filter_test.rb new file mode 100644 index 0000000..79594ee --- /dev/null +++ b/test/models/sent_email_filter_test.rb @@ -0,0 +1,7 @@ +require 'test_helper' + +class SentEmailFilterTest < ActiveSupport::TestCase + # test "the truth" do + # assert true + # end +end