ns_settings_ui 1.4.0 → 1.6.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (165) hide show
  1. checksums.yaml +5 -5
  2. data/.gitignore +1 -0
  3. data/Appraisals +7 -2
  4. data/Gemfile +2 -1
  5. data/Jenkinsfile +6 -17
  6. data/README.md +11 -4
  7. data/app/assets/stylesheets/ns_settings_ui/settings.css.scss +3 -7
  8. data/app/controllers/ns_settings_ui/settings_controller.rb +7 -5
  9. data/app/helpers/ns_settings_ui/settings_helper.rb +2 -2
  10. data/app/views/ns_settings_ui/settings/_setting_row.html.erb +16 -4
  11. data/app/views/ns_settings_ui/settings/_update.js.erb +2 -3
  12. data/app/views/ns_settings_ui/settings/index.html.erb +17 -8
  13. data/db/migrate/20151210214903_create_ns_settings_ui_settings.rb +1 -1
  14. data/db/migrate/20151215081718_add_value_type_to_ns_settings_ui_settings.rb +1 -1
  15. data/docker/{ruby-2.3 → ruby-2.5}/Dockerfile +2 -2
  16. data/docker/{ruby-2.1 → ruby-2.6}/Dockerfile +2 -2
  17. data/gemfiles/rails_5.0.gemfile +3 -3
  18. data/gemfiles/rails_5.1.gemfile +9 -0
  19. data/gemfiles/rails_5.2.gemfile +9 -0
  20. data/gemfiles/rails_6.0.gemfile +9 -0
  21. data/lib/ns_settings_ui/version.rb +1 -1
  22. data/ns_settings_ui.gemspec +6 -7
  23. data/spec/controllers/ns_settings_ui/settings_controller_spec.rb +18 -10
  24. data/spec/dummy/db/development.sqlite3 +0 -0
  25. data/spec/dummy/db/schema.rb +11 -11
  26. data/spec/dummy/log/development.log +953 -24729
  27. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/1Q/1QB42H1NZOv1Uay-0TkKE9ghns-ZIeSg1gnhWKvfGvA.cache +0 -0
  28. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/2D/2DXUTVsPODtKGnNri4SOvHrkE2myni1cEt_ZIfAHXJw.cache +1 -0
  29. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/3r/3rmoYMFO0Jrj3gvm3zJUkzBwWaTelbhQO4YR1UIKTyA.cache +1 -0
  30. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/{ZF/ZFjkgAdh704SFnlnWknpx5VmKQmtZfWMCaAvmclvlCI.cache → 4r/4r7PCpGNKVGy5U57si-aNa-WrnOqb9CMJAFw1kAXKEw.cache} +0 -0
  31. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/{daetmRRecxXiuf6XSOoCQ-NLK1yt7u5JxbUNaY1CZ90.cache → 5T/5TQBQanGGX8d3DbnDOqOwYEdc3-04UU_CJvXHN8BlVA.cache} +0 -0
  32. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/6L/6LNmGbL4GS7dz541UfQnjYF7SsaKekrud8j-lPQY3vo.cache +1 -0
  33. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/7I/7Itw-RMnxAb9sebfaZd_FUbeDmudp5v1d4pCh37CN2o.cache +0 -0
  34. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/{-n/-nDGW6bsHFANrZ0g4hoTq2oSreQchXVrFaVFRvQ3LDQ.cache → 7Q/7QIPRBVhqageArd88xgs8ysMifpJmAi_cmbQXMf-Bg4.cache} +0 -0
  35. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/7r/7rr7OxIU-Nrru51DtYS5JpbkwQ6oEWHT53I5Jv66oUE.cache +1 -0
  36. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/81/81kktPiVqlXYsxcwqxryyR0_AsDbDOb_6JVLQYfU2pw.cache +0 -0
  37. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/DO/DOeD_XISVY45Mc229_02iPiTNzIxjETmmBaLmz4y1u0.cache +2 -0
  38. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/{3z/3zCB8HUPjOQbgw3Q8bMiDgdu57dPhBbm7gMBauXLlIU.cache → Ds/DsNngC4szxKgSveq2y376hQYep8mLef39J9anfz4vG4.cache} +0 -0
  39. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/GE/GEaZlRf17g8sOjbRRsN__uINGIaygDXA9zr9J7lpKmQ.cache +1 -0
  40. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/{k4lpA3h5VR8R1i6iSozIK65t8bC9NRtNyjcg-Q5x6os.cache → Gu/GuNtMSt-46047eWgyDMUD-r01adMQy5WIB45vqvzCDw.cache} +0 -0
  41. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/{5k/5kzTWM6_p0-t5ofmJ0nNiObESAY92qp9Kp7kjNhtpBo.cache → HC/HClaxqvORK0s3SJWMIaY173WzYnZvdLLbJL-08vMJls.cache} +0 -0
  42. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/{B2/B2fn2phPHEx0vY9-A6BLanAmyKOG1ho88uFsrhaPs_o.cache → HE/HEdM9QhJT2DdFNOth7hNuP7imkqyVpif09mPjbGbM7Y.cache} +0 -0
  43. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/{oO/oOUlBS4R2_gj-GaU6L9gdAu56mUr0K6ydOnCylMSzq4.cache → Hx/HxnVa8hx0bXTuWul6qGnhNJpFnaAPAz1ufbU19eM7uI.cache} +0 -0
  44. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/Li/LiJ9MOKuuh5aasXa_LA2W0Xq8Og_ca3mSG6l7Ji8PWU.cache +0 -0
  45. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/Pg/PgkWyl92ZZmpTA7i6-dyo0g4b1jTnHhCfxkIqQsXPng.cache +0 -0
  46. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/Qd/Qdri862WpTAQEh3CIcHvRdmSYlQSGCMzTkv-aOKtvMw.cache +2 -0
  47. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/{TN/TN_1x1HnuEbtUlTaTvQFBW7GGWNVwQlPgCo4-1dsmzQ.cache → Rs/RsZqCCFpF3V6xmWnGtACRUwxYGn9TRxvr-COvciYNu8.cache} +0 -0
  48. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/UP/UPbGcaukhk0tE3OKTLH1g70yboMTI8aHcuM83ggkwQQ.cache +1 -0
  49. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/WL/WLVdy5u-N98Vk-QCYMflztniiaBFu__3MzbZJi-jz2c.cache +2 -0
  50. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/WO/WOenedvanYiNAR-4JvsIAJYWIKX66SWUi41smSSaEoY.cache +1 -0
  51. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/ZD/ZDc2YKanRwHacFn5Y-WpFgmslYDCSFsyDSqGzkxyaeY.cache +2 -0
  52. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/ZX/ZXy-gRTCbHJLwlneHwyUFmU7CT5u54RcFO-cCFy3f74.cache +0 -0
  53. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/bc/bcMIaYq8n-5UYw-_y68OoQ162CFvLoAfmmc86FUUcNg.cache +2 -0
  54. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/cK/cKfSggJdlZ2EGFysLBC6GRWgoobNbNTKAfDATAzl6os.cache +1 -0
  55. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/cW/cWQKvEFwGiD04HxTp43XsSwuiXTiIpO6n23IVj_lQow.cache +0 -0
  56. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/f0/f0ml0cDGHD_Y41H81Tm-U5_Fmlv_WNl_gNbnO-WK5q8.cache +1 -0
  57. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/i0/i06XeHh9NHpcuIjd0o9OZiYq3B2oA6Gzng-_LddFB3M.cache +1 -0
  58. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/iS/iS4fvah8AQeWnxHlrdaGcTTW8MNmeedVJ0lKQCMLcm4.cache +1 -0
  59. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/{eN/eNzAMm1eZv3LY3_WHr1Rjsnie0ZXqpSfslOps_hyqbo.cache → mM/mM5lrKFGu6PEdhxPlQgEv0aeQNZspNRFbwh9hl-5rhM.cache} +0 -0
  60. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/mN/mNvm06ETzMBs90cB-i4UncGL_ayw8pXOlBgH7bMkL0w.cache +1 -0
  61. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/o9/o9B0pu0z1WpM1mK7J-lQsdpYJBwj9riEhLiBMS1xFnk.cache +1 -0
  62. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/rt/rt7h9Ed7IEj_X8P_V-_o8m6se9EsH0_O60kuQYwvZCs.cache +2 -0
  63. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/{F2/F2lV1u--WpU7laT7IqgHryfAUAQm9c39i_E9Cp0UZi8.cache → sQ/sQqEj7C_Bh1nFktmMPuGKejQcgGh7IiiYWhL1ZlrQZc.cache} +0 -0
  64. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/vJ/vJjLZh4c-PMyXIZ2Jy6nFgYkhbTBt6WFH-UJCy4f_O4.cache +0 -0
  65. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/{-P/-P5N4gAIEOsg8Xh_syFW2OjHGNaTuTmwahM_8tk1Sfg.cache → vR/vRvy2KfAFUtT7xlG0rK5HGAVFktcOyej_csD8SbQptU.cache} +0 -0
  66. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/wD/wDl7MJqUJfwZDv4L3C0P7T0vmziK8MYdELT-CYwViYw.cache +3 -0
  67. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/{2O/2OyyD1nfy_jdyvM3ABT_fHOyj5LJZcPl-TGNMWE7R8c.cache → wR/wRoXPtBv02eq2IDOjjnWJoIoGsvY_9t79EpMENnWrOo.cache} +1 -1
  68. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/y0/y0Rune9_xN7rxsq66mW-4wJyXS59_wqrRJ_x6xyATZY.cache +2 -0
  69. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/{ZJ/ZJY-symrduiXltPt9QyQRauXtQe0Mq144UF8lZzTUFA.cache → yN/yN0ZvvTlF-Q932jhcQSaycV7tHqZffwgJj28X0SeLZk.cache} +0 -0
  70. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/{4n/4nvTkWncQtAxbUpN-5H3v1BeDSOHYeZ4gPLzQSR4No4.cache → yQ/yQoF8B57Gx99m7bUVJvMSXkH791H_oOUbRBD6E1xe54.cache} +0 -0
  71. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/{-U/-UNBCf5PBJzyPETQgVBzGzs3nnOOJXC0aWnacwyJ7a8.cache → zJ/zJfE7OrjbGntgQkvLjN0PDHZ80YLXlht8DoDN1nrkEY.cache} +0 -0
  72. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/{G2/G2j8rHJQoZ1tNMNz6oSKvT4OKTEo61eourd7-hO7x2U.cache → zy/zyuc1Dql1HIymE8j0hvxddASX6oCA8ShHTnFs4xWnYk.cache} +0 -0
  73. data/spec/dummy/tmp/development_secret.txt +1 -0
  74. data/spec/helpers/ns_settings_ui/settings_helper_spec.rb +1 -1
  75. data/spec/models/ns_settings_ui/setting_spec.rb +3 -3
  76. data/spec/spec_helper.rb +0 -3
  77. metadata +160 -283
  78. data/app/views/ns_settings_ui/settings/_edit.html.erb +0 -12
  79. data/bin/rails +0 -13
  80. data/docker/ruby-2.2/Dockerfile +0 -22
  81. data/gemfiles/rails_4.2.gemfile +0 -8
  82. data/spec/dummy/config/application.rb~ +0 -64
  83. data/spec/dummy/db/test.sqlite3 +0 -0
  84. data/spec/dummy/log/test.log +0 -0
  85. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/-P5N4gAIEOsg8Xh_syFW2OjHGNaTuTmwahM_8tk1Sfg.cache +0 -0
  86. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/-nDGW6bsHFANrZ0g4hoTq2oSreQchXVrFaVFRvQ3LDQ.cache +0 -1
  87. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/02EYVImRSug0bIQFdSGmKgbTjl6wT8sIMDhZF1x9iNY.cache +0 -1
  88. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/0mhdiJfi-mIf3kHUqWwnSijrfI2MWMuOBgNPqHqBnNw.cache +0 -0
  89. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/0q/0qw9vOxwcAKQgUwq1dpCsAy-l8tbbe9esr_rx2VqC8c.cache +0 -0
  90. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/2OyyD1nfy_jdyvM3ABT_fHOyj5LJZcPl-TGNMWE7R8c.cache +0 -3
  91. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/2kRAHYr5f9rsDUaUJtG_skyYsgzk4jw6sq2IpKn9c5A.cache +0 -1
  92. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/38/385XnEMsoN-UfZQOzOTI9sqTIXmQTbn1l-hBrssaAug.cache +0 -1
  93. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/3WiClrpGx8ELz4uqo2YIdcYfURQTJl4Hl4grM4GNhig.cache +0 -1
  94. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/3zCB8HUPjOQbgw3Q8bMiDgdu57dPhBbm7gMBauXLlIU.cache +0 -0
  95. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/4KIH-pQ5mMT0lGZDCivTDLS8H7D3DfGqd3Z4cTI9FA8.cache +0 -0
  96. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/5kzTWM6_p0-t5ofmJ0nNiObESAY92qp9Kp7kjNhtpBo.cache +0 -1
  97. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/5xRk2RqJlt14QtnBvn5xcFNRlvm6p74V7bcgc0hpSF0.cache +0 -1
  98. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/6D/6DcXApTLWq4mcO74RYWAY-C0y4kk0PaSEb2Jj-tTZ2o.cache +0 -0
  99. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/6DcXApTLWq4mcO74RYWAY-C0y4kk0PaSEb2Jj-tTZ2o.cache +0 -0
  100. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/6x/6x5tE9q-MTn00DUkoGKka9QookZkAtcIL56Za6ibf10.cache +0 -0
  101. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/7GAkIzqqVKr2QaDA4tLeYQx0XZOh_n8s3esYiG2iYgk.cache +0 -1
  102. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/9MIqk8H69sTS09oTmzjsCAB2TVkI44JKBtiHTSRm5kA.cache +0 -0
  103. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/A7/A7lKXad4aSED7nGqrUZPm55nqq5EHkiekB6zcj8w0bM.cache +0 -2
  104. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/A7lKXad4aSED7nGqrUZPm55nqq5EHkiekB6zcj8w0bM.cache +0 -2
  105. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/AQ/AQFqPlHMx1WuZNG-fM1JxARx9tE-mZD2ErSlhxv_WGA.cache +0 -1
  106. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/AQFqPlHMx1WuZNG-fM1JxARx9tE-mZD2ErSlhxv_WGA.cache +0 -1
  107. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/B2fn2phPHEx0vY9-A6BLanAmyKOG1ho88uFsrhaPs_o.cache +0 -1
  108. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/BqP1f39wNCtYgNXGsX_JWrKE3MjEh22EQZuPus8qLIo.cache +0 -1
  109. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/DbmLC3wtG7ztEvkzmVAubW8vf37XdD0bT3Kh73oed1A.cache +0 -2
  110. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/F2lV1u--WpU7laT7IqgHryfAUAQm9c39i_E9Cp0UZi8.cache +0 -1
  111. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/Gjihe7fTlsTN7FRJZ5KDpQvVXtiXeMm6E_X7m3fHUe4.cache +0 -1
  112. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/JntiJRvV1m7oAiTPulchvwysIxjDP4C6HkSNj44xF44.cache +0 -0
  113. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/LH/LHQrHjA76Pbj4Y9IHGhVYNoPdaJG1RwChX3Y7M2K0ik.cache +0 -1
  114. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/LY/LYabX26ppN5YiXDbfiKEGZZvtXwuEQHeTHAhGY0AREw.cache +0 -1
  115. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/Lb/LbDtPpDdBS-4HEW-g-yDdUipmgjbSNpeO2meqQkqbds.cache +0 -2
  116. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/LbDtPpDdBS-4HEW-g-yDdUipmgjbSNpeO2meqQkqbds.cache +0 -2
  117. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/Ld19MrcmYdiYXPLnWdrkkvqBWsHTrQ6zDmpLwT-S55A.cache +0 -1
  118. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/Lu/LuOx5bH0LyUlUw0ZOmovaYG-o1TD2_Zu9Kjpcoyf_Is.cache +0 -0
  119. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/ME/MEL3QGTDSnEqNiZvl5UolKPdogCYh07jB2sTV0aeP7s.cache +0 -2
  120. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/MEL3QGTDSnEqNiZvl5UolKPdogCYh07jB2sTV0aeP7s.cache +0 -2
  121. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/NL/NLSBQ_Lw_a4wvGssTbGM4CacsmS-J9b_9LFogTF9OQc.cache +0 -2
  122. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/NLSBQ_Lw_a4wvGssTbGM4CacsmS-J9b_9LFogTF9OQc.cache +0 -2
  123. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/OEHWELzqAY4nbQUgQEw5thz0C--Zw7TdoKcdm8_-XFg.cache +0 -0
  124. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/PJ/PJJnNk7DqsWIjsjQGpr4MvSkW00eDHZnof-L4pLxJSI.cache +0 -1
  125. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/Qa/Qahrw2KaWKgtPNmoVMFmExpig8nB6E_MS4H00mq2pXA.cache +0 -1
  126. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/RL/RL3YXJZtkjMYDETF-_W84RBFSpoAKMuFsfnyWTwf5hw.cache +0 -1
  127. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/S7/S7XzcVzxkE5xCWDSAMsKz4s9Dhx_SDF5WxZ03-NTxHc.cache +0 -2
  128. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/S7XzcVzxkE5xCWDSAMsKz4s9Dhx_SDF5WxZ03-NTxHc.cache +0 -2
  129. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/S9/S9S3FUgRirpGlwTpwsBEFioEFqeUPgQJXCiqjZrUFaE.cache +0 -0
  130. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/Sw/Swe_o8TnQlLzQxX4yTzT5LoBNQsEgd_pPvNjFG4vRP0.cache +0 -1
  131. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/TN/tnb4IYRAqut70o3gstfWCyHPuTB7VKRgGIf4lp0LkNY.cache +0 -2
  132. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/TN_1x1HnuEbtUlTaTvQFBW7GGWNVwQlPgCo4-1dsmzQ.cache +0 -1
  133. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/TZ/TZnNo6NqSO--JyRbplEX9Of9FeHfu_Mj85uiZqB16Ak.cache +0 -0
  134. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/TgTcVvqf5KTGti25aDSVdPzdEFSzFCA7TIgv36nVcSw.cache +0 -2
  135. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/W7/W7OlguezlKcoK5ELEx3lFCbVk4EH6fZAjzE85_lRhB8.cache +0 -0
  136. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/_V/_VaiITLetY0gXyNs_IXYYw_DYSCEed2o8_MTEASTnzw.cache +0 -1
  137. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/bY62b_2A-fgI1sXtwzYoWIkavZdqRKnIJB8gWu44xEM.cache +0 -1
  138. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/ck/ckg4k18QJlw_HQu6HZmZSOROoDxjtXOOr-Ty_00hojY.cache +0 -0
  139. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/eNzAMm1eZv3LY3_WHr1Rjsnie0ZXqpSfslOps_hyqbo.cache +0 -1
  140. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/fB/fB1KEPny0m2I4ROpz6pKFCaW6NX7FrFFmw58fuTI-NU.cache +0 -1
  141. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/g0/g0KWN3F5hRnUA7rri5zVEt_WWiDqDPzJDxkLDjcusVg.cache +0 -1
  142. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/gWGqi7hGLgRyTjcCFLkUh-yJ1Vtx2FMEICpRXs1wzEo.cache +0 -1
  143. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/jt/jtGnBpWmiaBd1UbiHJO-t0TrhuDjNqpvm6H_ZVPQ42s.cache +0 -1
  144. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/k1/k1USytjeb5G7PP0FKeNKUzcNvipa-7FrqFIFYva-VFE.cache +0 -1
  145. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/kXBiIg2PG-iiVp3gbkGyQyfhjXISDwXTAZ3sWizEVHo.cache +0 -0
  146. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/kXE2glx_EfYjc5qtYwa7HBlPelwV6h-lIlKYZcnLb_I.cache +0 -0
  147. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/muJ5bM5NJmYo04SUNB-V_ac-fQOl1OoDvueoZdwgDX0.cache +0 -0
  148. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/oOUlBS4R2_gj-GaU6L9gdAu56mUr0K6ydOnCylMSzq4.cache +0 -0
  149. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/ptP8k5YaRaFKIsCDCp2-dbaA6i5hgrPOE3E4nGD71TI.cache +0 -1
  150. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/q6BYa32YJF11eGVapO4ouNl6gayPIsARgMavlzZmoi0.cache +0 -2
  151. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/qEfrt4DZCVIG3Em7okK-t6c8ZyEp-eFaQI2XgWbYcIE.cache +0 -0
  152. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/r4/r4NK-Fk3zvSZG3XplmgvxX1fpWfXe2Bww3iMGRU69-Y.cache +0 -2
  153. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/r4NK-Fk3zvSZG3XplmgvxX1fpWfXe2Bww3iMGRU69-Y.cache +0 -2
  154. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/rs/rs1aEM90P35Cs3UlkSDli_MajVD_FhTg_9HFGBLI1F0.cache +0 -0
  155. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/tnb4IYRAqut70o3gstfWCyHPuTB7VKRgGIf4lp0LkNY.cache +0 -2
  156. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/uX86DP4kCULYsv-oGEGZ0AB4uDW1TNwHj0WfXK-76Fs.cache +0 -1
  157. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/ujDmEfvWKb-VV0RMhQfN0LwjjtxHApky8IG1Yczod1w.cache +0 -0
  158. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/ur/uriZrL38CsxxWhAapMUj-McBMy5FMwGbuQJTy-ek87E.cache +0 -1
  159. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/vRK3l8qdANsGQ-G-rc0PKIM0hL8D1bR76c448hflHX0.cache +0 -0
  160. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/wm9vbvFa5VtFcxpe_ceqFIBVAbvN-CM37jRO5UjidNE.cache +0 -1
  161. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/x7KkTV3ibfIEysLB_ug5bfmnn2VLV_BldukPR3EoPBk.cache +0 -2
  162. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/zn/zn-kV2HeIf1OBeBRw38FIerytA2IPm8CAYqXHToqCDE.cache +0 -3
  163. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/zn-kV2HeIf1OBeBRw38FIerytA2IPm8CAYqXHToqCDE.cache +0 -3
  164. data/spec/spec_helper.rb~ +0 -37
  165. data/spec/support/blueprints.rb +0 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 0c8f0d504ffd79a96f754d7250f311debf3a21ba
