cucumber-rails 1.6.0 → 2.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (236) hide show
  1. checksums.yaml +5 -5
  2. data/Appraisals +18 -88
  3. data/CHANGELOG.md +208 -14
  4. data/CONTRIBUTING.md +27 -24
  5. data/Gemfile +2 -4
  6. data/LICENSE +1 -1
  7. data/README.md +45 -31
  8. data/Rakefile +17 -13
  9. data/bin/install_geckodriver.sh +19 -0
  10. data/bin/install_webpacker.sh +9 -0
  11. data/config/cucumber.yml +0 -3
  12. data/cucumber-rails.gemspec +40 -33
  13. data/dev_tasks/cucumber.rake +2 -0
  14. data/dev_tasks/rspec.rake +2 -0
  15. data/dev_tasks/yard.rake +7 -14
  16. data/dev_tasks/yard/default/layout/html/setup.rb +6 -1
  17. data/features/allow_rescue.feature +16 -11
  18. data/features/annotations.feature +8 -11
  19. data/features/capybara_javascript_drivers.feature +90 -31
  20. data/features/choose_javascript_database_strategy.feature +36 -56
  21. data/features/configuration.feature +48 -0
  22. data/features/database_cleaner.feature +103 -16
  23. data/features/disable_automatic_database_cleaning.feature +10 -16
  24. data/features/emulate_javascript.feature +59 -44
  25. data/features/install_cucumber_rails.feature +4 -4
  26. data/features/no_database.feature +6 -6
  27. data/features/raising_errors.feature +9 -3
  28. data/features/rerun_profile.feature +5 -4
  29. data/features/rest_api.feature +11 -11
  30. data/features/step_definitions/cucumber_rails_steps.rb +43 -100
  31. data/features/support/aruba.rb +3 -1
  32. data/features/support/cucumber_rails_helper.rb +86 -0
  33. data/features/support/env.rb +4 -38
  34. data/features/support/hooks.rb +8 -0
  35. data/gemfiles/rails_5_0.gemfile +4 -12
  36. data/gemfiles/rails_5_1.gemfile +3 -10
  37. data/gemfiles/rails_5_2.gemfile +2 -10
  38. data/gemfiles/rails_6_0.gemfile +8 -0
  39. data/lib/cucumber/rails.rb +23 -17
  40. data/lib/cucumber/rails/action_dispatch.rb +21 -0
  41. data/lib/cucumber/rails/application.rb +16 -7
  42. data/lib/cucumber/rails/capybara.rb +2 -0
  43. data/lib/cucumber/rails/capybara/javascript_emulation.rb +43 -35
  44. data/lib/cucumber/rails/capybara/select_dates_and_times.rb +3 -1
  45. data/lib/cucumber/rails/database.rb +24 -56
  46. data/lib/cucumber/rails/database/deletion_strategy.rb +11 -0
  47. data/lib/cucumber/rails/database/shared_connection_strategy.rb +25 -0
  48. data/lib/cucumber/rails/database/strategy.rb +31 -0
  49. data/lib/cucumber/rails/database/truncation_strategy.rb +11 -0
  50. data/lib/cucumber/rails/hooks.rb +2 -0
  51. data/lib/cucumber/rails/hooks/active_record.rb +8 -4
  52. data/lib/cucumber/rails/hooks/allow_rescue.rb +2 -0
  53. data/lib/cucumber/rails/hooks/database_cleaner.rb +11 -3
  54. data/lib/cucumber/rails/hooks/mail.rb +3 -1
  55. data/lib/cucumber/rails/rspec.rb +3 -1
  56. data/lib/cucumber/rails/world.rb +24 -7
  57. data/lib/generators/cucumber/{install/USAGE → USAGE} +0 -0
  58. data/lib/generators/cucumber/{install/install_generator.rb → install_generator.rb} +23 -10
  59. data/lib/generators/cucumber/{install/templates → templates}/config/cucumber.yml.erb +0 -0
  60. data/lib/generators/cucumber/{install/templates → templates}/script/cucumber +1 -0
  61. data/lib/generators/cucumber/{install/templates → templates}/support/_rails_each_run.rb.erb +0 -0
  62. data/lib/generators/cucumber/{install/templates → templates}/support/_rails_prefork.rb.erb +0 -0
  63. data/lib/generators/cucumber/{install/templates → templates}/support/capybara.rb +2 -0
  64. data/lib/generators/cucumber/{install/templates → templates}/support/edit_warning.txt +0 -0
  65. data/lib/generators/cucumber/{install/templates → templates}/support/rails.rb.erb +0 -0
  66. data/lib/generators/cucumber/{install/templates → templates}/support/rails_spork.rb.erb +0 -0
  67. data/lib/generators/cucumber/{install/templates → templates}/tasks/cucumber.rake.erb +0 -0
  68. data/spec/cucumber/rails/database_spec.rb +50 -33
  69. data/spec/examples.txt +19 -0
  70. data/spec/generators/cucumber/{install/install_generator_spec.rb → install_generator_spec.rb} +16 -8
  71. data/spec/spec_helper.rb +4 -2
  72. data/tmp/aruba/test_app/Gemfile +62 -0
  73. data/tmp/aruba/test_app/Gemfile.lock +249 -0
  74. data/tmp/aruba/test_app/README.md +24 -0
  75. data/tmp/aruba/test_app/Rakefile +6 -0
  76. data/tmp/aruba/test_app/app/assets/config/manifest.js +3 -0
  77. data/tmp/aruba/test_app/app/assets/javascripts/application.js +16 -0
  78. data/tmp/aruba/test_app/app/assets/javascripts/appointments.coffee +3 -0
  79. data/tmp/aruba/test_app/app/assets/javascripts/cable.js +13 -0
  80. data/tmp/aruba/test_app/app/assets/stylesheets/application.css +15 -0
  81. data/tmp/aruba/test_app/app/assets/stylesheets/appointments.scss +3 -0
  82. data/tmp/aruba/test_app/app/assets/stylesheets/scaffolds.scss +84 -0
  83. data/tmp/aruba/test_app/app/channels/application_cable/channel.rb +4 -0
  84. data/tmp/aruba/test_app/app/channels/application_cable/connection.rb +4 -0
  85. data/tmp/aruba/test_app/app/controllers/application_controller.rb +2 -0
  86. data/tmp/aruba/test_app/app/controllers/appointments_controller.rb +74 -0
  87. data/tmp/aruba/test_app/app/helpers/application_helper.rb +2 -0
  88. data/tmp/aruba/test_app/app/helpers/appointments_helper.rb +2 -0
  89. data/tmp/aruba/test_app/app/jobs/application_job.rb +2 -0
  90. data/tmp/aruba/test_app/app/mailers/application_mailer.rb +4 -0
  91. data/tmp/aruba/test_app/app/models/application_record.rb +3 -0
  92. data/tmp/aruba/test_app/app/models/appointment.rb +2 -0
  93. data/tmp/aruba/test_app/app/views/appointments/_appointment.json.jbuilder +2 -0
  94. data/tmp/aruba/test_app/app/views/appointments/_form.html.erb +27 -0
  95. data/tmp/aruba/test_app/app/views/appointments/edit.html.erb +6 -0
  96. data/tmp/aruba/test_app/app/views/appointments/index.html.erb +29 -0
  97. data/tmp/aruba/test_app/app/views/appointments/index.json.jbuilder +1 -0
  98. data/tmp/aruba/test_app/app/views/appointments/new.html.erb +5 -0
  99. data/tmp/aruba/test_app/app/views/appointments/show.html.erb +14 -0
  100. data/tmp/aruba/test_app/app/views/appointments/show.json.jbuilder +1 -0
  101. data/tmp/aruba/test_app/app/views/layouts/application.html.erb +15 -0
  102. data/tmp/aruba/test_app/app/views/layouts/mailer.html.erb +13 -0
  103. data/tmp/aruba/test_app/app/views/layouts/mailer.text.erb +1 -0
  104. data/tmp/aruba/test_app/bin/bundle +3 -0
  105. data/tmp/aruba/test_app/bin/rails +4 -0
  106. data/tmp/aruba/test_app/bin/rake +4 -0
  107. data/tmp/aruba/test_app/bin/setup +36 -0
  108. data/tmp/aruba/test_app/bin/update +31 -0
  109. data/tmp/aruba/test_app/bin/yarn +11 -0
  110. data/tmp/aruba/test_app/config.ru +5 -0
  111. data/tmp/aruba/test_app/config/application.rb +19 -0
  112. data/tmp/aruba/test_app/config/boot.rb +3 -0
  113. data/tmp/aruba/test_app/config/cable.yml +10 -0
  114. data/tmp/aruba/test_app/config/credentials.yml.enc +1 -0
  115. data/tmp/aruba/test_app/config/cucumber.yml +9 -0
  116. data/tmp/aruba/test_app/config/database.yml +25 -0
  117. data/tmp/aruba/test_app/config/environment.rb +5 -0
  118. data/tmp/aruba/test_app/config/environments/development.rb +61 -0
  119. data/tmp/aruba/test_app/config/environments/production.rb +94 -0
  120. data/tmp/aruba/test_app/config/environments/test.rb +46 -0
  121. data/tmp/aruba/test_app/config/initializers/application_controller_renderer.rb +8 -0
  122. data/tmp/aruba/test_app/config/initializers/assets.rb +14 -0
  123. data/tmp/aruba/test_app/config/initializers/backtrace_silencers.rb +7 -0
  124. data/tmp/aruba/test_app/config/initializers/content_security_policy.rb +25 -0
  125. data/tmp/aruba/test_app/config/initializers/cookies_serializer.rb +5 -0
  126. data/tmp/aruba/test_app/config/initializers/filter_parameter_logging.rb +4 -0
  127. data/tmp/aruba/test_app/config/initializers/inflections.rb +16 -0
  128. data/tmp/aruba/test_app/config/initializers/mime_types.rb +4 -0
  129. data/tmp/aruba/test_app/config/initializers/wrap_parameters.rb +14 -0
  130. data/tmp/aruba/test_app/config/locales/en.yml +33 -0
  131. data/tmp/aruba/test_app/config/master.key +1 -0
  132. data/tmp/aruba/test_app/config/puma.rb +37 -0
  133. data/tmp/aruba/test_app/config/routes.rb +4 -0
  134. data/tmp/aruba/test_app/config/storage.yml +34 -0
  135. data/tmp/aruba/test_app/db/development.sqlite3 +0 -0
  136. data/tmp/aruba/test_app/db/migrate/20200821080656_create_appointments.rb +10 -0
  137. data/tmp/aruba/test_app/db/schema.rb +22 -0
  138. data/tmp/aruba/test_app/db/seeds.rb +7 -0
  139. data/tmp/aruba/test_app/db/test.sqlite3 +0 -0
  140. data/tmp/aruba/test_app/features/create_appointment.feature +9 -0
  141. data/tmp/aruba/test_app/features/create_appointment_steps.rb +19 -0
  142. data/tmp/aruba/test_app/features/support/env.rb +18 -0
  143. data/tmp/aruba/test_app/lib/tasks/cucumber.rake +76 -0
  144. data/tmp/aruba/test_app/log/development.log +27 -0
  145. data/tmp/aruba/test_app/log/test.log +38 -0
  146. data/tmp/aruba/test_app/package.json +5 -0
  147. data/tmp/aruba/test_app/public/404.html +67 -0
  148. data/tmp/aruba/test_app/public/422.html +67 -0
  149. data/tmp/aruba/test_app/public/500.html +66 -0
  150. data/tmp/aruba/test_app/public/apple-touch-icon-precomposed.png +0 -0
  151. data/tmp/aruba/test_app/public/apple-touch-icon.png +0 -0
  152. data/tmp/aruba/test_app/public/favicon.ico +0 -0
  153. data/tmp/aruba/test_app/public/robots.txt +1 -0
  154. data/tmp/aruba/test_app/script/cucumber +11 -0
  155. data/tmp/aruba/test_app/test/application_system_test_case.rb +5 -0
  156. data/tmp/aruba/test_app/test/controllers/appointments_controller_test.rb +48 -0
  157. data/tmp/aruba/test_app/test/fixtures/appointments.yml +9 -0
  158. data/tmp/aruba/test_app/test/models/appointment_test.rb +7 -0
  159. data/tmp/aruba/test_app/test/system/appointments_test.rb +45 -0
  160. data/tmp/aruba/test_app/test/test_helper.rb +10 -0
  161. data/tmp/aruba/test_app/tmp/cache/assets/sprockets/v3.0/0I/0I0oT83oN3NKiEi9XIhexiT3XgkA8mKyCbs25v3l20g.cache +1 -0
  162. data/tmp/aruba/test_app/tmp/cache/assets/sprockets/v3.0/0W/0WnFNEwHN4bhDiFTvyMWURx02L4yP3gkP7vtjzKQFVo.cache +1 -0
  163. data/tmp/aruba/test_app/tmp/cache/assets/sprockets/v3.0/2B/2Bg65dpvTdePrXa_wG6RsHpQzbqVSiHK0FVa0WdOJ4k.cache +0 -0
  164. data/tmp/aruba/test_app/tmp/cache/assets/sprockets/v3.0/2r/2r_85kVmIcWzvJH72GapWtLDhaMP2HEziNxykyYpAUg.cache +1 -0
  165. data/tmp/aruba/test_app/tmp/cache/assets/sprockets/v3.0/72/72jdZDzrM3-D_zYkIiPdAWQNeaFsqah154_QvcqWqTQ.cache +3 -0
  166. data/tmp/aruba/test_app/tmp/cache/assets/sprockets/v3.0/99/99m8UCKl4j8IpsVOK8ltLHyNh8Ae0nHw3GBkC34V_co.cache +2 -0
  167. data/tmp/aruba/test_app/tmp/cache/assets/sprockets/v3.0/9O/9OOXnKHBQnaCeE5HDe5csQsItouzWM6rTl8sESvkGTE.cache +1 -0
  168. data/tmp/aruba/test_app/tmp/cache/assets/sprockets/v3.0/AF/AFloQwm_M7GZudPY87xx4TA0xEeuX9Psl0SJ94i5EyU.cache +3 -0
  169. data/tmp/aruba/test_app/tmp/cache/assets/sprockets/v3.0/AP/APDAc8aUg_16wNWrVhCJcKeqbxyOScYGVhiDVgbrV7U.cache +0 -0
  170. data/tmp/aruba/test_app/tmp/cache/assets/sprockets/v3.0/B4/B43LeT9Wba4fLvXw-C_kKq-x9HwYZxnBBiltbIufzzQ.cache +2 -0
  171. data/tmp/aruba/test_app/tmp/cache/assets/sprockets/v3.0/EO/EOut5kyDPr7aKrHdvDsNJuYarA8XGnpAlDvBimlaC08.cache +0 -0
  172. data/tmp/aruba/test_app/tmp/cache/assets/sprockets/v3.0/GJ/GJzxuc2i_d4Uhxs4IMnbQXhxBc9CTLrnQyzxwTqKOBw.cache +0 -0
  173. data/tmp/aruba/test_app/tmp/cache/assets/sprockets/v3.0/Ge/Ge2oyaUStbQszLfXjgTi6LkncyS5SKfV8RJwbRA3HbI.cache +1 -0
  174. data/tmp/aruba/test_app/tmp/cache/assets/sprockets/v3.0/HC/HCDOUd7-S45aJ_PjVAC_Vmjyud3i1aQv4cE3t9_Z3Dw.cache +2 -0
  175. data/tmp/aruba/test_app/tmp/cache/assets/sprockets/v3.0/Hv/HvPd_vK17QbhWq8QnCuyhqm0cPaGnHyO9lSzN-icQdg.cache +2 -0
  176. data/tmp/aruba/test_app/tmp/cache/assets/sprockets/v3.0/II/IIhUO-5-DcfCyD_rVJeHjRMNVJxLmAmXP8i2XEjFpns.cache +1 -0
  177. data/tmp/aruba/test_app/tmp/cache/assets/sprockets/v3.0/Ka/KaLHRsUYc4EUxUr4q_UhArFJUTF_EaBklpeU4TsE9SY.cache +1 -0
  178. data/tmp/aruba/test_app/tmp/cache/assets/sprockets/v3.0/MZ/MZcwDENEs93Wd9q7A_7UWdfJrWsBXa0pGp03P9mqG2I.cache +3 -0
  179. data/tmp/aruba/test_app/tmp/cache/assets/sprockets/v3.0/Nw/NwHea3ImBECnlmojPb9X9ZDfvRRuX_dX9sxISdtp9-A.cache +0 -0
  180. data/tmp/aruba/test_app/tmp/cache/assets/sprockets/v3.0/PP/PPKuKT7m2PMDHVzBcYjePvXU6CbCW63Iqe3Q2a-Jdh8.cache +1 -0
  181. data/tmp/aruba/test_app/tmp/cache/assets/sprockets/v3.0/RE/REtgGrS74n4Y7OKRcGvZsA2EUClg_RM66mVgGpySI20.cache +1 -0
  182. data/tmp/aruba/test_app/tmp/cache/assets/sprockets/v3.0/Rk/RkQLRXSz5LhJQnH7BT-ZDkVK0Rx8N9KhcVwR2A1HY4M.cache +2 -0
  183. data/tmp/aruba/test_app/tmp/cache/assets/sprockets/v3.0/Sx/SxtNEQ-KKVBCTtsDD-xf4oJEIdBPIHkGktnLXvG-GRk.cache +1 -0
  184. data/tmp/aruba/test_app/tmp/cache/assets/sprockets/v3.0/TL/TLxLzqEAxKzTHH9EwSg5Lvcp3zgGuhjTjed121DSu9U.cache +0 -0
  185. data/tmp/aruba/test_app/tmp/cache/assets/sprockets/v3.0/U1/U1D7nCXYBD3VlPnXGs_6mRtlhs-Gvv_vvCUYlTf4Grw.cache +3 -0
  186. data/tmp/aruba/test_app/tmp/cache/assets/sprockets/v3.0/U6/U6pXyI-5haNcHRdsB-SoztzlXb98-256hFReXsL31J4.cache +2 -0
  187. data/tmp/aruba/test_app/tmp/cache/assets/sprockets/v3.0/UE/UEKUaC9O_XBO5acP8HnxcJ1dtNM_1C7MTofkTQvPgRA.cache +1 -0
  188. data/tmp/aruba/test_app/tmp/cache/assets/sprockets/v3.0/UV/UVcnI5bo-eQvULfmzeQUFVTDYEMF2cbAXpsOsh01XNY.cache +1 -0
  189. data/tmp/aruba/test_app/tmp/cache/assets/sprockets/v3.0/WK/WK8RpMP5qb9GRQTsTHAzlfo8t2nsTLU6B8CQAc4UfOU.cache +1 -0
  190. data/tmp/aruba/test_app/tmp/cache/assets/sprockets/v3.0/Xk/Xk8p9O39-syzKbpnoMRChld0TpoZFWlNIzeT5XKw2fQ.cache +0 -0
  191. data/tmp/aruba/test_app/tmp/cache/assets/sprockets/v3.0/Zv/ZvCEW2ZyS-k4cHH7Gd8P2nKFE9Uh1VOrfR-1PYY2yz8.cache +5 -0
  192. data/tmp/aruba/test_app/tmp/cache/assets/sprockets/v3.0/ac/acWu1-1ZAW1jRVKlHYlzlEg28lk-SdHfTq-P-viJMS0.cache +1 -0
  193. data/tmp/aruba/test_app/tmp/cache/assets/sprockets/v3.0/b3/b3NiYrQOlN2zxiJYqbl4gmvK6it3Md9gSzAYgsIMhnY.cache +1 -0
  194. data/tmp/aruba/test_app/tmp/cache/assets/sprockets/v3.0/c1/c1Pm-rFPEB3LXIjOtswD6x8SEAgI9y2BR16jc8ifcsc.cache +1 -0
  195. data/tmp/aruba/test_app/tmp/cache/assets/sprockets/v3.0/em/emTQG2a9zF8NuvElLOnEpNJp0wq3_gVSDAM60vyXAzE.cache +0 -0
  196. data/tmp/aruba/test_app/tmp/cache/assets/sprockets/v3.0/fX/fXH3Db_88TmJFhRydoFTx8tZbHAkLzK2ZZ0lsBEg8xA.cache +0 -0
  197. data/tmp/aruba/test_app/tmp/cache/assets/sprockets/v3.0/gI/gIHntmCf7DbObPL_KZJYSgduAmqX18ZZPOtq85pn8vo.cache +0 -0
  198. data/tmp/aruba/test_app/tmp/cache/assets/sprockets/v3.0/kP/kPwbLAUCLjv0x6fe5lvZpmUkgmvQSDHSdEOSdbMyDgY.cache +0 -0
  199. data/tmp/aruba/test_app/tmp/cache/assets/sprockets/v3.0/kT/kT98Z_slHI6SgdEmoAtKAHyJQjTHdbe6GAbB27RP2uI.cache +1 -0
  200. data/tmp/aruba/test_app/tmp/cache/assets/sprockets/v3.0/mt/mtT4Rwi7H_vHQXdxxPvvzhL4ziA7X9WK-JXzacxWlEA.cache +0 -0
  201. data/tmp/aruba/test_app/tmp/cache/assets/sprockets/v3.0/mz/mzgD6X_N-fO95dP8Q1Q1sApCrbSmgPgsuEKv65KYcdo.cache +3 -0
  202. data/tmp/aruba/test_app/tmp/cache/assets/sprockets/v3.0/oi/oiPhXw8pYdWv5T4qRFzePHaXZLI50xMvvTyfry-ILSo.cache +1 -0
  203. data/tmp/aruba/test_app/tmp/cache/assets/sprockets/v3.0/r-/r--YB1ugrZ4F-ogbLLYNwIH3j9pQ2u_ZBjTJxoS7TrM.cache +1 -0
  204. data/tmp/aruba/test_app/tmp/cache/assets/sprockets/v3.0/s6/s68UIyg0lNko7IA42JXv_wwy9Ea3WH-zc9h0GYPg88Y.cache +1 -0
  205. data/tmp/aruba/test_app/tmp/cache/assets/sprockets/v3.0/si/siT97rfEKbIWcCj6KUBChX7kpRBKI2fAeGGwpsz0tTU.cache +0 -0
  206. data/tmp/aruba/test_app/tmp/cache/assets/sprockets/v3.0/st/stqDgDfAemfEq7ZxlEj6YThpn8_1Nfw2bRVA0N03YTw.cache +1 -0
  207. data/tmp/aruba/test_app/tmp/cache/assets/sprockets/v3.0/t9/t93lpjyly3MvgKs51_OlLXneJXGyYFGmshXsk4Wr69M.cache +1 -0
  208. data/tmp/aruba/test_app/tmp/cache/assets/sprockets/v3.0/tE/tEy2QePsDnmFyyAQEric23sSBnfHBst3SEM7p-J7el8.cache +2 -0
  209. data/tmp/aruba/test_app/tmp/cache/assets/sprockets/v3.0/tR/tRV7SyAY9c71G0o-8bElvNI76KcWhc5NVm48xflMPpM.cache +0 -0
  210. data/tmp/aruba/test_app/tmp/cache/assets/sprockets/v3.0/tg/tggwa2O6A41xeZTK4SR0qcX0X55aOGg6q8ZWfqma1vM.cache +0 -0
  211. data/tmp/aruba/test_app/tmp/cache/assets/sprockets/v3.0/uB/uBKOYcdzL_6Amevsu-uKAMTg7QGW5kgC0t5sAZINrcI.cache +0 -0
  212. data/tmp/aruba/test_app/tmp/cache/assets/sprockets/v3.0/uE/uEyPXY2m04nerJV0pn3p-B-BlkJ08oufpQH1G2QXPw4.cache +1 -0
  213. data/tmp/aruba/test_app/tmp/cache/assets/sprockets/v3.0/up/upyndqsU9bU6WV8qyMy7MLpcQoybRqgj-qA3C3pjzXY.cache +0 -0
  214. data/tmp/aruba/test_app/tmp/cache/assets/sprockets/v3.0/ux/uxx-W2TOCdnAEGX0ZLThb_QIEbLYutX8qCwD0glYCKE.cache +3 -0
  215. data/tmp/aruba/test_app/tmp/cache/assets/sprockets/v3.0/vC/vCsc-q2WmT8vWM2d2pb6_5hFav8mGlylwEKVWQvsumo.cache +1 -0
  216. data/tmp/aruba/test_app/tmp/cache/assets/sprockets/v3.0/vc/vcgiILg1wO98x-a4kX678ASAFWA1cL0iVx07VkHLPqA.cache +0 -0
  217. data/tmp/aruba/test_app/tmp/cache/assets/sprockets/v3.0/vu/vu6xNIGT6zorPmcKfd7edgxBltTmIRXU281uyK51kkU.cache +1 -0
  218. data/tmp/aruba/test_app/tmp/cache/assets/sprockets/v3.0/w4/w4y_Lms54hD2Nivh5PHeccAmh2DX53sc_HDTQYNyNXw.cache +3 -0
  219. data/tmp/aruba/test_app/tmp/cache/assets/sprockets/v3.0/yZ/yZpoD5Zf4RAQoOwi5kMVksuta_0KhYSK_Yy_6Ykyt7E.cache +1 -0
  220. data/tmp/aruba/test_app/tmp/development_secret.txt +1 -0
  221. metadata +262 -158
  222. data/.github/ISSUE_TEMPLATE.md +0 -52
  223. data/.github/PULL_REQUEST_TEMPLATE.md +0 -42
  224. data/.gitignore +0 -12
  225. data/.rspec +0 -1
  226. data/.travis.yml +0 -43
  227. data/Gemfile.appraisal +0 -3
  228. data/config/.gitignore +0 -1
  229. data/features/support/bundler_pre_support.rb +0 -28
  230. data/features/support/fixtures/bundler-1.0.21.gem +0 -0
  231. data/features/support/fixtures/bundler-1.1.rc.gem +0 -0
  232. data/features/support/legacy_web_steps_support.rb +0 -289
  233. data/gemfiles/rails_4_0.gemfile +0 -22
  234. data/gemfiles/rails_4_1.gemfile +0 -20
  235. data/gemfiles/rails_4_2.gemfile +0 -19
  236. data/lib/cucumber/rails/action_controller.rb +0 -12
