From 514815d4d53ad8cb27251bb9a8c0294b9a27a241 Mon Sep 17 00:00:00 2001 From: omochiumaiumai Date: Tue, 30 Apr 2024 15:57:04 +0900 Subject: [PATCH] =?UTF-8?q?=E3=83=86=E3=83=BC=E3=83=96=E3=83=AB=E5=90=8D/?= =?UTF-8?q?=E3=83=A2=E3=83=87=E3=83=AB=E5=90=8D=E3=82=92=E5=A4=89=E6=9B=B4?= =?UTF-8?q?(`corporate=5Ftrainings`=E2=86=92`corporate=5Ftraining=5Finquir?= =?UTF-8?q?ies`)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...corporate_training_inquiries_controller.rb | 41 +++++++++++ .../corporate_trainings_controller.rb | 41 ----------- .../corporate_training_inquiry_mailer.rb | 8 ++ app/mailers/corporate_training_mailer.rb | 8 -- ...ining.rb => corporate_training_inquiry.rb} | 2 +- .../_form.html.slim | 6 +- .../new.html.slim | 2 +- .../incoming.html.erb | 20 ++--- config/locales/ja.yml | 2 +- config/routes.rb | 2 +- db/schema.rb | 73 +++++++++---------- ...ing.yml => corporate_training_inquiry.yml} | 4 +- ...corporate_training_inquiry_mailer_test.rb} | 6 +- ...porate_training_inquiry_mailer_preview.rb} | 8 +- .../models/corporate_training_inquiry_test.rb | 20 +++++ test/models/corporate_training_test.rb | 20 ----- ...corporate_training_inquiry_system_test.rb} | 8 +- test/system/require_login_test.rb | 4 +- 18 files changed, 135 insertions(+), 140 deletions(-) create mode 100644 app/controllers/corporate_training_inquiries_controller.rb delete mode 100644 app/controllers/corporate_trainings_controller.rb create mode 100644 app/mailers/corporate_training_inquiry_mailer.rb delete mode 100644 app/mailers/corporate_training_mailer.rb rename app/models/{corporate_training.rb => corporate_training_inquiry.rb} (96%) rename app/views/{corporate_trainings => corporate_training_inquiries}/_form.html.slim (87%) rename app/views/{corporate_trainings => corporate_training_inquiries}/new.html.slim (90%) rename app/views/{corporate_training_mailer => corporate_training_inquiry_mailer}/incoming.html.erb (61%) rename test/fixtures/{corporate_training.yml => corporate_training_inquiry.yml} (83%) rename test/mailers/{corporate_training_mailer_test.rb => corporate_training_inquiry_mailer_test.rb} (86%) rename test/mailers/previews/{corporate_training_mailer_preview.rb => corporate_training_inquiry_mailer_preview.rb} (66%) create mode 100644 test/models/corporate_training_inquiry_test.rb delete mode 100644 test/models/corporate_training_test.rb rename test/system/{corporate_training_system_test.rb => corporate_training_inquiry_system_test.rb} (87%) diff --git a/app/controllers/corporate_training_inquiries_controller.rb b/app/controllers/corporate_training_inquiries_controller.rb new file mode 100644 index 00000000000..654eb21278c --- /dev/null +++ b/app/controllers/corporate_training_inquiries_controller.rb @@ -0,0 +1,41 @@ +# frozen_string_literal: true + +class CorporateTrainingInquiriesController < ApplicationController + include Recaptchable::V3 + skip_before_action :require_active_user_login, raise: false + + def new + @corporate_training_inquiry = CorporateTrainingInquiry.new + end + + def create + @corporate_training_inquiry = CorporateTrainingInquiry.new(corporate_training_inquiry_params) + + result = valid_recaptcha?('corporate_training_inquiry') + if result && @corporate_training_inquiry.save + CorporateTrainingInquiryMailer.incoming(@corporate_training_inquiry).deliver_later + redirect_to new_corporate_training_inquiry_url, notice: 'お問い合わせを送信しました。' + else + flash.now[:alert] = 'Bot対策のため送信を拒否しました。しばらくしてからもう一度送信してください。' unless result + render :new + end + end + + private + + def corporate_training_inquiry_params + params.require(:corporate_training_inquiry).permit( + :company_name, + :name, + :email, + :meeting_date1, + :meeting_date2, + :meeting_date3, + :participants_count, + :training_duration, + :how_did_you_hear, + :additional_information, + :privacy_policy + ) + end +end diff --git a/app/controllers/corporate_trainings_controller.rb b/app/controllers/corporate_trainings_controller.rb deleted file mode 100644 index 523066d219a..00000000000 --- a/app/controllers/corporate_trainings_controller.rb +++ /dev/null @@ -1,41 +0,0 @@ -# frozen_string_literal: true - -class CorporateTrainingsController < ApplicationController - include Recaptchable::V3 - skip_before_action :require_active_user_login, raise: false - - def new - @corporate_training = CorporateTraining.new - end - - def create - @corporate_training = CorporateTraining.new(corporate_training_params) - - result = valid_recaptcha?('corporate_training') - if result && @corporate_training.save - CorporateTrainingMailer.incoming(@corporate_training).deliver_later - redirect_to new_corporate_training_url, notice: 'お問い合わせを送信しました。' - else - flash.now[:alert] = 'Bot対策のため送信を拒否しました。しばらくしてからもう一度送信してください。' unless result - render :new - end - end - - private - - def corporate_training_params - params.require(:corporate_training).permit( - :company_name, - :name, - :email, - :meeting_date1, - :meeting_date2, - :meeting_date3, - :participants_count, - :training_duration, - :how_did_you_hear, - :additional_information, - :privacy_policy - ) - end -end diff --git a/app/mailers/corporate_training_inquiry_mailer.rb b/app/mailers/corporate_training_inquiry_mailer.rb new file mode 100644 index 00000000000..bc956c00afe --- /dev/null +++ b/app/mailers/corporate_training_inquiry_mailer.rb @@ -0,0 +1,8 @@ +# frozen_string_literal: true + +class CorporateTrainingInquiryMailer < ApplicationMailer + def incoming(corporate_training_inquiry) + @corporate_training_inquiry = corporate_training_inquiry + mail to: 'info@lokka.jp', reply_to: @corporate_training_inquiry.email, subject: '[FBC] 企業研修の申し込み' + end +end diff --git a/app/mailers/corporate_training_mailer.rb b/app/mailers/corporate_training_mailer.rb deleted file mode 100644 index afbf13e19e9..00000000000 --- a/app/mailers/corporate_training_mailer.rb +++ /dev/null @@ -1,8 +0,0 @@ -# frozen_string_literal: true - -class CorporateTrainingMailer < ApplicationMailer - def incoming(corporate_training) - @corporate_training = corporate_training - mail to: 'info@lokka.jp', reply_to: @corporate_training.email, subject: '[FBC] 企業研修の申し込み' - end -end diff --git a/app/models/corporate_training.rb b/app/models/corporate_training_inquiry.rb similarity index 96% rename from app/models/corporate_training.rb rename to app/models/corporate_training_inquiry.rb index a910b07ab47..257db30a5d7 100644 --- a/app/models/corporate_training.rb +++ b/app/models/corporate_training_inquiry.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -class CorporateTraining < ApplicationRecord +class CorporateTrainingInquiry < ApplicationRecord validates :company_name, presence: true validates :name, presence: true validates :email, presence: true, diff --git a/app/views/corporate_trainings/_form.html.slim b/app/views/corporate_training_inquiries/_form.html.slim similarity index 87% rename from app/views/corporate_trainings/_form.html.slim rename to app/views/corporate_training_inquiries/_form.html.slim index aac4486b39f..9e16aacac95 100644 --- a/app/views/corporate_trainings/_form.html.slim +++ b/app/views/corporate_training_inquiries/_form.html.slim @@ -1,5 +1,5 @@ -= form_with model: corporate_training, url: corporate_training_path, method: :post, local: true do |f| - = render 'errors', object: corporate_training += form_with model: corporate_training_inquiry, url: corporate_training_inquiry_path, method: :post, local: true do |f| + = render 'errors', object: corporate_training_inquiry .form__items .form-item = f.label :name, class: 'a-form-label is-required' @@ -49,4 +49,4 @@ li.form-actions__item.is-main = f.submit '送信', class: 'a-button is-lg is-primary is-block' - = recaptcha_v3(action: 'corporate_training', callback: 'skipOnLoadReCaptcha') if recaptcha_enabled? + = recaptcha_v3(action: 'corporate_training_inquiry', callback: 'skipOnLoadReCaptcha') if recaptcha_enabled? diff --git a/app/views/corporate_trainings/new.html.slim b/app/views/corporate_training_inquiries/new.html.slim similarity index 90% rename from app/views/corporate_trainings/new.html.slim rename to app/views/corporate_training_inquiries/new.html.slim index 48ec6fedbac..ad3e7b03ac8 100644 --- a/app/views/corporate_trainings/new.html.slim +++ b/app/views/corporate_training_inquiries/new.html.slim @@ -9,7 +9,7 @@ ruby: header.auth-form__header h1.auth-form__title = title .auth-form__body - = render 'form', corporate_training: @corporate_training + = render 'form', corporate_training_inquiry: @corporate_training_inquiry footer.auth-form__footer nav.auth-form-nav ul.auth-form-nav__items diff --git a/app/views/corporate_training_mailer/incoming.html.erb b/app/views/corporate_training_inquiry_mailer/incoming.html.erb similarity index 61% rename from app/views/corporate_training_mailer/incoming.html.erb rename to app/views/corporate_training_inquiry_mailer/incoming.html.erb index ad32cf7055d..91493ae6676 100644 --- a/app/views/corporate_training_mailer/incoming.html.erb +++ b/app/views/corporate_training_inquiry_mailer/incoming.html.erb @@ -10,26 +10,26 @@

