3
我只是試圖使用下面的代碼來測試通過Rspec Request規範中的Devise路徑更新用戶的電子郵件,我想知道爲什麼它給我的錯誤:ActionController::UnknownFormat:
測試設計用Rspec更新用戶註冊信息並獲取:ActionController :: UnknownFormat:Error
require 'rails_helper'
RSpec.describe "UsersEdits", type: :request do
let(:user) { FactoryGirl.create(:user) }
it "my test" do
email = "[email protected]"
params = { "user[email]" => email, "user[current_password]" => 'foobar' }
put user_registration_path(user), params
user.reload
expect(user.email).to eq(email)
end
end
這裏是錯誤:
Failure/Error: patch user_registration_path(user), params
ActionController::UnknownFormat:
ActionController::UnknownFormat
任何幫助將不勝感激,謝謝!