@@ -1,14 +1,15 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'yard'
2
4
  require 'yard/rake/yardoc_task'
3
5
 
4
- SITE_DIR = File.expand_path(File.dirname(__FILE__) + '/../cucumber.github.com')
6
+ SITE_DIR = File.expand_path("#{File.dirname(__FILE__)}/../cucumber.github.com")
5
7
  API_DIR = File.join(SITE_DIR, 'api', 'cucumber-rails', 'ruby', 'yardoc')
6
8
 
7
9
  namespace :api do
8
10
  file :dir do
9
- unless File.directory?(SITE_DIR)
10
- raise "You need to git clone git@github.com:cucumber/cucumber.github.com.git #{SITE_DIR}"
11
- end
11
+ raise "You need to git clone git@github.com:cucumber/cucumber.github.com.git #{SITE_DIR}" unless File.directory?(SITE_DIR)
12
+
12
13
  sh('git pull origin master')
13
14
  mkdir_p API_DIR
14
15
  end
@@ -18,18 +19,10 @@ namespace :api do
18
19
  YARD::Rake::YardocTask.new(:yard) do |yard|
19
20
  dir = API_DIR
20
21
  mkdir_p dir
21
- yard.options = ["--out", dir]
22
+ yard.options = ['--out', dir]
22
23
  end
