cypress-on-rails 1.16.0 → 1.18.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (323) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/ruby.yml +14 -14
  3. data/.gitignore +2 -1
  4. data/CHANGELOG.md +11 -0
  5. data/README.md +202 -48
  6. data/cypress-on-rails.gemspec +1 -1
  7. data/docs/authentication.md +30 -0
  8. data/docs/factory_bot_associations.md +14 -0
  9. data/lib/cypress_on_rails/configuration.rb +5 -0
  10. data/lib/cypress_on_rails/middleware.rb +1 -0
  11. data/lib/cypress_on_rails/railtie.rb +10 -2
  12. data/lib/cypress_on_rails/simple_rails_factory.rb +0 -2
  13. data/lib/cypress_on_rails/vcr/insert_eject_middleware.rb +75 -0
  14. data/lib/cypress_on_rails/vcr/middleware_helpers.rb +51 -0
  15. data/lib/cypress_on_rails/vcr/use_cassette_middleware.rb +56 -0
  16. data/lib/cypress_on_rails/version.rb +1 -1
  17. data/lib/generators/cypress_on_rails/install_generator.rb +31 -29
  18. data/lib/generators/cypress_on_rails/templates/config/initializers/cypress_on_rails.rb.erb +9 -1
  19. data/lib/generators/cypress_on_rails/templates/spec/cypress/support/commands.js +22 -0
  20. data/lib/generators/cypress_on_rails/templates/spec/cypress/support/on-rails.js +7 -0
  21. data/lib/generators/cypress_on_rails/templates/spec/e2e/e2e_helper.rb.erb +0 -5
  22. data/spec/cypress_on_rails/configuration_spec.rb +4 -1
  23. data/spec/cypress_on_rails/vcr/insert_eject_middleware_spec.rb +177 -0
  24. data/spec/cypress_on_rails/vcr/use_cassette_middleware_spec.rb +68 -0
  25. data/specs_e2e/rails_6_1/.gitattributes +10 -0
  26. data/specs_e2e/{rails_5_2 → rails_6_1}/.gitignore +4 -0
  27. data/specs_e2e/rails_6_1/Gemfile +20 -0
  28. data/specs_e2e/{rails_5_2 → rails_6_1}/Rakefile +1 -1
  29. data/specs_e2e/rails_6_1/app/assets/stylesheets/application.css +15 -0
  30. data/specs_e2e/rails_6_1/app/jobs/application_job.rb +7 -0
  31. data/specs_e2e/{rails_5_2 → rails_6_1}/app/views/layouts/application.html.erb +1 -1
  32. data/specs_e2e/rails_6_1/bin/bundle +114 -0
  33. data/specs_e2e/rails_6_1/bin/rails +5 -0
  34. data/specs_e2e/rails_6_1/bin/rake +5 -0
  35. data/specs_e2e/{rails_5_2 → rails_6_1}/bin/setup +15 -4
  36. data/specs_e2e/rails_6_1/bin/spring +14 -0
  37. data/specs_e2e/rails_6_1/bin/yarn +17 -0
  38. data/specs_e2e/rails_6_1/config/application.rb +34 -0
  39. data/specs_e2e/rails_6_1/config/boot.rb +4 -0
  40. data/specs_e2e/rails_6_1/config/cable.yml +10 -0
  41. data/specs_e2e/rails_6_1/config/credentials.yml.enc +1 -0
  42. data/specs_e2e/{rails_5_2 → rails_6_1}/config/database.yml +7 -0
  43. data/specs_e2e/{rails_5_2 → rails_6_1}/config/environment.rb +1 -1
  44. data/specs_e2e/{rails_5_2 → rails_6_1}/config/environments/development.rb +22 -5
  45. data/specs_e2e/rails_6_1/config/environments/production.rb +120 -0
  46. data/specs_e2e/{rails_5_2 → rails_6_1}/config/environments/test.rb +24 -7
  47. data/specs_e2e/rails_6_1/config/initializers/backtrace_silencers.rb +8 -0
  48. data/specs_e2e/{rails_5_2 → rails_6_1}/config/initializers/content_security_policy.rb +5 -0
  49. data/specs_e2e/{rails_4_2 → rails_6_1}/config/initializers/filter_parameter_logging.rb +3 -1
  50. data/specs_e2e/rails_6_1/config/initializers/permissions_policy.rb +11 -0
  51. data/specs_e2e/{rails_3_2 → rails_6_1}/config/initializers/wrap_parameters.rb +5 -1
  52. data/specs_e2e/{rails_5_2 → rails_6_1}/config/locales/en.yml +1 -1
  53. data/specs_e2e/rails_6_1/config/master.key +1 -0
  54. data/specs_e2e/rails_6_1/config/puma.rb +43 -0
  55. data/specs_e2e/rails_6_1/config/storage.yml +34 -0
  56. data/specs_e2e/{rails_5_2 → rails_6_1}/config.ru +2 -1
  57. data/specs_e2e/{rails_5_2 → rails_6_1}/db/migrate/20180621085832_create_posts.rb +1 -1
  58. data/specs_e2e/rails_6_1/package.json +8 -0
  59. data/specs_e2e/rails_6_1/playwright-report/index.html +71 -0
  60. data/specs_e2e/rails_6_1/public/robots.txt +1 -0
  61. data/specs_e2e/rails_6_1/test-results/.last-run.json +4 -0
  62. data/specs_e2e/rails_6_1/test.sh +57 -0
  63. data/specs_e2e/rails_7_2/.gitattributes +9 -0
  64. data/specs_e2e/rails_7_2/.gitignore +16 -0
  65. data/specs_e2e/rails_7_2/.rubocop.yml +8 -0
  66. data/specs_e2e/rails_7_2/Gemfile +11 -0
  67. data/specs_e2e/{rails_4_2 → rails_7_2}/Rakefile +1 -1
  68. data/specs_e2e/rails_7_2/app/assets/stylesheets/application.css +15 -0
  69. data/specs_e2e/rails_7_2/app/controllers/application_controller.rb +4 -0
  70. data/specs_e2e/rails_7_2/app/controllers/posts_controller.rb +58 -0
  71. data/specs_e2e/rails_7_2/app/helpers/posts_helper.rb +2 -0
  72. data/specs_e2e/rails_7_2/app/jobs/application_job.rb +7 -0
  73. data/specs_e2e/rails_7_2/app/models/application_record.rb +3 -0
  74. data/specs_e2e/rails_7_2/app/models/post.rb +2 -0
  75. data/specs_e2e/rails_7_2/app/views/layouts/application.html.erb +22 -0
  76. data/specs_e2e/rails_7_2/app/views/posts/_form.html.erb +32 -0
  77. data/specs_e2e/rails_7_2/app/views/posts/edit.html.erb +6 -0
  78. data/specs_e2e/rails_7_2/app/views/posts/index.html.erb +31 -0
  79. data/specs_e2e/rails_7_2/app/views/posts/new.html.erb +5 -0
  80. data/specs_e2e/rails_7_2/app/views/posts/show.html.erb +19 -0
  81. data/specs_e2e/rails_7_2/bin/brakeman +7 -0
  82. data/specs_e2e/rails_7_2/bin/bundle +109 -0
  83. data/specs_e2e/rails_7_2/bin/importmap +4 -0
  84. data/specs_e2e/rails_7_2/bin/rails +4 -0
  85. data/specs_e2e/rails_7_2/bin/rake +4 -0
  86. data/specs_e2e/rails_7_2/bin/setup +37 -0
  87. data/specs_e2e/rails_7_2/config/application.rb +37 -0
  88. data/specs_e2e/rails_7_2/config/boot.rb +4 -0
  89. data/specs_e2e/rails_7_2/config/cable.yml +10 -0
  90. data/specs_e2e/rails_7_2/config/credentials.yml.enc +1 -0
  91. data/specs_e2e/rails_7_2/config/database.yml +32 -0
  92. data/specs_e2e/{rails_4_2 → rails_7_2}/config/environment.rb +1 -1
  93. data/specs_e2e/rails_7_2/config/environments/development.rb +54 -0
  94. data/specs_e2e/rails_7_2/config/environments/production.rb +105 -0
  95. data/specs_e2e/rails_7_2/config/environments/test.rb +45 -0
  96. data/specs_e2e/rails_7_2/config/importmap.rb +7 -0
  97. data/specs_e2e/rails_7_2/config/initializers/content_security_policy.rb +25 -0
  98. data/specs_e2e/rails_7_2/config/initializers/filter_parameter_logging.rb +8 -0
  99. data/specs_e2e/{rails_5_2 → rails_7_2}/config/initializers/inflections.rb +4 -4
  100. data/specs_e2e/rails_7_2/config/initializers/permissions_policy.rb +13 -0
  101. data/specs_e2e/rails_7_2/config/locales/en.yml +31 -0
  102. data/specs_e2e/rails_7_2/config/master.key +1 -0
  103. data/specs_e2e/rails_7_2/config/puma.rb +34 -0
  104. data/specs_e2e/rails_7_2/config/routes.rb +5 -0
  105. data/specs_e2e/rails_7_2/config/storage.yml +34 -0
  106. data/specs_e2e/{rails_4_2 → rails_7_2}/config.ru +3 -1
  107. data/specs_e2e/rails_7_2/db/migrate/20180621085832_create_posts.rb +11 -0
  108. data/specs_e2e/rails_7_2/db/seeds.rb +9 -0
  109. data/specs_e2e/rails_7_2/db/test.sqlite3-shm +0 -0
  110. data/specs_e2e/rails_7_2/db/test.sqlite3-wal +0 -0
  111. data/specs_e2e/rails_7_2/package.json +8 -0
  112. data/specs_e2e/rails_7_2/playwright-report/index.html +71 -0
  113. data/specs_e2e/{rails_4_2 → rails_7_2}/public/404.html +6 -6
  114. data/specs_e2e/rails_7_2/public/406-unsupported-browser.html +66 -0
  115. data/specs_e2e/{rails_4_2 → rails_7_2}/public/422.html +6 -6
  116. data/specs_e2e/{rails_4_2 → rails_7_2}/public/500.html +6 -6
  117. data/specs_e2e/rails_7_2/public/icon.png +0 -0
  118. data/specs_e2e/rails_7_2/public/icon.svg +3 -0
  119. data/specs_e2e/rails_7_2/public/robots.txt +1 -0
  120. data/specs_e2e/rails_7_2/storage/test.sqlite3 +0 -0
  121. data/specs_e2e/rails_7_2/test/controllers/posts_controller_test.rb +48 -0
  122. data/specs_e2e/rails_7_2/test/cypress_fixtures/posts.yml +11 -0
  123. data/specs_e2e/rails_7_2/test/fixtures/posts.yml +11 -0
  124. data/specs_e2e/rails_7_2/test/models/post_test.rb +7 -0
  125. data/specs_e2e/rails_7_2/test-results/.last-run.json +4 -0
  126. data/specs_e2e/rails_7_2/test.sh +57 -0
  127. data/specs_e2e/rails_8/.gitattributes +9 -0
  128. data/specs_e2e/rails_8/.gitignore +16 -0
  129. data/specs_e2e/rails_8/.rubocop.yml +8 -0
  130. data/specs_e2e/rails_8/Gemfile +20 -0
  131. data/specs_e2e/{rails_3_2 → rails_8}/Rakefile +2 -3
  132. data/specs_e2e/rails_8/app/assets/stylesheets/application.css +10 -0
  133. data/specs_e2e/rails_8/app/controllers/application_controller.rb +4 -0
  134. data/specs_e2e/rails_8/app/controllers/posts_controller.rb +58 -0
  135. data/specs_e2e/rails_8/app/helpers/posts_helper.rb +2 -0
  136. data/specs_e2e/rails_8/app/jobs/application_job.rb +7 -0
  137. data/specs_e2e/rails_8/app/models/application_record.rb +3 -0
  138. data/specs_e2e/rails_8/app/models/post.rb +2 -0
  139. data/specs_e2e/rails_8/app/views/layouts/application.html.erb +27 -0
  140. data/specs_e2e/rails_8/app/views/posts/_form.html.erb +32 -0
  141. data/specs_e2e/rails_8/app/views/posts/edit.html.erb +6 -0
  142. data/specs_e2e/rails_8/app/views/posts/index.html.erb +31 -0
  143. data/specs_e2e/rails_8/app/views/posts/new.html.erb +5 -0
  144. data/specs_e2e/rails_8/app/views/posts/show.html.erb +19 -0
  145. data/specs_e2e/rails_8/bin/brakeman +7 -0
  146. data/specs_e2e/rails_8/bin/bundle +109 -0
  147. data/specs_e2e/rails_8/bin/dev +2 -0
  148. data/specs_e2e/rails_8/bin/importmap +4 -0
  149. data/specs_e2e/rails_8/bin/rails +4 -0
  150. data/specs_e2e/rails_8/bin/rake +4 -0
  151. data/specs_e2e/rails_8/bin/setup +34 -0
  152. data/specs_e2e/rails_8/bin/thrust +5 -0
  153. data/specs_e2e/rails_8/config/application.rb +27 -0
  154. data/specs_e2e/rails_8/config/boot.rb +4 -0
  155. data/specs_e2e/rails_8/config/cable.yml +17 -0
  156. data/specs_e2e/rails_8/config/cache.yml +16 -0
  157. data/specs_e2e/rails_8/config/credentials.yml.enc +1 -0
  158. data/specs_e2e/rails_8/config/database.yml +41 -0
  159. data/specs_e2e/rails_8/config/deploy.yml +116 -0
  160. data/specs_e2e/rails_8/config/environment.rb +5 -0
  161. data/specs_e2e/rails_8/config/environments/development.rb +57 -0
  162. data/specs_e2e/rails_8/config/environments/production.rb +90 -0
  163. data/specs_e2e/rails_8/config/environments/test.rb +45 -0
  164. data/specs_e2e/rails_8/config/importmap.rb +7 -0
  165. data/specs_e2e/rails_8/config/initializers/content_security_policy.rb +25 -0
  166. data/specs_e2e/rails_8/config/initializers/filter_parameter_logging.rb +8 -0
  167. data/specs_e2e/rails_8/config/initializers/inflections.rb +16 -0
  168. data/specs_e2e/rails_8/config/locales/en.yml +31 -0
  169. data/specs_e2e/rails_8/config/master.key +1 -0
  170. data/specs_e2e/rails_8/config/puma.rb +41 -0
  171. data/specs_e2e/rails_8/config/queue.yml +18 -0
  172. data/specs_e2e/rails_8/config/recurring.yml +10 -0
  173. data/specs_e2e/rails_8/config/routes.rb +5 -0
  174. data/specs_e2e/rails_8/config/storage.yml +34 -0
  175. data/specs_e2e/rails_8/config.ru +6 -0
  176. data/specs_e2e/rails_8/db/cable_schema.rb +11 -0
  177. data/specs_e2e/rails_8/db/cache_schema.rb +14 -0
  178. data/specs_e2e/rails_8/db/migrate/20180621085832_create_posts.rb +11 -0
  179. data/specs_e2e/rails_8/db/queue_schema.rb +129 -0
  180. data/specs_e2e/rails_8/db/seeds.rb +9 -0
  181. data/specs_e2e/rails_8/package.json +8 -0
  182. data/specs_e2e/rails_8/playwright-report/index.html +71 -0
  183. data/specs_e2e/rails_8/public/400.html +114 -0
  184. data/specs_e2e/rails_8/public/404.html +114 -0
  185. data/specs_e2e/rails_8/public/406-unsupported-browser.html +114 -0
  186. data/specs_e2e/rails_8/public/422.html +114 -0
  187. data/specs_e2e/rails_8/public/500.html +114 -0
  188. data/specs_e2e/rails_8/public/icon.png +0 -0
  189. data/specs_e2e/rails_8/public/icon.svg +3 -0
  190. data/specs_e2e/rails_8/public/robots.txt +1 -0
  191. data/specs_e2e/rails_8/storage/test.sqlite3 +0 -0
  192. data/specs_e2e/rails_8/storage/test.sqlite3-shm +0 -0
  193. data/specs_e2e/rails_8/storage/test.sqlite3-wal +0 -0
  194. data/specs_e2e/rails_8/test/application_system_test_case.rb +5 -0
  195. data/specs_e2e/rails_8/test/controllers/posts_controller_test.rb +48 -0
  196. data/specs_e2e/rails_8/test/cypress_fixtures/posts.yml +11 -0
  197. data/specs_e2e/rails_8/test/fixtures/posts.yml +11 -0
  198. data/specs_e2e/rails_8/test/models/post_test.rb +7 -0
  199. data/specs_e2e/rails_8/test/test_helper.rb +15 -0
  200. data/specs_e2e/rails_8/test-results/.last-run.json +4 -0
  201. data/specs_e2e/{rails_5_2 → rails_8}/test.sh +17 -8
  202. metadata +221 -153
  203. data/lib/cypress_on_rails/vcr_middleware.rb +0 -73
  204. data/lib/generators/cypress_on_rails/update_generator.rb +0 -24
  205. data/spec/cypress_on_rails/vcr_middleware_spec.rb +0 -119
  206. data/specs_e2e/rails_3_2/.gitignore +0 -9
  207. data/specs_e2e/rails_3_2/.ruby_version +0 -1
  208. data/specs_e2e/rails_3_2/Gemfile +0 -7
  209. data/specs_e2e/rails_3_2/README.rdoc +0 -261
  210. data/specs_e2e/rails_3_2/app/assets/stylesheets/application.css +0 -13
  211. data/specs_e2e/rails_3_2/app/controllers/application_controller.rb +0 -3
  212. data/specs_e2e/rails_3_2/app/controllers/welcome_controller.rb +0 -4
  213. data/specs_e2e/rails_3_2/app/helpers/application_helper.rb +0 -2
  214. data/specs_e2e/rails_3_2/app/models/post.rb +0 -21
  215. data/specs_e2e/rails_3_2/app/views/layouts/application.html.erb +0 -13
  216. data/specs_e2e/rails_3_2/app/views/welcome/index.html.erb +0 -24
  217. data/specs_e2e/rails_3_2/bin/rails +0 -6
  218. data/specs_e2e/rails_3_2/config/application.rb +0 -68
  219. data/specs_e2e/rails_3_2/config/boot.rb +0 -6
  220. data/specs_e2e/rails_3_2/config/environment.rb +0 -5
  221. data/specs_e2e/rails_3_2/config/environments/development.rb +0 -31
  222. data/specs_e2e/rails_3_2/config/environments/production.rb +0 -64
  223. data/specs_e2e/rails_3_2/config/environments/test.rb +0 -35
  224. data/specs_e2e/rails_3_2/config/initializers/backtrace_silencers.rb +0 -7
  225. data/specs_e2e/rails_3_2/config/initializers/inflections.rb +0 -15
  226. data/specs_e2e/rails_3_2/config/initializers/mime_types.rb +0 -5
  227. data/specs_e2e/rails_3_2/config/initializers/secret_token.rb +0 -7
  228. data/specs_e2e/rails_3_2/config/initializers/session_store.rb +0 -8
  229. data/specs_e2e/rails_3_2/config/locales/en.yml +0 -5
  230. data/specs_e2e/rails_3_2/config/routes.rb +0 -60
  231. data/specs_e2e/rails_3_2/config.ru +0 -4
  232. data/specs_e2e/rails_3_2/public/404.html +0 -26
  233. data/specs_e2e/rails_3_2/public/422.html +0 -26
  234. data/specs_e2e/rails_3_2/public/500.html +0 -25
  235. data/specs_e2e/rails_3_2/public/robots.txt +0 -5
  236. data/specs_e2e/rails_3_2/test.sh +0 -43
  237. data/specs_e2e/rails_4_2/.gitignore +0 -11
  238. data/specs_e2e/rails_4_2/Gemfile +0 -11
  239. data/specs_e2e/rails_4_2/README.rdoc +0 -28
  240. data/specs_e2e/rails_4_2/app/assets/javascripts/using_vcr.js +0 -2
  241. data/specs_e2e/rails_4_2/app/assets/stylesheets/using_vcr.css +0 -4
  242. data/specs_e2e/rails_4_2/app/controllers/application_controller.rb +0 -5
  243. data/specs_e2e/rails_4_2/app/controllers/using_vcr_controller.rb +0 -10
  244. data/specs_e2e/rails_4_2/app/controllers/welcome_controller.rb +0 -4
  245. data/specs_e2e/rails_4_2/app/models/post.rb +0 -23
  246. data/specs_e2e/rails_4_2/app/views/layouts/application.html.erb +0 -12
  247. data/specs_e2e/rails_4_2/app/views/using_vcr/index.html.erb +0 -6
  248. data/specs_e2e/rails_4_2/app/views/using_vcr/record_cats.html.erb +0 -7
  249. data/specs_e2e/rails_4_2/app/views/welcome/index.html.erb +0 -24
  250. data/specs_e2e/rails_4_2/bin/bundle +0 -3
  251. data/specs_e2e/rails_4_2/bin/rails +0 -4
  252. data/specs_e2e/rails_4_2/bin/rake +0 -4
  253. data/specs_e2e/rails_4_2/bin/setup +0 -29
  254. data/specs_e2e/rails_4_2/config/application.rb +0 -32
  255. data/specs_e2e/rails_4_2/config/boot.rb +0 -3
  256. data/specs_e2e/rails_4_2/config/environments/development.rb +0 -25
  257. data/specs_e2e/rails_4_2/config/environments/production.rb +0 -64
  258. data/specs_e2e/rails_4_2/config/environments/test.rb +0 -42
  259. data/specs_e2e/rails_4_2/config/initializers/backtrace_silencers.rb +0 -7
  260. data/specs_e2e/rails_4_2/config/initializers/cookies_serializer.rb +0 -3
  261. data/specs_e2e/rails_4_2/config/initializers/session_store.rb +0 -3
  262. data/specs_e2e/rails_4_2/config/initializers/to_time_preserves_timezone.rb +0 -10
  263. data/specs_e2e/rails_4_2/config/initializers/wrap_parameters.rb +0 -9
  264. data/specs_e2e/rails_4_2/config/locales/en.yml +0 -23
  265. data/specs_e2e/rails_4_2/config/routes.rb +0 -61
  266. data/specs_e2e/rails_4_2/config/secrets.yml +0 -22
  267. data/specs_e2e/rails_4_2/package.json +0 -10
  268. data/specs_e2e/rails_4_2/public/favicon.ico +0 -0
  269. data/specs_e2e/rails_4_2/public/robots.txt +0 -5
  270. data/specs_e2e/rails_4_2/test.sh +0 -44
  271. data/specs_e2e/rails_5_2/Gemfile +0 -15
  272. data/specs_e2e/rails_5_2/app/assets/javascripts/posts.js +0 -2
  273. data/specs_e2e/rails_5_2/app/assets/stylesheets/posts.css +0 -4
  274. data/specs_e2e/rails_5_2/app/assets/stylesheets/scaffold.css +0 -80
  275. data/specs_e2e/rails_5_2/app/jobs/application_job.rb +0 -2
  276. data/specs_e2e/rails_5_2/app/views/welcome/index.html.erb +0 -5
  277. data/specs_e2e/rails_5_2/bin/bundle +0 -3
  278. data/specs_e2e/rails_5_2/bin/rails +0 -4
  279. data/specs_e2e/rails_5_2/bin/rake +0 -4
  280. data/specs_e2e/rails_5_2/bin/update +0 -25
  281. data/specs_e2e/rails_5_2/config/application.rb +0 -33
  282. data/specs_e2e/rails_5_2/config/boot.rb +0 -4
  283. data/specs_e2e/rails_5_2/config/credentials.yml.enc +0 -1
  284. data/specs_e2e/rails_5_2/config/environments/production.rb +0 -68
  285. data/specs_e2e/rails_5_2/config/initializers/backtrace_silencers.rb +0 -7
  286. data/specs_e2e/rails_5_2/config/initializers/filter_parameter_logging.rb +0 -4
  287. data/specs_e2e/rails_5_2/config/initializers/mime_types.rb +0 -4
  288. data/specs_e2e/rails_5_2/config/initializers/wrap_parameters.rb +0 -9
  289. data/specs_e2e/rails_5_2/config/master.key +0 -1
  290. data/specs_e2e/rails_5_2/public/favicon.ico +0 -0
  291. data/specs_e2e/rails_5_2/public/robots.txt +0 -1
  292. /data/specs_e2e/{rails_5_2 → rails_6_1}/app/controllers/application_controller.rb +0 -0
  293. /data/specs_e2e/{rails_5_2 → rails_6_1}/app/controllers/posts_controller.rb +0 -0
  294. /data/specs_e2e/{rails_5_2 → rails_6_1}/app/helpers/posts_helper.rb +0 -0
  295. /data/specs_e2e/{rails_5_2 → rails_6_1}/app/models/application_record.rb +0 -0
  296. /data/specs_e2e/{rails_5_2 → rails_6_1}/app/models/post.rb +0 -0
  297. /data/specs_e2e/{rails_5_2 → rails_6_1}/app/views/posts/_form.html.erb +0 -0
  298. /data/specs_e2e/{rails_5_2 → rails_6_1}/app/views/posts/edit.html.erb +0 -0
  299. /data/specs_e2e/{rails_5_2 → rails_6_1}/app/views/posts/index.html.erb +0 -0
  300. /data/specs_e2e/{rails_5_2 → rails_6_1}/app/views/posts/new.html.erb +0 -0
  301. /data/specs_e2e/{rails_5_2 → rails_6_1}/app/views/posts/show.html.erb +0 -0
  302. /data/specs_e2e/{rails_5_2 → rails_6_1}/config/initializers/application_controller_renderer.rb +0 -0
  303. /data/specs_e2e/{rails_5_2 → rails_6_1}/config/initializers/cookies_serializer.rb +0 -0
  304. /data/specs_e2e/{rails_4_2 → rails_6_1}/config/initializers/inflections.rb +0 -0
  305. /data/specs_e2e/{rails_4_2 → rails_6_1}/config/initializers/mime_types.rb +0 -0
  306. /data/specs_e2e/{rails_5_2 → rails_6_1}/config/routes.rb +0 -0
  307. /data/specs_e2e/{rails_5_2 → rails_6_1}/public/404.html +0 -0
  308. /data/specs_e2e/{rails_5_2 → rails_6_1}/public/422.html +0 -0
  309. /data/specs_e2e/{rails_5_2 → rails_6_1}/public/500.html +0 -0
  310. /data/specs_e2e/{rails_5_2 → rails_6_1}/public/apple-touch-icon-precomposed.png +0 -0
  311. /data/specs_e2e/{rails_5_2 → rails_6_1}/public/apple-touch-icon.png +0 -0
  312. /data/specs_e2e/{rails_3_2 → rails_6_1}/public/favicon.ico +0 -0
  313. /data/specs_e2e/{rails_5_2 → rails_6_1}/test/controllers/posts_controller_test.rb +0 -0
  314. /data/specs_e2e/{rails_5_2 → rails_6_1}/test/cypress_fixtures/posts.yml +0 -0
  315. /data/specs_e2e/{rails_5_2 → rails_6_1}/test/fixtures/posts.yml +0 -0
  316. /data/specs_e2e/{rails_5_2 → rails_6_1}/test/models/post_test.rb +0 -0
  317. /data/specs_e2e/{rails_3_2/log → rails_6_1/vendor}/.keep +0 -0
  318. /data/specs_e2e/{rails_3_2/tmp → rails_7_2/vendor}/.keep +0 -0
  319. /data/specs_e2e/{rails_4_2/spec → rails_7_2/vendor/javascript}/.keep +0 -0
  320. /data/specs_e2e/{rails_5_2 → rails_8}/README.md +0 -0
  321. /data/specs_e2e/{rails_4_2/vendor → rails_8/storage}/.keep +0 -0
  322. /data/specs_e2e/{rails_5_2 → rails_8}/vendor/.keep +0 -0
  323. /data/specs_e2e/{rails_3_2/vendor/.gitkeep → rails_8/vendor/javascript/.keep} +0 -0
