リビジョン b9f410b0
| test/functional/glossary_categories_controller_test.rb | ||
|---|---|---|
|
|
||
|
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]
|
||
| ... | ... | |
|
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
|
||
[phase-18]Add edit/update action test for GlossaryCategoriesController