23
24
  task yard: :dir
24
25
 
25
- task :release do
26
- Dir.chdir(SITE_DIR) do
27
- sh('git add .')
28
- sh("git commit -m 'Update API docs for cucumber-rails v#{cucumber-rails::VERSION}'")
29
- sh('git push origin master')
30
- end
31
- end
32
-
33
26
  desc "Generate YARD docs for Cucumber-Rails' API"
34
- task doc: [:yard, :release]
27
+ task doc: :yard
35
28
  end
@@ -1,4 +1,9 @@
1
+ # frozen_string_literal: true
2
+
1
3
  def init
2
4
  super
3
- options[:serializer].serialize('/images/bubble_32x32.png', IO.read(File.dirname(__FILE__) + '/bubble_32x32.png'))
5
+ options[:serializer].serialize(
6
+ '/images/bubble_32x32.png',
7
+ IO.read("#{File.dirname(__FILE__)}/bubble_32x32.png")
8
+ )
4
9
  end
@@ -1,54 +1,59 @@
1
1
  Feature: Allow Cucumber to rescue exceptions
2
2
 
3
3
  Background: A controller that raises an exception
4
- Given I have created a new Rails app "rails-3-app" and installed cucumber-rails
5
- And I write to "app/controllers/posts_controller.rb" with:
4
+ Given I have created a new Rails app and installed cucumber-rails
5
+ When I write to "app/controllers/posts_controller.rb" with:
6
6
  """
7
7
  class PostsController < ApplicationController
8
8
  def index
9
- raise "There is an error in index"
9
+ raise 'There is an error in index'
10
10
  end
11
11
  end
12
12
  """
