From 509450fd304b24e22ae85243deb6caf8920443d3 Mon Sep 17 00:00:00 2001 From: Umar Sheikh Date: Thu, 9 Nov 2017 17:06:13 +0500 Subject: [PATCH] stick to test naming convention and better variable name --- .../object_manager_attributes_controller_test.rb | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/test/controllers/object_manager_attributes_controller_test.rb b/test/controllers/object_manager_attributes_controller_test.rb index 69073eeeb..ac810c5af 100644 --- a/test/controllers/object_manager_attributes_controller_test.rb +++ b/test/controllers/object_manager_attributes_controller_test.rb @@ -23,15 +23,15 @@ class ObjectManagerAttributesControllerTest < ActionDispatch::IntegrationTest groups: groups, ) end - test 'converts string to boolean for default option' do + test '01 converts string to boolean for default value for boolean data type' do credentials = ActionController::HttpAuthentication::Basic.encode_credentials('tickets-admin@example.com', 'adminpw') post '/api/v1/object_manager_attributes', params: { 'name' => 'customdescription2', 'object' => 'Ticket', 'display' => 'custom description 2', 'active' => true, 'data_type' => 'boolean', 'data_option' => { 'options' => { 'true' => '', 'false' => '' }, 'default' => 'true' }, 'screens' => { 'create_middle' => { 'ticket.customer' => { 'shown' => true, 'item_class' => 'column' }, 'ticket.agent' => { 'shown' => true, 'item_class' => 'column' } }, 'edit' => { 'ticket.customer' => { 'shown' => true }, 'ticket.agent' => { 'shown' => true } } }, 'id' => 'c-192' }.to_json, headers: @headers.merge('Authorization' => credentials) assert_response :success result = JSON.parse @response.body - obj = ObjectManager::Attribute.find result['id'] - assert_equal true, obj.data_option['default'] - assert_equal 'boolean', obj.data_type - obj.destroy + object = ObjectManager::Attribute.find result['id'] + assert_equal true, object.data_option['default'] + assert_equal 'boolean', object.data_type + object.destroy end end