diff --git a/test/functional/glossary_categories_controller_test.rb b/test/functional/glossary_categories_controller_test.rb index dedb052..1fcd01d 100644 --- a/test/functional/glossary_categories_controller_test.rb +++ b/test/functional/glossary_categories_controller_test.rb @@ -2,7 +2,8 @@ require File.expand_path('../../test_helper', __FILE__) class GlossaryCategoriesControllerTest < ActionController::TestCase fixtures :projects, :users, :roles, :members, :member_roles - + plugin_fixtures :glossary_categories + def setup @project = projects('projects_001') @project.enabled_module_names = [:glossary] @@ -14,4 +15,19 @@ class GlossaryCategoriesControllerTest < ActionController::TestCase get :index, params: {project_id: 1} assert_response :success end + + def test_edit + @request.session[:user_id] = users('users_002').id + get :edit, params: {id: 1, project_id: 1} + assert_response :success + assert_select 'form', true + end + + def test_update + @request.session[:user_id] = users('users_002').id + patch :update, params: {id: 1, project_id: 1, glossary_category: {name: 'Colour'}} + category = GlossaryCategory.find(1) + assert_redirected_to project_glossary_category_path(@project, category) + assert_equal 'Colour', category.name + end end