13
13
  And I write to "config/routes.rb" with:
14
14
  """
15
- Rails3App::Application.routes.draw do
15
+ TestApp::Application.routes.draw do
16
16
  resources :posts
17
17
  end
18
18
  """
19
19
 
20
20
  Scenario: Allow rescue
21
- Given I write to "features/posts.feature" with:
21
+ When I write to "features/posts.feature" with:
22
22
  """
23
- Feature: posts
23
+ Feature: Posts
24
24
  @allow-rescue
25
25
  Scenario: See posts
26
26
  When I look at the posts
27
+ Then I should see the public error page
27
28
  """
28
29
  And I write to "features/step_definitions/posts_steps.rb" with:
29
30
  """
30
- When /^I look at the posts$/ do
31
+ When('I look at the posts') do
31
32
  visit '/posts'
32
33
  end
34
+
35
+ Then('I should see the public error page') do
36
+ expect(page).to have_content "We're sorry, but something went wrong."
37
+ end
33
38
  """
34
39
  And I run `bundle exec rake db:migrate`
35
40
  And I run `bundle exec cucumber`
36
41
  Then the feature run should pass with:
37
42
  """
38
43
  1 scenario (1 passed)
39
- 1 step (1 passed)
44
+ 2 steps (2 passed)
40
45
  """