4
- data.tar.gz: 64d114977ab0b97f8a230909ad337a6959aeb34e
2
+ SHA256:
3
+ metadata.gz: def0eda93467645d2ae26f90946570733724636d514671634f0cb5d501ee6adb
4
+ data.tar.gz: 4fdd67d552b4e26777432af353e543f3ecd7fc04b300bb1d00602cd85653118e
5
5
  SHA512:
6
- metadata.gz: a2846da77bb4edc91073591157f7f0729402e940e1f8f7db1c88904935463b49f1d3a15f0f5d89aef74a15ba242cd26e94c12ebc7f96ed8075d00f8127ba01f8
7
- data.tar.gz: 96fe0ae18814b4709120436d00b0ec0da259f3ccd3dcd27600423de63bc08f07f8cb090e064c32276c7860a173d1648d98520a9f9758eafb2ff2dae9bc290dca
6
+ metadata.gz: de0094fefc6946fa3384af40f80956d73652ec3d7cb1140424ca80ddd5f14d2376cd5156183be645711732c0f7f562bb812c8a278442be8b2651a75225b56c9a
7
+ data.tar.gz: d078810ec119d6beb487b9c765f5bc02cae1e22493708ee3e87cba15d88ec7dd8677dde2a4f79396cd2fbc90c9a498f307c90ba5128e1830ff9fbe2aea2da337
data/.gitignore CHANGED
@@ -15,3 +15,4 @@ gemfiles/*.gemfile.lock
15
15
  .[#]*
16
16
  spec/reports
17
17
 
18
+ .idea/
data/Appraisals CHANGED
@@ -1,6 +1,11 @@
1
- [5.0, 4.2].each do |version|
1
+ [5.0, 5.1, 5.2].each do |version|
2
2
  appraise "rails_#{version}" do
3
3
  gem 'rails', "~> #{version}.0"
4
- gem 'rails-controller-testing' if version == 5.0
4
+ gem "sqlite3", "~> 1.3.0"
5
5
  end
6
6
  end
7
+
8
+ appraise "rails_6.0" do
9
+ gem 'rails', "~> 6.0.3"
10
+ gem "sqlite3", "~> 1.4.0"
11
+ end
data/Gemfile CHANGED
@@ -13,4 +13,5 @@ gemspec
13
13
  # To use debugger
14
14
  # gem 'debugger'
15
15
 
16
- gem 'rails', '~> 4.2'
16
+ gem 'rails', '>= 5.0'
17
+ gem "sprockets", "~> 3.7.2"
data/Jenkinsfile CHANGED
@@ -33,8 +33,8 @@ def appNode(String rubyVersion) {
33
33
  }
34
34
  }
35
35
 
36
- appNode('ruby-2.2')
37
- appNode('ruby-2.3')
36
+ appNode('ruby-2.5')
37
+ appNode('ruby-2.6')
38
38
 
39
39
  def setupGemsDockerVolume(String rubyVersion, String executorNumber) {
40
40
  stage name: "$rubyVersion - Setup Docker Volume", concurrency: 1
@@ -44,8 +44,8 @@ def setupGemsDockerVolume(String rubyVersion, String executorNumber) {
44
44
  def resolveDependencies(me.knapik.DockerCompose compose, String rubyVersion) {
45
45
  stage "$rubyVersion - Resolve Dependencies"
46
46
  compose.exec('app', "bundle install --quiet")
47
- compose.exec('app', "appraisal install")
48
- compose.exec('app', "appraisal list > .rails_versions")
47
+ compose.exec('app', "bundle exec appraisal install")
48
+ compose.exec('app', "bundle exec appraisal list > .rails_versions")
49
49
  }
50
50
 
51
51
  def test(me.knapik.DockerCompose compose, String rubyVersion) {
@@ -53,15 +53,8 @@ def test(me.knapik.DockerCompose compose, String rubyVersion) {
53
53
  for (int i = 0; i < railsVersions.size(); ++i) {
54
54
  def railsVersion = railsVersions[i]
55
55
  stage "$rubyVersion $railsVersion - Tests"
56
- try {
57
- if(railsVersion >= 'rails_5.0') {
58
- compose.exec('app', "appraisal $railsVersion rails app:db:environment:set RAILS_ENV=development")
59
- }
60
- compose.exec('app', "appraisal $railsVersion bundle exec rake app:db:schema:load")
61
- compose.exec('app', "appraisal $railsVersion bundle exec rake app:ci:setup:rspec spec")
62
- } finally {
63
- publishTestResults()
64
- }
56
+ compose.exec('app', "bundle exec appraisal $railsVersion rake db:schema:load")
57
+ compose.exec('app', "bundle exec appraisal $railsVersion rspec spec")
65
58
  }
66
59
  }
67
60
 
@@ -74,10 +67,6 @@ def checkstyle(me.knapik.DockerCompose compose, String rubyVersion) {
74
67
  }
75
68
  }
76
69
 
77
- def publishTestResults() {
78
- step([$class: 'JUnitResultArchiver', testResults: 'spec/reports/*.xml,test/reports/*.xml'])
79
- }
80
-
81
70
  def publishStyleCheckResults() {
82
71
  step([$class: 'CheckStylePublisher', pattern: 'checkstyle.xml'])
83
72
  }
data/README.md CHANGED
@@ -39,21 +39,28 @@ You can modify NsSettingsUi variables in order to:
39
39
  * `NsSettingsUi.layout` - set a layout from your application
40
40
  * `NsSettingsUi.parent_controller` - choose a controller that NsSettingUi controllers will inherit from
41
41
 
42
+ ## Rails support
43
+ Rails 4.2 since ver 1.1, dropped in 1.5
44
+ Rails 5.0 since ver 1.2
45
+ Rails 5.2 since ver 1.5
46
+ Rails 6.0 since ver 1.6
47
+
42
48
  ## Testing
43
- This engine is used by NTTR and socialguide. Upto version 1.1 it support Rails 3.2 and 4.2. Since version 1.2 it support Rails 4.2 and 5.0.
49
+ This engine is used by NTTR and socialguide.
50
+
44
51
  It uses [Appraisal](https://github.com/thoughtbot/appraisal) gem with a set up similar to [permitters gem](https://github.com/permitters/permitters) to give you an easy way of testing the code under multiple Rails versions.
45
52
 
46
53
  To bundle install for each appraisal defined:
47
54
 
48
- `appraisal install`
55
+ `bundle appraisal install`
49
56
 
50
57
  And then to run specs for all the appraisals:
51
58
 
52
- `appraisal bundle exec rspec spec`
59
+ `bundle exec appraisal rspec spec`
53
60
 
54
61
  Or a specific one:
55
62
 
56
- `appraisal rails_4.2 bundle exec rspec spec`
63
+ `bundle exec appraisal rails_5.0 rspec spec`
57
64
 
58
65
  ## Contributing
59
66
 
@@ -9,13 +9,9 @@
9
9
  form {
10
10
  display: inline;
11
11
  }
12
- input[type=text] {
12
+ input[type=text], select {
13
13
  width: 130px;
14
- display: inline;
15
- }
16
- table {
17
- td {
18
- padding: 2px;
19
- }
14
+ display: inline-block;
15
+ flex: none;
20
16
  }
21
17
  }
@@ -1,16 +1,14 @@
1
1
  module NsSettingsUi
2
2
  class SettingsController < NsSettingsUi::ApplicationController
3
3
  layout NsSettingsUi.layout
4
- before_filter :setting_from_id_param, only: [:update, :reset]
4
+ before_action :setting_from_id_param, only: [:update, :reset]
5
5
 
6
6
  def index
7
- @settings = Setting.order('`key`').all
7
+ @settings = Setting.order(Arel.sql('`key`')).all
8
8
  end
9
9
 
10
10
  def update
11
- @setting.value = params[:setting][:value]
12
- @setting.default_value = params[:setting][:default_value]
13
- @setting.save!
11
+ @setting.update!(setting_params)
14
12
  render partial: 'update'
15
13
  end
16
14
 
@@ -25,5 +23,9 @@ module NsSettingsUi
25
23
  def setting_from_id_param
26
24
  @setting = Setting.find(params[:id])
27
25
  end
26
+
27
+ def setting_params
28
+ params.require(:setting).permit(:value, :default_value)
29
+ end
28
30
  end
29
31
  end
@@ -18,9 +18,9 @@ module NsSettingsUi
18
18
 
19
19
  def render_field(form, value_type, name, additional_class = '')
20
20
  if [NsSettingsUi::Setting::TYPES[:boolean], NsSettingsUi::Setting::TYPES[:nullable_boolean]].include?(value_type)
21
- form.select(name, [[:true, 'true'], [:false, 'false']], include_blank: true)
21
+ form.select(name, [[:true, 'true'], [:false, 'false']], {include_blank: true}, {class: "form-select form-select-sm"})
22
22
  else
23
- form.text_field(name, size: 10, class: "form-control #{additional_class}")
23
+ form.text_field(name, size: 10, class: "form-control form-control-sm #{additional_class}")
24
24
  end
25
25
  end
26
26
 
@@ -1,6 +1,18 @@
1
- <tr>
2
- <td class="setting_key"><h5><%= setting.key -%></h5></td>
3
- <td>
4
- <%= render partial: 'edit', locals: {setting: setting} -%>
1
+ <tr id="setting_<%= setting.id -%>">
2
+ <td class="setting_key align-middle"><%= setting.key -%></td>
3
+ <td class="text-center">
4
+ <%= form_for(setting, url: ns_settings_ui.setting_path(setting), method: :put, remote: true, html: {class: 'form-inline'}) do |f| %>
5
+ <%= render_default_value_field(f, setting) %>
6
+ <%= f.submit('Update', class: 'btn btn-sm btn-primary') %>
7
+ <% end %>
8
+ </td>
9
+ <td class="text-center">
10
+ <%= form_for(setting, url: ns_settings_ui.setting_path(setting), method: :put, remote: true, html: {class: 'form-inline'}) do |f| %>
11
+ <%= render_value_field(f, setting) %>
12
+ <%= f.submit('Update', class: 'btn btn-sm btn-primary') %>
13
+ <% end %>
14
+ <%= form_for(setting, url: ns_settings_ui.reset_setting_path(setting), method: :put, remote: true) do |f| %>
15
+ <%= f.submit('Reset', class: 'btn btn-sm btn-warning', title: 'Reset to default') %>
16
+ <% end %>
5
17
  </td>
6
18
  </tr>
@@ -1,3 +1,2 @@
1
- $("#ns_settings_ui #setting_<%= @setting.id -%>").replaceWith("<%= escape_javascript(render partial: 'edit', locals: {setting: @setting}) %>");
2
- $("#ns_settings_ui #setting_<%= @setting.id -%>").append('<span class="notice text-success">Updated</span>');
3
- $("#ns_settings_ui #setting_<%= @setting.id -%> .notice").delay(1000).fadeOut('slow');
1
+ $("#ns_settings_ui #setting_<%= @setting.id -%>").replaceWith("<%= escape_javascript(render partial: 'setting_row', locals: {setting: @setting}) %>");
2
+ $("#ns_settings_ui #setting_<%= @setting.id -%>").effect("highlight", {color: '#70ca63'}, 3000);
@@ -3,14 +3,23 @@
3
3
  <%= javascript_include_tag 'ns_settings_ui/application' -%>
4
4
  <% end %>
5
5
  <div id="ns_settings_ui">
6
- <div class="panel panel-default">
7
- <div class="panel-heading">
8
- <span>Filter: </span>
9
- <input class="form-control" id="filter-input" type="text" value=""> (regular expressions are available)
10
- </div>
11
- <div class="panel-body">
12
- <table class="table table-striped table-bordered">
13
- <%= render partial: 'setting_row', collection: @settings, as: 'setting' -%>
6
+ <h1 class="text-white ps-1">Settings</h1>
7
+ <div class="card">
8
+ <div class="card-body">
9
+ <div class="input-group input-group-sm mb-2">
10
+ <span class="input-group-text">Filter: </span>
11
+ <input class="form-control form-control-sm" id="filter-input" type="text" value="">
12
+ <span class="form-text ms-2">(regular expressions are available)</span>
13
+ </div>
14
+ <table class="table table-sm table-striped">
15
+ <thead>
16
+ <th>Setting key</th>
17
+ <th class="text-center">Default value</th>
18
+ <th class="text-center">Current value</th>
19
+ </thead>
20
+ <tbody>
21
+ <%= render partial: 'setting_row', collection: @settings, as: 'setting' -%>
22
+ </tbody>
14
23
  </table>
15
24
  </div>
16
25
  </div>
@@ -1,4 +1,4 @@
1
- class CreateNsSettingsUiSettings < ActiveRecord::Migration
1
+ class CreateNsSettingsUiSettings < ActiveRecord::Migration[4.2]
2
2
  def up
3
3
  create_table :ns_settings_ui_settings do |t|
4
4
  t.string :key, null: false
@@ -1,4 +1,4 @@
1
- class AddValueTypeToNsSettingsUiSettings < ActiveRecord::Migration
1
+ class AddValueTypeToNsSettingsUiSettings < ActiveRecord::Migration[4.2]
2
2
  def change
3
3
  add_column :ns_settings_ui_settings, :value_type, :integer, default: 0
4
4
  end
@@ -1,5 +1,5 @@
1
- FROM ruby:2.3
2
- MAINTAINER Michał Knapik <michal.knapik@u2i.com>
1
+ FROM ruby:2.5
2
+ MAINTAINER u2i <hello@u2i.com>
3
3
 
4
4
  RUN wget --quiet --output-document=dumb-init.deb \
5
5
  https://github.com/Yelp/dumb-init/releases/download/v1.1.3/dumb-init_1.1.3_amd64.deb && \
@@ -1,5 +1,5 @@
1
- FROM ruby:2.1
2
- MAINTAINER Michał Knapik <michal.knapik@u2i.com>
1
+ FROM ruby:2.6
2
+ MAINTAINER u2i <hello@u2i.com>
3
3
 
4
4
  RUN wget --quiet --output-document=dumb-init.deb \
5
5
  https://github.com/Yelp/dumb-init/releases/download/v1.1.3/dumb-init_1.1.3_amd64.deb && \
@@ -3,7 +3,7 @@
3
3
  source "https://rubygems.org"
4
4
 
5
5
  gem "rails", "~> 5.0.0"
6
- gem "rails-controller-testing"
7
- gem "sass"
6
+ gem "sprockets", "~> 3.7.2"
7
+ gem "sqlite3", "~> 1.3.0"
8
8
 
9
- gemspec :path => "../"
9
+ gemspec path: "../"
@@ -0,0 +1,9 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "rails", "~> 5.1.0"
6
+ gem "sprockets", "~> 3.7.2"
7
+ gem "sqlite3", "~> 1.3.0"
8
+
9
+ gemspec path: "../"
@@ -0,0 +1,9 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "rails", "~> 5.2.0"
6
+ gem "sprockets", "~> 3.7.2"
7
+ gem "sqlite3", "~> 1.3.0"
8
+
9
+ gemspec path: "../"
@@ -0,0 +1,9 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "rails", "~> 6.0.3"
6
+ gem "sprockets", "~> 3.7.2"
7
+ gem "sqlite3", "~> 1.4.0"
8
+
9
+ gemspec path: "../"
@@ -1,3 +1,3 @@
1
1
  module NsSettingsUi
2
- VERSION = '1.4.0'.freeze
2
+ VERSION = '1.6.0'.freeze
3
3
  end
@@ -18,26 +18,25 @@ Gem::Specification.new do |s|
18
18
  s.files = `git ls-files -z`.split("\x0")
19
19
  s.test_files = Dir['spec/**/*']