@@ -4,7 +4,7 @@
4
4
  <title>The page you were looking for doesn't exist (404)</title>
5
5
  <meta name="viewport" content="width=device-width,initial-scale=1">
6
6
  <style>
7
- body {
7
+ .rails-default-error-page {
8
8
  background-color: #EFEFEF;
9
9
  color: #2E2F30;
10
10
  text-align: center;
@@ -12,13 +12,13 @@
12
12
  margin: 0;
13
13
  }
14
14
 
15
- div.dialog {
15
+ .rails-default-error-page div.dialog {
16
16
  width: 95%;
17
17
  max-width: 33em;
18
18
  margin: 4em auto 0;
19
19
  }
20
20
 
21
- div.dialog > div {
21
+ .rails-default-error-page div.dialog > div {
22
22
  border: 1px solid #CCC;
23
23
  border-right-color: #999;
24
24
  border-left-color: #999;
@@ -31,13 +31,13 @@
31
31
  box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
32
32
  }
33
33
 
34
- h1 {
34
+ .rails-default-error-page h1 {
35
35
  font-size: 100%;
36
36
  color: #730E15;
37
37
  line-height: 1.5em;
38
38
  }
39
39
 
40
- div.dialog > p {
40
+ .rails-default-error-page div.dialog > p {
41
41
  margin: 0 0 1em;
42
42
  padding: 1em;
43
43
  background-color: #F7F7F7;
@@ -54,7 +54,7 @@
54
54
  </style>
55
55
  </head>
56
56
 
57
- <body>
57
+ <body class="rails-default-error-page">
58
58
  <!-- This file lives in public/404.html -->
59
59
  <div class="dialog">
60
60
  <div>
@@ -0,0 +1,66 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>Your browser is not supported (406)</title>
5
+ <meta name="viewport" content="width=device-width,initial-scale=1">
6
+ <style>
7
+ .rails-default-error-page {
8
+ background-color: #EFEFEF;
9
+ color: #2E2F30;
10
+ text-align: center;
11
+ font-family: arial, sans-serif;
12
+ margin: 0;
13
+ }
14
+
15
+ .rails-default-error-page div.dialog {
16
+ width: 95%;
17
+ max-width: 33em;
18
+ margin: 4em auto 0;
19
+ }
20
+
21
+ .rails-default-error-page div.dialog > div {
22
+ border: 1px solid #CCC;
23
+ border-right-color: #999;
24
+ border-left-color: #999;
25
+ border-bottom-color: #BBB;
26
+ border-top: #B00100 solid 4px;
27
+ border-top-left-radius: 9px;
28
+ border-top-right-radius: 9px;
29
+ background-color: white;
30
+ padding: 7px 12% 0;
31
+ box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
32
+ }
33
+
34
+ .rails-default-error-page h1 {
35
+ font-size: 100%;
36
+ color: #730E15;
37
+ line-height: 1.5em;
38
+ }
39
+
40
+ .rails-default-error-page div.dialog > p {
41
+ margin: 0 0 1em;
42
+ padding: 1em;
43
+ background-color: #F7F7F7;
44
+ border: 1px solid #CCC;
45
+ border-right-color: #999;
46
+ border-left-color: #999;
47
+ border-bottom-color: #999;
48
+ border-bottom-left-radius: 4px;
49
+ border-bottom-right-radius: 4px;
50
+ border-top-color: #DADADA;
51
+ color: #666;
52
+ box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
53
+ }
54
+ </style>
55
+ </head>
56
+
57
+ <body class="rails-default-error-page">
58
+ <!-- This file lives in public/406-unsupported-browser.html -->
59
+ <div class="dialog">
60
+ <div>
61
+ <h1>Your browser is not supported.</h1>
62
+ <p>Please upgrade your browser to continue.</p>
63
+ </div>
64
+ </div>
65
+ </body>
66
+ </html>
@@ -4,7 +4,7 @@
4
4
  <title>The change you wanted was rejected (422)</title>
5
5
  <meta name="viewport" content="width=device-width,initial-scale=1">
6
6
  <style>
7
- body {
7
+ .rails-default-error-page {
8
8
  background-color: #EFEFEF;
9
9
  color: #2E2F30;
10
10
  text-align: center;
@@ -12,13 +12,13 @@
12
12
  margin: 0;
13
13
  }
14
14
 
15
- div.dialog {
15
+ .rails-default-error-page div.dialog {
16
16
  width: 95%;
17
17
  max-width: 33em;
18
18
  margin: 4em auto 0;
19
19
  }
20
20
 
21
- div.dialog > div {
21
+ .rails-default-error-page div.dialog > div {
22
22
  border: 1px solid #CCC;
23
23
  border-right-color: #999;
24
24
  border-left-color: #999;
@@ -31,13 +31,13 @@
31
31
  box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
32
32
  }
33
33
 
34
- h1 {
34
+ .rails-default-error-page h1 {
35
35
  font-size: 100%;
36
36
  color: #730E15;
37
37
  line-height: 1.5em;
38
38
  }
39
39
 
40
- div.dialog > p {
40
+ .rails-default-error-page div.dialog > p {
41
41
  margin: 0 0 1em;
42
42
  padding: 1em;
43
43
  background-color: #F7F7F7;
@@ -54,7 +54,7 @@
54
54
  </style>
55
55
  </head>
56
56
 
57
- <body>
57
+ <body class="rails-default-error-page">
58
58
  <!-- This file lives in public/422.html -->
59
59
  <div class="dialog">
60
60
  <div>
@@ -4,7 +4,7 @@
4
4
  <title>We're sorry, but something went wrong (500)</title>
5
5
  <meta name="viewport" content="width=device-width,initial-scale=1">
6
6
  <style>
7
- body {
7
+ .rails-default-error-page {
8
8
  background-color: #EFEFEF;
9
9
  color: #2E2F30;
10
10
  text-align: center;
@@ -12,13 +12,13 @@
12
12
  margin: 0;
13
13
  }
14
14
 
15
- div.dialog {
15
+ .rails-default-error-page div.dialog {
16
16
  width: 95%;
17
17
  max-width: 33em;
18
18
  margin: 4em auto 0;
19
19
  }
20
20
 
21
- div.dialog > div {
21
+ .rails-default-error-page div.dialog > div {
22
22
  border: 1px solid #CCC;
23
23
  border-right-color: #999;
24
24
  border-left-color: #999;
@@ -31,13 +31,13 @@
31
31
  box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
32
32
  }
33
33
 
34
- h1 {
34
+ .rails-default-error-page h1 {
35
35
  font-size: 100%;
36
36
  color: #730E15;
37
37
  line-height: 1.5em;
38
38
  }
39
39
 
40
- div.dialog > p {
40
+ .rails-default-error-page div.dialog > p {
41
41
  margin: 0 0 1em;
42
42
  padding: 1em;
43
43
  background-color: #F7F7F7;
@@ -54,7 +54,7 @@
54
54
  </style>
55
55
  </head>
56
56
 
57
- <body>
57
+ <body class="rails-default-error-page">
58
58
  <!-- This file lives in public/500.html -->
59
59
  <div class="dialog">
60
60
  <div>
Binary file
@@ -0,0 +1,3 @@
1
+ <svg width="100" height="100" xmlns="http://www.w3.org/2000/svg">
2
+ <rect width="100%" height="100%" fill="red"/>
3
+ </svg>
@@ -0,0 +1 @@
1
+ # See https://www.robotstxt.org/robotstxt.html for documentation on how to use the robots.txt file
@@ -0,0 +1,48 @@
1
+ require 'test_helper'
2
+
3
+ class PostsControllerTest < ActionDispatch::IntegrationTest
4
+ setup do
5
+ @post = posts(:one)
6
+ end
7
+
8
+ test "should get index" do
9
+ get posts_url
10
+ assert_response :success
11
+ end
12
+
13
+ test "should get new" do
14
+ get new_post_url
15
+ assert_response :success
16
+ end
17
+
18
+ test "should create post" do
19
+ assert_difference('Post.count') do
20
+ post posts_url, params: { post: { body: @post.body, published: @post.published, title: @post.title } }
21
+ end
22
+
23
+ assert_redirected_to post_url(Post.last)
24
+ end
25
+
26
+ test "should show post" do
27
+ get post_url(@post)
28
+ assert_response :success
29
+ end
30
+
31
+ test "should get edit" do
32
+ get edit_post_url(@post)
33
+ assert_response :success
34
+ end
35
+
36
+ test "should update post" do
37
+ patch post_url(@post), params: { post: { body: @post.body, published: @post.published, title: @post.title } }
38
+ assert_redirected_to post_url(@post)
39
+ end
40
+
41
+ test "should destroy post" do
42
+ assert_difference('Post.count', -1) do
43
+ delete post_url(@post)
44
+ end
45
+
46
+ assert_redirected_to posts_url
47
+ end
48
+ end
@@ -0,0 +1,11 @@
1
+ # Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
2
+
3
+ one:
4
+ title: MyCypressFixtures
5
+ body: MyText
6
+ published: true
7
+
8
+ two:
9
+ title: MyCypressFixtures2
10
+ body: MyText
11
+ published: true
@@ -0,0 +1,11 @@
1
+ # Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
2
+
3
+ one:
4
+ title: MyRailsFixtures
5
+ body: MyText
6
+ published: false
7
+
8
+ two:
9
+ title: MyRailsFixtures2
10
+ body: MyText
11
+ published: false
@@ -0,0 +1,7 @@
1
+ require 'test_helper'
2
+
3
+ class PostTest < ActiveSupport::TestCase
4
+ # test "the truth" do
5
+ # assert true
6
+ # end
7
+ end
@@ -0,0 +1,4 @@
1
+ {
2
+ "status": "passed",
3
+ "failedTests": []
4
+ }
@@ -0,0 +1,57 @@
1
+ #!/usr/bin/env bash
2
+ set -eo pipefail
3
+
4
+ echo '--- testing rails 7.2.2'
5
+
6
+ echo '-- setting environment'
7
+ export DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
8
+ export RAILS_ENV=test
9
+ export BUNDLE_GEMFILE="$DIR/Gemfile"
10
+ cd $DIR
11
+
12
+ echo '-- bundle install'
13
+ bundle --version
14
+ bundle config set --local path 'vendor/bundle'
15
+ bundle install --quiet --gemfile="$DIR/Gemfile" --retry 2
16
+
17
+ echo '-- migration'
18
+ bundle exec ./bin/rails db:drop || true
19
+ bundle exec ./bin/rails db:create db:migrate
20
+
21
+ echo '-- cypress install'
22
+ bundle exec ./bin/rails g cypress_on_rails:install --install_folder=test --framework cypress --install_with=npm --force
23
+ rm -vf test/cypress/e2e/rails_examples/using_vcr.cy.js
24
+
25
+ echo '-- start rails server'
26
+ # make sure the server is not running
27
+ (kill -9 `cat ../server.pid` || true )
28
+
29
+ bundle exec ./bin/rails server -p 5017 -e test -P ../server.pid &
30
+ sleep 2 # give rails a chance to start up correctly
31
+
32
+ echo '-- cypress run'
33
+ cp -fv ../cypress.config.js test/
34
+ cd test
35
+ npx cypress install
36
+ # if [ -z $CYPRESS_RECORD_KEY ]
37
+ # then
38
+ # npx cypress run
39
+ # else
40
+ npx cypress run # --record
41
+ # fi
42
+
43
+ echo '-- playwright install'
44
+ cd ..
45
+ bundle exec ./bin/rails g cypress_on_rails:install --install_folder=test --framework playwright --install_with=npm --force
46
+ rm -vf test/playwright/e2e/rails_examples/using_vcr.cy.js
47
+
48
+ echo '-- playwright run'
49
+ cd test
50
+ cp -fv ../../playwright.config.js .
51
+ npx playwright install-deps
52
+ npx playwright install
53
+ npx playwright test test/playwright
54
+ # npx playwright show-report
55
+
56
+ echo '-- stop rails server'
57
+ kill -9 `cat ../../server.pid` || true
@@ -0,0 +1,9 @@
1
+ # See https://git-scm.com/docs/gitattributes for more about git attribute files.
2
+
3
+ # Mark the database schema as having been generated.
4
+ db/schema.rb linguist-generated
5
+
6
+ # Mark any vendored files as having been vendored.
7
+ vendor/* linguist-vendored
8
+ config/credentials/*.yml.enc diff=rails_credentials
9
+ config/credentials.yml.enc diff=rails_credentials
@@ -0,0 +1,16 @@
1
+ .bundle
2
+ test/node_modules
3
+ test/cypress.config.js
4
+ test/playwright.config.js
5
+ test/package.json
6
+ test/yarn.lock
7
+ test/cypress/
8
+ test/playwright/
9
+ test/playwright-report/
10
+ config/initializers/cypress_on_rails.rb
11
+ vendor/bundle
12
+ db/*.sqlite3
13
+ db/schema.rb
14
+ tmp/*
15
+ log/*
16
+ specs_e2e/server.pid
@@ -0,0 +1,8 @@
1
+ # Omakase Ruby styling for Rails
2
+ inherit_gem: { rubocop-rails-omakase: rubocop.yml }
3
+
4
+ # Overwrite or add rules to create your own house style
5
+ #
6
+ # # Use `[a, [b, c]]` not `[ a, [ b, c ] ]`
7
+ # Layout/SpaceInsideArrayLiteralBrackets:
8
+ # Enabled: false
@@ -0,0 +1,20 @@
1
+ source "https://rubygems.org"
2
+
3
+ # Bundle edge Rails instead: gem "rails", github: "rails/rails", branch: "main"
4
+ gem "rails", "~> 8.0.1"
5
+ # The modern asset pipeline for Rails [https://github.com/rails/propshaft]
6
+ gem "propshaft"
7
+ # Use sqlite3 as the database for Active Record
8
+ gem "sqlite3", ">= 2.1"
9
+ # Use the Puma web server [https://github.com/puma/puma]
10
+ gem "puma", ">= 5.0"
11
+ # Reduces boot times through caching; required in config/boot.rb
12
+ gem "bootsnap", require: false
13
+
14
+ # Use Active Storage variants [https://guides.rubyonrails.org/active_storage_overview.html#transforming-images]
15
+ # gem "image_processing", "~> 1.2"
16
+
17
+ group :development, :test do
18
+ gem 'cypress-on-rails', path: '../../'
19
+ gem 'database_cleaner'
20
+ end
@@ -1,7 +1,6 @@
1
- #!/usr/bin/env rake
2
1
  # Add your own tasks in files placed in lib/tasks ending in .rake,
3
2
  # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
4
3
 
5
- require File.expand_path('../config/application', __FILE__)
4
+ require_relative "config/application"
6
5
 
7
- Rails32::Application.load_tasks
6
+ Rails.application.load_tasks
@@ -0,0 +1,10 @@
1
+ /*
2
+ * This is a manifest file that'll be compiled into application.css.
3
+ *
4
+ * With Propshaft, assets are served efficiently without preprocessing steps. You can still include
5
+ * application-wide styles in this file, but keep in mind that CSS precedence will follow the standard
6
+ * cascading order, meaning styles declared later in the document or manifest will override earlier ones,
7
+ * depending on specificity.
8
+ *
9
+ * Consider organizing styles into separate files for maintainability.
10
+ */
@@ -0,0 +1,4 @@
1
+ class ApplicationController < ActionController::Base
2
+ # Only allow modern browsers supporting webp images, web push, badges, import maps, CSS nesting, and CSS :has.
3
+ allow_browser versions: :modern
4
+ end
@@ -0,0 +1,58 @@
1
+ class PostsController < ApplicationController
2
+ before_action :set_post, only: [:show, :edit, :update, :destroy]
3
+
4
+ # GET /posts
5
+ def index
6
+ @posts = Post.all
7
+ end
8
+
9
+ # GET /posts/1
10
+ def show
11
+ end
12
+
13
+ # GET /posts/new
14
+ def new
15
+ @post = Post.new
16
+ end
17
+
18
+ # GET /posts/1/edit
19
+ def edit
20
+ end
21
+
22
+ # POST /posts
23
+ def create
24
+ @post = Post.new(post_params)
25
+
26
+ if @post.save
27
+ redirect_to @post, notice: 'Post was successfully created.'
28
+ else
29
+ render :new
30
+ end
31
+ end
32
+
33
+ # PATCH/PUT /posts/1
34
+ def update
35
+ if @post.update(post_params)
36
+ redirect_to @post, notice: 'Post was successfully updated.'
37
+ else
38
+ render :edit
39
+ end
40
+ end
41
+
42
+ # DELETE /posts/1
43
+ def destroy
44
+ @post.destroy
45
+ redirect_to posts_url, notice: 'Post was successfully destroyed.'
46
+ end
47
+
48
+ private
49
+ # Use callbacks to share common setup or constraints between actions.
50
+ def set_post
51
+ @post = Post.find(params[:id])
52
+ end
53
+
54
+ # Only allow a trusted parameter "white list" through.
55
+ def post_params
56
+ params.require(:post).permit(:title, :body, :published)
57
+ end
58
+ end
@@ -0,0 +1,2 @@
1
+ module PostsHelper
2
+ end
@@ -0,0 +1,7 @@
1
+ class ApplicationJob < ActiveJob::Base
2
+ # Automatically retry jobs that encountered a deadlock
3
+ # retry_on ActiveRecord::Deadlocked
4
+
5
+ # Most jobs are safe to ignore if the underlying records are no longer available
6
+ # discard_on ActiveJob::DeserializationError
7
+ end
@@ -0,0 +1,3 @@
1
+ class ApplicationRecord < ActiveRecord::Base
2
+ primary_abstract_class
3
+ end
@@ -0,0 +1,2 @@
1
+ class Post < ApplicationRecord
2
+ end
@@ -0,0 +1,27 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title><%= content_for(:title) || "App" %></title>
5
+ <meta name="viewport" content="width=device-width,initial-scale=1">
6
+ <meta name="apple-mobile-web-app-capable" content="yes">
7
+ <meta name="mobile-web-app-capable" content="yes">
8
+ <%= csrf_meta_tags %>
9
+ <%= csp_meta_tag %>
10
+
11
+ <%= yield :head %>
12
+
13
+ <%# Enable PWA manifest for installable apps (make sure to enable in config/routes.rb too!) %>
14
+ <%#= tag.link rel: "manifest", href: pwa_manifest_path(format: :json) %>
15
+
16
+ <link rel="icon" href="/icon.png" type="image/png">
17
+ <link rel="icon" href="/icon.svg" type="image/svg+xml">
18
+ <link rel="apple-touch-icon" href="/icon.png">
19
+
20
+ <%# Includes all stylesheet files in app/assets/stylesheets %>
21
+ <%= stylesheet_link_tag :app, "data-turbo-track": "reload" %>
22
+ </head>
23
+
24
+ <body>
25
+ <%= yield %>
26
+ </body>
27
+ </html>
@@ -0,0 +1,32 @@
1
+ <%= form_with(model: post, local: true) do |form| %>
2
+ <% if post.errors.any? %>
3
+ <div id="error_explanation">
4
+ <h2><%= pluralize(post.errors.count, "error") %> prohibited this post from being saved:</h2>
5
+
6
+ <ul>
7
+ <% post.errors.full_messages.each do |message| %>
8
+ <li><%= message %></li>
9
+ <% end %>
10
+ </ul>
11
+ </div>
12
+ <% end %>
13
+
14
+ <div class="field">
15
+ <%= form.label :title %>
16
+ <%= form.text_field :title %>
17
+ </div>
18
+
19
+ <div class="field">
20
+ <%= form.label :body %>
21
+ <%= form.text_area :body %>
22
+ </div>
23
+
24
+ <div class="field">
25
+ <%= form.label :published %>
26
+ <%= form.check_box :published %>
27
+ </div>
28
+
29
+ <div class="actions">
30
+ <%= form.submit %>
31
+ </div>
32
+ <% end %>
@@ -0,0 +1,6 @@
1
+ <h1>Editing Post</h1>
2
+
3
+ <%= render 'form', post: @post %>
4
+
5
+ <%= link_to 'Show', @post %> |
6
+ <%= link_to 'Back', posts_path %>
@@ -0,0 +1,31 @@
1
+ <p id="notice"><%= notice %></p>
2
+
3
+ <h1>Posts</h1>
4
+
5
+ <table>
6
+ <thead>
7
+ <tr>
8
+ <th>Title</th>
9
+ <th>Body</th>
10
+ <th>Published</th>
11
+ <th colspan="3"></th>
12
+ </tr>
13
+ </thead>
14
+
15
+ <tbody>
16
+ <% @posts.each do |post| %>
17
+ <tr>
18
+ <td><%= post.title %></td>
19
+ <td><%= post.body %></td>
20
+ <td><%= post.published %></td>
21
+ <td><%= link_to 'Show', post %></td>
22
+ <td><%= link_to 'Edit', edit_post_path(post) %></td>
23
+ <td><%= link_to 'Destroy', post, method: :delete, data: { confirm: 'Are you sure?' } %></td>
24
+ </tr>
25
+ <% end %>
26
+ </tbody>
27
+ </table>
28
+
29
+ <br>
30
+
31
+ <%= link_to 'New Post', new_post_path %>
@@ -0,0 +1,5 @@
1
+ <h1>New Post</h1>
2
+
3
+ <%= render 'form', post: @post %>
4
+
5
+ <%= link_to 'Back', posts_path %>
@@ -0,0 +1,19 @@
1
+ <p id="notice"><%= notice %></p>
2
+
3
+ <p>
4
+ <strong>Title:</strong>
5
+ <%= @post.title %>
6
+ </p>
7
+
8
+ <p>
9
+ <strong>Body:</strong>
10
+ <%= @post.body %>
11
+ </p>
12
+
13
+ <p>
14
+ <strong>Published:</strong>
15
+ <%= @post.published %>
16
+ </p>
17
+
18
+ <%= link_to 'Edit', edit_post_path(@post) %> |
19
+ <%= link_to 'Back', posts_path %>