From 194e441c50ec27ce2439922cf9fccaa8bc5c101a Mon Sep 17 00:00:00 2001 From: songtianlun Date: Tue, 7 Jan 2025 11:58:37 +0800 Subject: [PATCH] style: standardize quotes in tests - Changed single quotes to double quotes in assertions for consistency. - Updated routes file for spacing consistency in resource declaration. These changes improve code readability and maintain consistency in the codebase, making it easier for developers to follow the style guide. --- config/routes.rb | 2 +- test/integration/user_show_test.rb | 2 +- test/integration/users_signup_test.rb | 5 ++--- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/config/routes.rb b/config/routes.rb index cbfc239..637018d 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -18,7 +18,7 @@ Rails.application.routes.draw do delete "/logout", to: "sessions#destroy" resources :users - resources :account_activations, only: [:edit] + resources :account_activations, only: [ :edit ] # Define your application routes per the DSL in https://guides.rubyonrails.org/routing.html diff --git a/test/integration/user_show_test.rb b/test/integration/user_show_test.rb index 35953b5..06c258d 100644 --- a/test/integration/user_show_test.rb +++ b/test/integration/user_show_test.rb @@ -15,6 +15,6 @@ class UserShowTest < ActionDispatch::IntegrationTest test "should display user when activated" do get user_path(@active_user) assert_response :success - assert_template 'users/show' + assert_template "users/show" end end diff --git a/test/integration/users_signup_test.rb b/test/integration/users_signup_test.rb index a45e991..d2ca44d 100644 --- a/test/integration/users_signup_test.rb +++ b/test/integration/users_signup_test.rb @@ -1,7 +1,6 @@ require "test_helper" class UsersSignupTest < ActionDispatch::IntegrationTest - def setup ActionMailer::Base.deliveries.clear end @@ -42,13 +41,13 @@ class UsersSignupTest < ActionDispatch::IntegrationTest get edit_account_activation_path("invalid token", email: user.email) assert_not is_logged_in? # 令牌有效,邮箱错误 - get edit_account_activation_path(user.activation_token, email: 'wrong') + get edit_account_activation_path(user.activation_token, email: "wrong") assert_not is_logged_in? # 令牌有效 get edit_account_activation_path(user.activation_token, email: user.email) assert user.reload.activated? follow_redirect! - assert_template 'users/show' + assert_template "users/show" assert is_logged_in? end end