20
20
 
21
- s.add_dependency 'rails', '>= 4.2', '< 6'
21
+ s.add_dependency 'rails', '>= 5.0', '< 6.1'
22
22
 
23
- s.add_development_dependency 'appraisal', '~> 2.1'
23
+ s.add_development_dependency 'appraisal', '~> 2.3'
24
24
  s.add_development_dependency 'sqlite3', '~> 1.3'
25
25
  s.add_development_dependency 'rspec', '~> 3.4'
26
- s.add_development_dependency 'rspec-rails', '~> 3.4'
26
+ s.add_development_dependency 'rspec-rails', '~> 4.0'
27
27
  s.add_development_dependency 'rspec-its', '~> 1.2'
28
- s.add_development_dependency 'machinist', '~> 2.0'
29
28
  s.add_development_dependency 'database_cleaner', '~> 1.5'
30
29
  s.add_development_dependency 'u2i-ci_utils', '~> 2.0'
31
- s.add_development_dependency 'bundler', '~> 1.5'
32
- s.add_development_dependency 'rake', '~> 11.1'
30
+ s.add_development_dependency 'bundler', '> 1.17'
31
+ s.add_development_dependency 'rake', '~> 12.3.3'
33
32
  s.add_development_dependency 'test-unit', '~> 3.1'
