跳至內容 跳至搜尋
命名空間
方法
R
包含的模組

實例公開方法

read_fixture(動作)

讀取給定郵件程式所使用的預設檔案。

這在透過於預設檔案中撰寫電子郵件內文來測試郵件程式時很有用。請參閱測試指南以取得具體範例: guides.rubyonrails.org/testing.html#revenge-of-the-fixtures

# File actionmailer/lib/action_mailer/test_case.rb, line 82
def read_fixture(action)
  IO.readlines(File.join(Rails.root, "test", "fixtures", self.class.mailer_class.name.underscore, action))
end