41
46
 
42
47
  Scenario: Don't allow rescue
43
- Given I write to "features/posts.feature" with:
48
+ When I write to "features/posts.feature" with:
44
49
  """
45
- Feature: posts
50
+ Feature: Posts
46
51
  Scenario: See them
47
52
  When I look at the posts
48
53
  """
49
54
  And I write to "features/step_definitions/posts_steps.rb" with:
50
55
  """
51
- When /^I look at the posts$/ do
56
+ When('I look at the posts') do
52
57
  visit '/posts'
53
58
  end
54
59
  """
@@ -1,23 +1,20 @@
1
- @requires-rails-version-42
2
1
  Feature: Annotations
3
2
 
4
- I order to track my development progress
3
+ In order to track my development progress
5
4
  As a developer
6
5
  I should be able to list annotations in my features
7
6
 
8
- Background:
9
- Given I have created a new Rails app "test-app" with no database and installed cucumber-rails
10
- And I write to "features/tests.feature" with:
7
+ Scenario: See annotations in feature file
8
+ Given I have created a new Rails app with no database and installed cucumber-rails
9
+ When I write to "features/products.feature" with:
11
10
  """
12
- Feature: Tests
13
- Scenario: Tests
11
+ Feature: Products
12
+ Scenario: Test a Product
14
13
  # TODO: When I go to the products page
15
14
  """