34
33
  s.add_development_dependency 'rubocop-rspec', '~> 1.4.0'
35
34
  s.add_development_dependency 'sass', '~> 3.4'
35
+ s.add_development_dependency 'rails-controller-testing'
36
36
 
37
37
  s.add_development_dependency 'guard', '~> 2.13'
38
38
  s.add_development_dependency 'guard-rspec', '~> 4.6'
39
39
  s.add_development_dependency 'guard-rubocop', '~> 1.2'
40
40
  s.add_development_dependency 'ruby_dep', '~> 1.3.1'
41
41
  s.add_development_dependency 'listen', '~> 3.0.0'
42
- s.add_development_dependency 'pry-byebug', '~> 3.4.2'
43
42
  end
@@ -3,8 +3,13 @@ require 'spec_helper'
3
3
  RSpec.describe NsSettingsUi::SettingsController, type: :controller do
4
4
  routes { NsSettingsUi::Engine.routes }
5
5
 
6
+ def sample_setting(value: 0, default_value: 0)
7
+ key = Array('aa'..'zz').sample(2).join('.')
8
+ NsSettingsUi::Setting.create(key: key, value: value, default_value: default_value)
9
+ end
10
+
6
11
  describe 'GET index' do
7
- let!(:settings) { Array.new(8) { NsSettingsUi::Setting.make! }.sort_by(&:key) }
12
+ let!(:settings) { Array.new(8) { sample_setting }.sort_by(&:key) }
8
13
  subject { get :index }
