From 02b7393ed4e73e102182b53470ab5e29997a36c0 Mon Sep 17 00:00:00 2001 From: songtianlun Date: Tue, 31 Dec 2024 00:37:02 +0800 Subject: [PATCH] add some test --- Gemfile | 1 + Gemfile.lock | 5 +++++ app/views/layouts/_footer.html.erb | 4 ++-- app/views/layouts/_header.html.erb | 6 +++--- config/routes.rb | 4 ++++ test/controllers/static_pages_controller_test.rb | 14 ++++---------- test/helpers/application_helper_test.rb | 8 ++++++++ test/integration/site_layout_test.rb | 15 +++++++++++++++ 8 files changed, 42 insertions(+), 15 deletions(-) create mode 100644 test/helpers/application_helper_test.rb create mode 100644 test/integration/site_layout_test.rb diff --git a/Gemfile b/Gemfile index aea34e6..a8f5c18 100644 --- a/Gemfile +++ b/Gemfile @@ -65,4 +65,5 @@ group :test do gem "capybara" gem "selenium-webdriver" gem "minitest-reporters" + gem "rails-controller-testing" end diff --git a/Gemfile.lock b/Gemfile.lock index d4ed5a7..f83fe37 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -272,6 +272,10 @@ GEM activesupport (= 8.0.1) bundler (>= 1.15.0) railties (= 8.0.1) + rails-controller-testing (1.0.5) + actionpack (>= 5.0.1.rc1) + actionview (>= 5.0.1.rc1) + activesupport (>= 5.0.1.rc1) rails-dom-testing (2.2.0) activesupport (>= 5.0.0) minitest @@ -443,6 +447,7 @@ DEPENDENCIES propshaft puma (>= 5.0) rails (~> 8.0.1) + rails-controller-testing rubocop-rails-omakase sassc-rails (>= 2.1.0) selenium-webdriver diff --git a/app/views/layouts/_footer.html.erb b/app/views/layouts/_footer.html.erb index f30de60..4c2be8d 100644 --- a/app/views/layouts/_footer.html.erb +++ b/app/views/layouts/_footer.html.erb @@ -5,8 +5,8 @@ diff --git a/app/views/layouts/_header.html.erb b/app/views/layouts/_header.html.erb index c9ddf47..8352757 100644 --- a/app/views/layouts/_header.html.erb +++ b/app/views/layouts/_header.html.erb @@ -1,10 +1,10 @@