16
-
17
- Scenario: See annotations in .feature file
18
15
  When I run `bundle exec rake notes`
19
16
  Then it should pass with:
20
17
  """
21
- features/tests.feature:
22
- * [ 3] [TODO] When I go to the products page
18
+ features/products.feature:
19
+ * [3] [TODO] When I go to the products page
23
20
  """
@@ -1,40 +1,44 @@
1
- @focus
2
1
  Feature: Capybara Javascript Drivers
3
2
 
4
- Background: A simple calendar app
3
+ Scenario: Use a particular driver
5
4
  Given I have created a new Rails app and installed cucumber-rails
6
5
  And I force selenium to run Firefox in headless mode
7
- And I run `bundle exec rails g scaffold appointment name:string when:datetime`
8
- And I write to "features/step_definitions/date_time_steps.rb" with:
9
- """
10
- When /^(?:|I )select "([^"]+)" as the "([^"]+)" time$/ do |time, selector|
11
- select_time(time, from: selector)
12
- end
13
-
14
- When /^(?:|I )select "([^"]+)" as the "([^"]+)" date$/ do |date, selector|
15
- select_date(date, from: selector)
16
- end
17
-
18
- When /^(?:|I )select "([^"]+)" as the "([^"]+)" date and time$/ do |datetime, selector|
19
- select_datetime(datetime, from: selector)
20
- end
21
- """
22
-
23
- Scenario: Use a particular driver
24
- Given I write to "features/create_appointment.feature" with:
6
+ When I run `bundle exec rails g scaffold appointment name:string when:datetime`
7
+ And I write to "features/create_appointment.feature" with:
25
8
  """
26
9
  @javascript
27
10
  Feature: Create appointments
28
- Scenario: Constitution on May 17
11
+ Scenario: Visit the Constitution on May 17
29
12
  Given I am on the new appointment page
30
13
  And I fill in "Norway's constitution" for "Name"
31
14
  And I select "2015-02-20 15:10:00 UTC" as the "When" date and time
32
15
  And I press "Create Appointment"
33
16
  Then I should see "Norway's constitution"
34
17
  And I should see "2015-02-20 15:10:00 UTC"
18
+ """
19
+ And I write to "features/create_appointment_steps.rb" with:
20
+ """
21
+ Given('I am on the new appointment page') do
22
+ visit new_appointment_path
23
+ end
24
+
25
+ When('I fill in {string} for {string}') do |value, field|
26
+ fill_in(field, with: value)
27
+ end
28
+
29
+ When('I press {string}') do |button|
30
+ click_button(button)
31
+ end
32
+
33
+ Then('I should see {string}') do |text|
34
+ expect(page).to have_content(text)
35
+ end
35
36
 
37
+ When('I select {string} as the {string} date and time') do |datetime, selector|
38
+ select_datetime(datetime, from: selector)
39
+ end
36
40
  """
