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.
This commit is contained in:
songtianlun 2025-01-07 11:58:37 +08:00
parent a54ebdbf23
commit 194e441c50
3 changed files with 4 additions and 5 deletions

View File

@ -18,7 +18,7 @@ Rails.application.routes.draw do
delete "/logout", to: "sessions#destroy" delete "/logout", to: "sessions#destroy"
resources :users 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 # Define your application routes per the DSL in https://guides.rubyonrails.org/routing.html

View File

@ -15,6 +15,6 @@ class UserShowTest < ActionDispatch::IntegrationTest
test "should display user when activated" do test "should display user when activated" do
get user_path(@active_user) get user_path(@active_user)
assert_response :success assert_response :success
assert_template 'users/show' assert_template "users/show"
end end
end end

View File

@ -1,7 +1,6 @@
require "test_helper" require "test_helper"
class UsersSignupTest < ActionDispatch::IntegrationTest class UsersSignupTest < ActionDispatch::IntegrationTest
def setup def setup
ActionMailer::Base.deliveries.clear ActionMailer::Base.deliveries.clear
end end
@ -42,13 +41,13 @@ class UsersSignupTest < ActionDispatch::IntegrationTest
get edit_account_activation_path("invalid token", email: user.email) get edit_account_activation_path("invalid token", email: user.email)
assert_not is_logged_in? 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? assert_not is_logged_in?
# 令牌有效 # 令牌有效
get edit_account_activation_path(user.activation_token, email: user.email) get edit_account_activation_path(user.activation_token, email: user.email)
assert user.reload.activated? assert user.reload.activated?
follow_redirect! follow_redirect!
assert_template 'users/show' assert_template "users/show"
assert is_logged_in? assert is_logged_in?
end end
end end