企業名:

-

<%= @corporate_training.company_name %>

+

<%= @corporate_training_inquiry.company_name %>

名前:

-

<%= @corporate_training.name %>

+

<%= @corporate_training_inquiry.name %>

Email:

-

<%= @corporate_training.email %>

+

<%= @corporate_training_inquiry.email %>

研修打ち合わせ希望日時:

第1希望

-

<%= l @corporate_training.meeting_date1, format: :default %>

+

<%= l @corporate_training_inquiry.meeting_date1, format: :default %>

第2希望

-

<%= l @corporate_training.meeting_date2, format: :default %>

+

<%= l @corporate_training_inquiry.meeting_date2, format: :default %>

第3希望

-

<%= l @corporate_training.meeting_date3, format: :default%>

+

<%= l @corporate_training_inquiry.meeting_date3, format: :default%>

研修を受ける方の人数:

-

<%= @corporate_training.participants_count %>人

+

<%= @corporate_training_inquiry.participants_count %>人

研修期間:

-

<%= @corporate_training.training_duration %>

+

<%= @corporate_training_inquiry.training_duration %>

どこでフィヨルドブートキャンプを知りましたか?:

-

<%= @corporate_training.how_did_you_hear %>

+

<%= @corporate_training_inquiry.how_did_you_hear %>