37
- When I run `bundle exec rake db:migrate`
41
+ And I run `bundle exec rake db:migrate`
38
42
  And I run `bundle exec rake cucumber`
39
43
  Then the feature run should pass with:
40
44
  """
@@ -43,31 +47,86 @@ Feature: Capybara Javascript Drivers
43
47
  """
44
48
 
45
49
  Scenario: Mixed DB access
46
- Given I write to "features/create_appointment.feature" with:
50
+ Given I have created a new Rails app and installed cucumber-rails
51
+ And I force selenium to run Firefox in headless mode
52
+ When I run `bundle exec rails g scaffold appointment name:string when:datetime`
53
+ And I write to "features/create_appointment.feature" with:
47
54
  """
48
55
  @javascript
49
56
  Feature: Create appointments
50
- Scenario: Constitution on May 17
57
+ Scenario: Visit the Constitution on May 17
51
58
  Given a random appointment
52
- And I am viewing random appointment
59
+ And I am viewing the appointment
53
60
  Then I should see "Random appointment"
54
-
55
61
  """
56
- And I write to "features/step_definitions/custom_steps.rb" with:
62
+ And I write to "features/step_definitions/create_appointment_steps.rb" with:
57
63
  """
58
- Given /^a random appointment$/ do
64
+ Given('a random appointment') do
59
65
  @appointment = Appointment.create!(name: 'Random appointment', when: DateTime.now)
60
66
  end
61
67
 
62
- Given /^I am viewing random appointment$/ do
68
+ Given('I am viewing the appointment') do
63
69
  visit appointment_path(@appointment)
64
70
  end
65
- """
66
71
 
67
- When I run `bundle exec rake db:migrate`
72
+ Then('I should see {string}') do |text|
73
+ expect(page).to have_content(text)
74
+ end
75
+ """
76
+ And I run `bundle exec rake db:migrate`
68
77
  And I run `bundle exec rake cucumber`
69
78
  Then the feature run should pass with:
70
79
  """
71
80
  1 scenario (1 passed)
72
81
  3 steps (3 passed)
