测试 请教 RSpec 中的 put 是什么动作?

woody1983 · September 01, 2012 · Last by woody1983 replied at September 01, 2012 · 2222 hits
describe "submitting a PUT request to the Users#update action" do
        before { put user_path(wrong_user) }
        specify { response.should redirect_to(root_path) }
end

http://ruby.railstutorial.org/chapters/updating-showing-and-deleting-users#sec-requiring_the_right_user

这一步的测试我一直没有搞明白他要测试的是什么?第一个是不能编辑其他 user 的信息,这第二个看起来头晕。

这代码不是已经很清楚了么?提交 PUT 到错误的用户。

#1 楼 @fredwu 是 rest 里的 put 动作吗?

You need to Sign in before reply, if you don't have an account, please Sign up first.