プロジェクト

全般

プロフィール

« | » 

リビジョン aca71c07

高徹 高橋 徹 さんが約6年前に追加

[phase-18]Add destroy action test for GlossaryCategoriesController, and fix redirect_to action

差分を表示:

app/controllers/glossary_categories_controller.rb
def destroy
@category.destroy
redirect_to project_glossary_categories_path
redirect_to project_glossary_categories_path(@project)
end
# Find the category whose id is the :id parameter
test/functional/glossary_categories_controller_test.rb
assert_not_nil category
assert_redirected_to project_glossary_category_path(@project, category)
end
def test_destroy
@request.session[:user_id] = users('users_002').id
delete :destroy, params: { id: 1, project_id: 1 }
assert_raise(ActiveRecord::RecordNotFound) { GlossaryCategory.find(1) }
assert_redirected_to project_glossary_categories_path(@project)
end
end

他の形式にエクスポート: Unified diff