9
14
 
10
15
  it 'assigns all settings' do
@@ -14,7 +19,7 @@ RSpec.describe NsSettingsUi::SettingsController, type: :controller do
14
19
 
15
20
  context 'with views' do
16
21
  render_views
17
- it { is_expected.to be_success }
22
+ it { is_expected.to be_successful }
18
23
  end
19
24
  end
20
25
 
@@ -24,7 +29,7 @@ RSpec.describe NsSettingsUi::SettingsController, type: :controller do
24
29
  end
25
30
 
26
31
  it 'responds with 200' do
27
- expect(response).to be_success
32
+ expect(response).to be_successful
28
33
  end
29
34
 
30
35
  it 'sets flash message' do
@@ -33,9 +38,10 @@ RSpec.describe NsSettingsUi::SettingsController, type: :controller do
33
38
  end
34
39
 
35
40
  describe 'PUT reset' do
36
- let(:setting) { NsSettingsUi::Setting.make!(value: 'a', default_value: 'b') }
41
+ let(:setting) { sample_setting(value: 'a', default_value: 'b') }
42
+ let(:params) { {id: setting.id, format: :js} }
37
43
 
38
- before { get :reset, id: setting.id, format: :js }
44
+ before { get :reset, params: params }
39
45
 
40
46
  it 'resets setting value to the default value' do