その他伝えておきたいこと:

-

<%= @corporate_training.additional_information %>

+

<%= @corporate_training_inquiry.additional_information %>

diff --git a/config/locales/ja.yml b/config/locales/ja.yml index 33aaa0cb714..d6f71a56753 100644 --- a/config/locales/ja.yml +++ b/config/locales/ja.yml @@ -185,7 +185,7 @@ ja: email: メールアドレス body: 内容 privacy_policy: 個人情報の取り扱い - corporate_training: + corporate_training_inquiry: name: 名前 company_name: 企業名 email: メールアドレス diff --git a/config/routes.rb b/config/routes.rb index 69a0a4dc3bb..8952b58eb35 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -64,7 +64,7 @@ resources :questions resources :courses, only: :index resource :inquiry, only: %i(new create) - resource :corporate_training, only: %i(new create) + resource :corporate_training_inquiry, only: %i(new create) resources :articles resources :survey_questions, except: %i(show destroy) namespace :events do diff --git a/db/schema.rb b/db/schema.rb index 301b179d231..5697f12658b 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: 2024_03_14_023555) do +ActiveRecord::Schema.define(version: 2024_03_20_081440) do # These are extensions that must be enabled in order to support this database enable_extension "pgcrypto" @@ -125,8 +125,8 @@ end create_table "categories", id: :serial, force: :cascade do |t| - t.string "name", limit: 255 - t.string "slug", limit: 255 + t.string "name" + t.string "slug" t.datetime "created_at" t.datetime "updated_at" t.text "description" @@ -180,14 +180,13 @@ t.datetime "updated_at" t.string "commentable_type", default: "Report" t.index ["commentable_id"], name: "index_comments_on_commentable_id" - t.index ["user_id"], name: "comment_user_id" t.index ["user_id"], name: "index_comments_on_user_id" end create_table "companies", id: :serial, force: :cascade do |t| - t.string "name", limit: 255 + t.string "name" t.text "description" - t.string "website", limit: 255 + t.string "website" t.datetime "created_at" t.datetime "updated_at" t.text "tos" @@ -195,16 +194,16 @@ t.text "memo" end - create_table "corporate_trainings", force: :cascade do |t| - t.string "company_name" - t.string "name" - t.string "email" - t.datetime "meeting_date1" - t.datetime "meeting_date2" - t.datetime "meeting_date3" - t.integer "participants_count" - t.string "training_duration" - t.string "how_did_you_hear" + create_table "corporate_training_inquiries", force: :cascade do |t| + t.string "company_name", null: false + t.string "name", null: false + t.string "email", null: false + t.datetime "meeting_date1", null: false + t.datetime "meeting_date2", null: false + t.datetime "meeting_date3", null: false + t.integer "participants_count", null: false + t.string "training_duration", null: false + t.string "how_did_you_hear", null: false t.text "additional_information" t.datetime "created_at", precision: 6, null: false t.datetime "updated_at", precision: 6, null: false @@ -227,9 +226,6 @@ t.index ["course_id", "category_id"], name: "index_courses_categories_on_course_id_and_category_id", unique: true end - create_table "data_migrations", primary_key: "version", id: :string, force: :cascade do |t| - end - create_table "discord_profiles", force: :cascade do |t| t.bigint "user_id" t.string "account_name" @@ -557,8 +553,8 @@ t.integer "kind", default: 0, null: false t.datetime "created_at", null: false t.datetime "updated_at", null: false - t.index ["reactionable_type", "reactionable_id"], name: "index_reactions_on_reactionable_type_and_reactionable_id" - t.index ["user_id", "reactionable_id", "reactionable_type", "kind"], name: "index_reactions_on_reactionable", unique: true + t.index ["reactionable_type", "reactionable_id"], name: "index_reactions_on_reactionable" + t.index ["user_id", "reactionable_id", "reactionable_type", "kind"], name: "index_reactions_on_reactionable_u_k", unique: true t.index ["user_id"], name: "index_reactions_on_user_id" end @@ -589,9 +585,9 @@ t.boolean "hold_national_holiday", null: false t.time "start_at", null: false t.time "end_at", null: false + t.boolean "wip", default: false, null: false t.datetime "created_at", precision: 6, null: false t.datetime "updated_at", precision: 6, null: false - t.boolean "wip", default: false, null: false t.integer "category", default: 0, null: false t.boolean "all", default: false, null: false t.datetime "published_at" @@ -619,7 +615,6 @@ t.index ["created_at"], name: "index_reports_on_created_at" t.index ["user_id", "reported_on"], name: "index_reports_on_user_id_and_reported_on", unique: true t.index ["user_id", "title"], name: "index_reports_on_user_id_and_title", unique: true - t.index ["user_id"], name: "reports_user_id" end create_table "survey_question_listings", force: :cascade do |t| @@ -688,21 +683,21 @@ end create_table "users", id: :serial, force: :cascade do |t| - t.string "login_name", limit: 255, null: false - t.string "email", limit: 255 - t.string "crypted_password", limit: 255 - t.string "salt", limit: 255 + t.string "login_name", null: false + t.string "email" + t.string "crypted_password" + t.string "salt" t.datetime "created_at" t.datetime "updated_at" - t.string "remember_me_token", limit: 255 + t.string "remember_me_token" t.datetime "remember_me_token_expires_at" - t.string "twitter_account", limit: 255 - t.string "facebook_url", limit: 255 - t.string "blog_url", limit: 255 + t.string "twitter_account" + t.string "facebook_url" + t.string "blog_url" t.integer "company_id" t.text "description" t.datetime "accessed_at" - t.string "github_account", limit: 255 + t.string "github_account" t.boolean "adviser", default: false, null: false t.boolean "nda", default: true, null: false t.string "reset_password_token" @@ -717,21 +712,21 @@ t.string "organization" t.integer "os" t.integer "experience" - t.boolean "free", default: false, null: false - t.boolean "trainee", default: false, null: false t.text "retire_reason" - t.boolean "job_seeking", default: false, null: false + t.boolean "trainee", default: false, null: false + t.boolean "free", default: false, null: false t.string "customer_id" + t.boolean "job_seeking", default: false, null: false t.string "subscription_id" t.boolean "mail_notification", default: true, null: false t.boolean "job_seeker", default: false, null: false - t.boolean "github_collaborator", default: false, null: false t.string "github_id" + t.boolean "github_collaborator", default: false, null: false + t.string "name", default: "", null: false + t.string "name_kana", default: "", null: false t.integer "satisfaction" t.text "opinion" t.bigint "retire_reasons", default: 0, null: false - t.string "name", default: "", null: false - t.string "name_kana", default: "", null: false t.string "unsubscribe_email_token" t.text "mentor_memo" t.text "after_graduation_hope" @@ -767,7 +762,7 @@ t.datetime "updated_at", null: false t.integer "user_id", null: false t.index ["watchable_type", "watchable_id", "user_id"], name: "index_watches_on_watchable_type_and_watchable_id_and_user_id", unique: true - t.index ["watchable_type", "watchable_id"], name: "index_watches_on_watchable_type_and_watchable_id" + t.index ["watchable_type", "watchable_id"], name: "index_watches_on_watchable" end create_table "works", force: :cascade do |t| diff --git a/test/fixtures/corporate_training.yml b/test/fixtures/corporate_training_inquiry.yml similarity index 83% rename from test/fixtures/corporate_training.yml rename to test/fixtures/corporate_training_inquiry.yml index 68614ca3007..5966bf9e532 100644 --- a/test/fixtures/corporate_training.yml +++ b/test/fixtures/corporate_training_inquiry.yml @@ -1,7 +1,7 @@ -corporate_training1: +corporate_training_inquiry1: company_name: '株式会社カンパニー' name: '研修 する世' - email: 'corporate_training@example.com' + email: 'corporate_training_inquiry@example.com' meeting_date1: Time.zone.parse('2030-01-01-08:00') meeting_date2: Time.zone.parse('2030-01-02-10:00') meeting_date3: Time.zone.parse('2023-01-03-12:00') diff --git a/test/mailers/corporate_training_mailer_test.rb b/test/mailers/corporate_training_inquiry_mailer_test.rb similarity index 86% rename from test/mailers/corporate_training_mailer_test.rb rename to test/mailers/corporate_training_inquiry_mailer_test.rb index 298a5b93571..0226d1bdc4f 100644 --- a/test/mailers/corporate_training_mailer_test.rb +++ b/test/mailers/corporate_training_inquiry_mailer_test.rb @@ -2,9 +2,9 @@ require 'test_helper' -class CorporateTrainingMailerTest < ActionMailer::TestCase +class CorporateTrainingInquiryMailerTest < ActionMailer::TestCase test 'incoming' do - corporate_training = CorporateTraining.new( + corporate_training_inquiry = CorporateTrainingInquiry.new( company_name: '株式会社ロッカ', name: '駒形真幸', email: 'komagata@example.com', @@ -16,7 +16,7 @@ class CorporateTrainingMailerTest < ActionMailer::TestCase how_did_you_hear: 'インターネットで知った', additional_information: 'よろしくお願いします。' ) - mail = CorporateTrainingMailer.incoming(corporate_training) + mail = CorporateTrainingInquiryMailer.incoming(corporate_training_inquiry) assert_equal '[FBC] 企業研修の申し込み', mail.subject assert_equal ['info@lokka.jp'], mail.to assert_equal ['noreply@bootcamp.fjord.jp'], mail.from diff --git a/test/mailers/previews/corporate_training_mailer_preview.rb b/test/mailers/previews/corporate_training_inquiry_mailer_preview.rb similarity index 66% rename from test/mailers/previews/corporate_training_mailer_preview.rb rename to test/mailers/previews/corporate_training_inquiry_mailer_preview.rb index 4890e74456a..575d3c39cd9 100644 --- a/test/mailers/previews/corporate_training_mailer_preview.rb +++ b/test/mailers/previews/corporate_training_inquiry_mailer_preview.rb @@ -1,11 +1,11 @@ # frozen_string_literal: true -class CorporateTrainingMailerPreview < ActionMailer::Preview +class CorporateTrainingInquiryMailerPreview < ActionMailer::Preview def incoming - corporate_training = CorporateTraining.new( + corporate_training_inquiry = CorporateTrainingInquiry.new( company_name: '株式会社カンパニー', name: '研修 する世', - email: 'corporate_training@example.com', + email: 'corporate_training_inquiry@example.com', meeting_date1: Time.zone.parse('2030-01-01-08:00'), meeting_date2: Time.zone.parse('2030-01-02-10:00'), meeting_date3: Time.zone.parse('2030-01-03-12:00'), @@ -14,6 +14,6 @@ def incoming how_did_you_hear: 'インターネットで知った', additional_information: 'よろしくお願いします。' ) - CorporateTrainingMailer.incoming(corporate_training) + CorporateTrainingInquiryMailer.incoming(corporate_training_inquiry) end end diff --git a/test/models/corporate_training_inquiry_test.rb b/test/models/corporate_training_inquiry_test.rb new file mode 100644 index 00000000000..200e45eca8b --- /dev/null +++ b/test/models/corporate_training_inquiry_test.rb @@ -0,0 +1,20 @@ +# frozen_string_literal: true + +require 'test_helper' + +class CorporateTrainingInquiryTest < ActiveSupport::TestCase + test '#unique_meeting_dates' do + corporate_training_inquiry = corporate_training_inquiry(:corporate_training_inquiry1) + corporate_training_inquiry.meeting_date1 = Time.zone.parse('2030-01-01-10:00') + corporate_training_inquiry.meeting_date2 = corporate_training_inquiry.meeting_date1 + assert_not corporate_training_inquiry.valid? + assert_includes corporate_training_inquiry.errors[:base], '研修打ち合わせ希望日時はそれぞれ別の日付を選択してください' + end + + test '#meeting_dates_not_in_past' do + corporate_training_inquiry = corporate_training_inquiry(:corporate_training_inquiry1) + corporate_training_inquiry.meeting_date1 = Time.zone.today - 1.day + assert_not corporate_training_inquiry.valid? + assert_includes corporate_training_inquiry.errors[:base], '研修打ち合わせ希望日時に過去の日付は入力できません' + end +end diff --git a/test/models/corporate_training_test.rb b/test/models/corporate_training_test.rb deleted file mode 100644 index 3993a0c1c28..00000000000 --- a/test/models/corporate_training_test.rb +++ /dev/null @@ -1,20 +0,0 @@ -# frozen_string_literal: true - -require 'test_helper' - -class CorporateTrainingTest < ActiveSupport::TestCase - test '#unique_meeting_dates' do - corporate_training = corporate_training(:corporate_training1) - corporate_training.meeting_date1 = Time.zone.parse('2030-01-01-10:00') - corporate_training.meeting_date2 = corporate_training.meeting_date1 - assert_not corporate_training.valid? - assert_includes corporate_training.errors[:base], '研修打ち合わせ希望日時はそれぞれ別の日付を選択してください' - end - - test '#meeting_dates_not_in_past' do - corporate_training = corporate_training(:corporate_training1) - corporate_training.meeting_date1 = Time.zone.today - 1.day - assert_not corporate_training.valid? - assert_includes corporate_training.errors[:base], '研修打ち合わせ希望日時に過去の日付は入力できません' - end -end diff --git a/test/system/corporate_training_system_test.rb b/test/system/corporate_training_inquiry_system_test.rb similarity index 87% rename from test/system/corporate_training_system_test.rb rename to test/system/corporate_training_inquiry_system_test.rb index faa284ea3cc..4c122fedebb 100644 --- a/test/system/corporate_training_system_test.rb +++ b/test/system/corporate_training_inquiry_system_test.rb @@ -2,7 +2,7 @@ require 'application_system_test_case' -class CorporateTrainingSystemTest < ApplicationSystemTestCase +class CorporateTrainingInquirySystemTest < ApplicationSystemTestCase setup do @site_key = Recaptcha.configuration.site_key @secret_key = Recaptcha.configuration.secret_key @@ -16,13 +16,13 @@ class CorporateTrainingSystemTest < ApplicationSystemTestCase Recaptcha.configuration.secret_key = @secret_key end - test 'GET /corporate_training/new' do - visit '/corporate_training/new' + test 'GET /corporate_training_inquiry/new' do + visit '/corporate_training_inquiry/new' assert_equal '企業研修申し込みフォーム | FJORD BOOT CAMP(フィヨルドブートキャンプ)', title fill_in '名前', with: '研修 する世' fill_in '企業名', with: '株式会社カンパニー' - fill_in 'メールアドレス', with: 'corporate_training@example.com' + fill_in 'メールアドレス', with: 'corporate_training_inquiry@example.com' fill_in '第1希望', with: Time.zone.parse('2030-01-01-08:00') fill_in '第2希望', with: Time.zone.parse('2030-01-02-10:00') fill_in '第3希望', with: Time.zone.parse('2030-01-03-12:00') diff --git a/test/system/require_login_test.rb b/test/system/require_login_test.rb index af817d31efe..4c8e598ff49 100644 --- a/test/system/require_login_test.rb +++ b/test/system/require_login_test.rb @@ -50,8 +50,8 @@ class RequireLoginTest < ApplicationSystemTestCase # app/controllers/comeback_controller.rb assert_no_login_required('/comeback/new', '休会からの復帰') - # app/controllers/corporate_training_comtroller.rb - assert_no_login_required('/corporate_training/new', '企業研修申し込みフォーム') + # app/controllers/corporate_training_inquiry_comtroller.rb + assert_no_login_required('/corporate_training_inquiry/new', '企業研修申し込みフォーム') # app/controllers/home_controller.rb assert_no_login_required('/', 'フィヨルドブートキャンプとは?')