提交 3486d540 编写于 作者: D David Heinemeier Hansson

Fixed that functional tests generated for scaffolds should use fixture calls...

Fixed that functional tests generated for scaffolds should use fixture calls instead of hard-coded IDs (closes #10435) [boone]

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8386 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
上级 78727dd8
*SVN*
* Fixed that functional tests generated for scaffolds should use fixture calls instead of hard-coded IDs #10435 [boone]
* Added db:migrate:redo and db:migrate:reset for rerunning existing migrations #10431, #10432 [matt]
* RAILS_GEM_VERSION may be double-quoted also. #10443 [James Cox]
......
......@@ -21,23 +21,23 @@ def test_should_create_<%= file_name %>
end
def test_should_show_<%= file_name %>
get :show, :id => 1
get :show, :id => <%= table_name %>(:one).id
assert_response :success
end
def test_should_get_edit
get :edit, :id => 1
get :edit, :id => <%= table_name %>(:one).id
assert_response :success
end
def test_should_update_<%= file_name %>
put :update, :id => 1, :<%= file_name %> => { }
put :update, :id => <%= table_name %>(:one).id, :<%= file_name %> => { }
assert_redirected_to <%= file_name %>_path(assigns(:<%= file_name %>))
end
def test_should_destroy_<%= file_name %>
assert_difference('<%= class_name %>.count', -1) do
delete :destroy, :id => 1
delete :destroy, :id => <%= table_name %>(:one).id
end
assert_redirected_to <%= table_name %>_path
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册