41
47
  expect(assigns(:setting).value).to eq(setting.default_value)
@@ -45,17 +51,19 @@ RSpec.describe NsSettingsUi::SettingsController, type: :controller do
45
51
  end
46
52
 
47
53
  describe 'PUT update' do
48
- let(:setting) { NsSettingsUi::Setting.make! }
49
- let(:params) { {value: '5', default_value: '6', key: 'matching.cluster_size'} }
54
+ let(:setting) { sample_setting }
55
+ let(:setting_params) { {value: '5', default_value: '6', key: 'matching.cluster_size'} }
56
+ let(:params) { {id: setting.id, setting: setting_params, format: :js} }
57
+
50
58
 
51
- before { put :update, id: setting.id, setting: params, format: :js }
59
+ before { put :update, params: params }
52
60
 
53
61
  it 'updates value' do
54
- expect(assigns(:setting).value).to eq(params[:value])
62
+ expect(assigns(:setting).value).to eq(setting_params[:value])
55
63
  end
56
64
 
57
65
  it 'updates default value' do
58
- expect(assigns(:setting).default_value).to eq(params[:default_value])
66
+ expect(assigns(:setting).default_value).to eq(setting_params[:default_value])
59
67
  end
60
68
 
61
69
  it 'does not update key' do
Binary file
@@ -1,4 +1,3 @@
1
- # encoding: UTF-8
2
1
  # This file is auto-generated from the current state of the database. Instead