73
82
  """
83
+
84
+ Scenario: Use a particular driver without a DB
85
+ Given I have created a new Rails app and installed cucumber-rails without database_cleaner
86
+ And I force selenium to run Firefox in headless mode
87
+ When I run `bundle exec rails g scaffold appointment name:string when:datetime`
88
+ And I write to "features/create_appointment.feature" with:
89
+ """
90
+ @javascript
91
+ Feature: Create appointments
92
+ Scenario: Visit the Constitution on May 17
93
+ Given I am on the new appointment page
94
+ And I fill in "Norway's constitution" for "Name"
95
+ And I select "2015-02-20 15:10:00 UTC" as the "When" date and time
96
+ And I press "Create Appointment"
97
+ Then I should see "Norway's constitution"
98
+ And I should see "2015-02-20 15:10:00 UTC"
99
+ """
100
+ And I write to "features/create_appointment_steps.rb" with:
101
+ """
102
+ Given('I am on the new appointment page') do
103
+ visit new_appointment_path
104
+ end
105
+
106
+ When('I fill in {string} for {string}') do |value, field|
107
+ fill_in(field, with: value)
108
+ end
109
+
110
+ When('I press {string}') do |button|
111
+ click_button(button)
112
+ end
113
+
114
+ Then('I should see {string}') do |text|
115
+ expect(page).to have_content(text)
116
+ end
117
+
118
+ When('I select {string} as the {string} date and time') do |datetime, selector|
119
+ select_datetime(datetime, from: selector)
120
+ end
121
+ """
122
+ And I append to "features/support/env.rb" with:
123
+ """
124
+ Cucumber::Rails::Database.autorun_database_cleaner = false
125
+ """
126
+ And I run `bundle exec rake db:migrate`
127
+ And I run `bundle exec rake cucumber`
128
+ Then the feature run should pass with:
129
+ """
130
+ 1 scenario (1 passed)
131
+ 6 steps (6 passed)
132
+ """
@@ -1,6 +1,6 @@
1
1
  Feature: Choose javascript database strategy
2
2
 
3
- When running a scenario with the @javascript tag, Capybara will fire up a web server
3
+ Whilst running a scenario with the @javascript tag, Capybara will fire up a web server
4
4
  in the same process in a separate thread to your cukes. By default, this means ActiveRecord will give it a
5
5
  separate database connection, which in turn means data you put into your database from
6
6
  Cucumber step definitions (e.g. using FactoryBot) won't be visible to the web server
@@ -26,9 +26,23 @@ Feature: Choose javascript database strategy
26
26
  Background:
27
27
  Given I have created a new Rails app and installed cucumber-rails
28
28
  And I have a "Widget" ActiveRecord model object
29
+ When I write to "features/step_definitions/widget_steps.rb" with:
30
+ """
31
+ When('I create {int} widgets') do |number|
32
+ number.times { Widget.create! }
33
+ end
34
+
35
+ Then('I should have {int} widgets') do |number|
36
+ expect(Widget.count).to eq(number)
37
+ end
38
+
39
+ Then('the DatabaseCleaner strategy should be {word}') do |strategy_name|
40
+ expect(DatabaseCleaner.cleaners.values.first.strategy.to_s).to match(/#{strategy_name}/i)
41
+ end
42
+ """
29
43
 
30
44
  Scenario: Set the strategy to truncation and run a javascript scenario.
31
- Given I append to "features/env.rb" with:
45
+ When I append to "features/env.rb" with:
32
46
  """
33
47
  DatabaseCleaner.strategy = :transaction
34
48
  Cucumber::Rails::Database.javascript_strategy = :truncation
@@ -37,13 +51,13 @@ Feature: Choose javascript database strategy
37
51
  """
38
52
  Feature:
39
53
  Background:
40
- Given I have created 2 widgets
54
+ When I create 2 widgets
41
55
 
42
56
  @javascript
43
57
  Scenario:
44
- Then the DatabaseCleaner strategy should be truncation
45
58
  When I create 3 widgets
46
- Then I should have 5 widgets
59
+ Then the DatabaseCleaner strategy should be truncation
60
+ And I should have 5 widgets
47
61
 
48
62
  @javascript
49
63
  Scenario:
@@ -54,29 +68,15 @@ Feature: Choose javascript database strategy
54
68
  Then the DatabaseCleaner strategy should be transaction
55
69
  And I should have 2 widgets
56
70
  """
57
- And I write to "features/step_definitions/widget_steps.rb" with:
71
+ And I run the cukes
72
+ Then the feature run should pass with:
58
73
  """
59
- Given /created? (\d) widgets/ do |num|
60
- num.to_i.times { Widget.create! }
61
- end
62
-
63
- Then /should have (\d) widgets/ do |num|
64
- Widget.count.should == num.to_i
65
- end
66
-
67
- Then /^the DatabaseCleaner strategy should be (\w+)$/ do |strategy_name|
68
- DatabaseCleaner.connections.first.strategy.to_s.should =~ /#{strategy_name}/i
69
- end
74
+ 3 scenarios (3 passed)
75
+ 10 steps (10 passed)
70
76
  """
71
- When I run the cukes
72
- Then the feature run should pass with:
73
- """
74
- 3 scenarios (3 passed)
75
- 10 steps (10 passed)
76
- """
77
77
 
78
- Scenario: Set the strategy to deletion and run a javascript scenario.
79
- Given I append to "features/env.rb" with:
78
+ Scenario: Set the strategy to deletion and run a javascript scenario.
79
+ When I append to "features/env.rb" with:
80
80
  """
81
81
  Cucumber::Rails::Database.javascript_strategy = :deletion
82
82
  """
@@ -85,7 +85,7 @@ Feature: Choose javascript database strategy
85
85
  @javascript
86
86
  Feature:
87
87
  Background:
88
- Given I have created 2 widgets
88
+ When I create 2 widgets
89
89
 
90
90
  Scenario:
91
91
  When I create 3 widgets
@@ -94,27 +94,17 @@ Feature: Choose javascript database strategy
94
94
  Scenario:
95
95
  Then I should have 2 widgets
96
96
  """
97
- And I write to "features/step_definitions/widget_steps.rb" with:
97
+ And I run the cukes
98
+ Then the feature run should pass with:
98
99
  """
99
- Given /created? (\d) widgets/ do |num|
100
- num.to_i.times { Widget.create! }
101
- end
102
-
103
- Then /should have (\d) widgets/ do |num|
104
- Widget.count.should == num.to_i
105
- end
100
+ 2 scenarios (2 passed)
101
+ 5 steps (5 passed)
106
102
  """
107
- When I run the cukes
108
- Then the feature run should pass with:
109
- """
110
- 2 scenarios (2 passed)
111
- 5 steps (5 passed)
112
- """
113
103
 
114
104
  Scenario: Set the strategy to truncation with an except option and run a javascript scenario.
115
- Given I append to "features/env.rb" with:
105
+ When I append to "features/env.rb" with:
116
106
  """
117
- Cucumber::Rails::Database.javascript_strategy = :truncation, {:except=>%w[widgets]}
107
+ Cucumber::Rails::Database.javascript_strategy = :truncation, { except: %w[widgets] }
118
108
  """
119
109
  And I write to "features/widgets.feature" with:
120
110
  """
@@ -127,19 +117,9 @@ Feature: Choose javascript database strategy
127
117
  Scenario:
128
118
  Then I should have 3 widgets
129
119
  """
130
- And I write to "features/step_definitions/widget_steps.rb" with:
120
+ And I run the cukes
121
+ Then the feature run should pass with:
131
122
  """
132
- Given /created? (\d) widgets/ do |num|
133
- num.to_i.times { Widget.create! }
134
- end
135
-
136
- Then /should have (\d) widgets/ do |num|
137
- Widget.count.should == num.to_i
138
- end
123
+ 2 scenarios (2 passed)
124
+ 3 steps (3 passed)
139
125
  """
140
- When I run the cukes
141
- Then the feature run should pass with:
142
- """
143
- 2 scenarios (2 passed)
144
- 3 steps (3 passed)
145
- """