3
2
  # of editing this file, please use the migrations feature of Active Record to
4
3
  # incrementally modify your database, and then regenerate this schema definition.
@@ -9,17 +8,18 @@
9
8
  # from scratch. The latter is a flawed and unsustainable approach (the more migrations
10
9
  # you'll amass, the slower it'll run and the greater likelihood for issues).
11
10
  #
12
- # It's strongly recommended to check this file into your version control system.
11
+ # It's strongly recommended that you check this file into your version control system.
13
12
 
14
- ActiveRecord::Schema.define(version: 20151215081718) do
15
- create_table 'ns_settings_ui_settings', force: true do |t|
16
- t.string 'key', null: false
17
- t.string 'value'
18
- t.string 'default_value'
19
- t.datetime 'created_at', null: false
20
- t.datetime 'updated_at', null: false
21
- t.integer 'value_type', default: 0
13
+ ActiveRecord::Schema.define(version: 2015_12_15_081718) do
14
+
15
+ create_table "ns_settings_ui_settings", force: :cascade do |t|
16
+ t.string "key", null: false
17
+ t.string "value"
18
+ t.string "default_value"
19
+ t.datetime "created_at"
20
+ t.datetime "updated_at"
21
+ t.integer "value_type", default: 0
22
+ t.index ["key"], name: "index_ns_settings_ui_settings_on_key"
22
23
  end
23
24
 
24
- add_index 'ns_settings_ui_settings', ['key'], name: 'index_ns_settings_ui_settings_on_key'
25
25
  end