rspec-rails 3.8.2 → 7.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (89) hide show
  1. checksums.yaml +4 -4
  2. checksums.yaml.gz.sig +0 -0
  3. data/Capybara.md +5 -54
  4. data/Changelog.md +440 -76
  5. data/README.md +281 -500
  6. data/lib/generators/rspec/channel/channel_generator.rb +12 -0
  7. data/lib/generators/rspec/{observer/templates/observer_spec.rb → channel/templates/channel_spec.rb.erb} +1 -1
  8. data/lib/generators/rspec/controller/controller_generator.rb +24 -7
  9. data/lib/generators/rspec/controller/templates/request_spec.rb +19 -0
  10. data/lib/generators/rspec/controller/templates/routing_spec.rb +13 -0
  11. data/lib/generators/rspec/feature/feature_generator.rb +3 -3
  12. data/lib/generators/rspec/generator/generator_generator.rb +24 -0
  13. data/lib/generators/rspec/generator/templates/generator_spec.rb +5 -0
  14. data/lib/generators/rspec/helper/helper_generator.rb +2 -2
  15. data/lib/generators/rspec/install/install_generator.rb +23 -6
  16. data/lib/generators/rspec/install/templates/spec/rails_helper.rb +32 -17
  17. data/lib/generators/rspec/job/job_generator.rb +2 -1
  18. data/lib/generators/rspec/job/templates/job_spec.rb.erb +1 -1
  19. data/lib/generators/rspec/mailbox/mailbox_generator.rb +14 -0
  20. data/lib/generators/rspec/mailbox/templates/mailbox_spec.rb.erb +7 -0
  21. data/lib/generators/rspec/mailer/mailer_generator.rb +7 -4
  22. data/lib/generators/rspec/mailer/templates/mailer_spec.rb +2 -2
  23. data/lib/generators/rspec/mailer/templates/preview.rb +4 -4
  24. data/lib/generators/rspec/model/model_generator.rb +8 -7
  25. data/lib/generators/rspec/model/templates/fixtures.yml +1 -1
  26. data/lib/generators/rspec/request/request_generator.rb +10 -3
  27. data/lib/generators/rspec/scaffold/scaffold_generator.rb +36 -22
  28. data/lib/generators/rspec/scaffold/templates/api_controller_spec.rb +13 -49
  29. data/lib/generators/rspec/scaffold/templates/api_request_spec.rb +131 -0
  30. data/lib/generators/rspec/scaffold/templates/controller_spec.rb +14 -62
  31. data/lib/generators/rspec/scaffold/templates/edit_spec.rb +9 -9
  32. data/lib/generators/rspec/scaffold/templates/index_spec.rb +3 -2
  33. data/lib/generators/rspec/scaffold/templates/new_spec.rb +2 -6
  34. data/lib/generators/rspec/scaffold/templates/request_spec.rb +138 -0
  35. data/lib/generators/rspec/scaffold/templates/routing_spec.rb +8 -10
  36. data/lib/generators/rspec/scaffold/templates/show_spec.rb +2 -2
  37. data/lib/generators/rspec/system/system_generator.rb +24 -0
  38. data/lib/generators/rspec/system/templates/system_spec.rb +9 -0
  39. data/lib/generators/rspec/view/view_generator.rb +4 -4
  40. data/lib/generators/rspec.rb +16 -5
  41. data/lib/rspec/rails/adapters.rb +22 -76
  42. data/lib/rspec/rails/configuration.rb +112 -38
  43. data/lib/rspec/rails/example/channel_example_group.rb +93 -0
  44. data/lib/rspec/rails/example/controller_example_group.rb +5 -4
  45. data/lib/rspec/rails/example/feature_example_group.rb +6 -26
  46. data/lib/rspec/rails/example/helper_example_group.rb +2 -9
  47. data/lib/rspec/rails/example/mailbox_example_group.rb +80 -0
  48. data/lib/rspec/rails/example/mailer_example_group.rb +2 -2
  49. data/lib/rspec/rails/example/rails_example_group.rb +7 -1
  50. data/lib/rspec/rails/example/request_example_group.rb +1 -4
  51. data/lib/rspec/rails/example/routing_example_group.rb +0 -2
  52. data/lib/rspec/rails/example/system_example_group.rb +88 -16
  53. data/lib/rspec/rails/example/view_example_group.rb +40 -28
  54. data/lib/rspec/rails/example.rb +2 -0
  55. data/lib/rspec/rails/extensions/active_record/proxy.rb +5 -10
  56. data/lib/rspec/rails/feature_check.rb +16 -29
  57. data/lib/rspec/rails/file_fixture_support.rb +11 -10
  58. data/lib/rspec/rails/fixture_file_upload_support.rb +20 -15
  59. data/lib/rspec/rails/fixture_support.rb +64 -34
  60. data/lib/rspec/rails/matchers/action_cable/have_broadcasted_to.rb +173 -0
  61. data/lib/rspec/rails/matchers/action_cable/have_streams.rb +58 -0
  62. data/lib/rspec/rails/matchers/action_cable.rb +65 -0
  63. data/lib/rspec/rails/matchers/action_mailbox.rb +73 -0
  64. data/lib/rspec/rails/matchers/active_job.rb +224 -24
  65. data/lib/rspec/rails/matchers/base_matcher.rb +179 -0
  66. data/lib/rspec/rails/matchers/be_a_new.rb +1 -1
  67. data/lib/rspec/rails/matchers/be_new_record.rb +1 -1
  68. data/lib/rspec/rails/matchers/be_valid.rb +1 -1
  69. data/lib/rspec/rails/matchers/have_enqueued_mail.rb +258 -0
  70. data/lib/rspec/rails/matchers/have_http_status.rb +23 -32
  71. data/lib/rspec/rails/matchers/have_rendered.rb +2 -1
  72. data/lib/rspec/rails/matchers/redirect_to.rb +1 -1
  73. data/lib/rspec/rails/matchers/relation_match_array.rb +1 -1
  74. data/lib/rspec/rails/matchers/routing_matchers.rb +13 -13
  75. data/lib/rspec/rails/matchers/send_email.rb +122 -0
  76. data/lib/rspec/rails/matchers.rb +12 -0
  77. data/lib/rspec/rails/tasks/rspec.rake +9 -17
  78. data/lib/rspec/rails/vendor/capybara.rb +10 -17
  79. data/lib/rspec/rails/version.rb +1 -1
  80. data/lib/rspec/rails/view_assigns.rb +0 -18
  81. data/lib/rspec/rails/view_path_builder.rb +1 -1
  82. data/lib/rspec/rails/view_rendering.rb +20 -7
  83. data/lib/rspec-rails.rb +36 -18
  84. data.tar.gz.sig +0 -0
  85. metadata +55 -37
  86. metadata.gz.sig +0 -0
  87. data/lib/generators/rspec/integration/integration_generator.rb +0 -22
  88. data/lib/generators/rspec/observer/observer_generator.rb +0 -13
  89. /data/lib/generators/rspec/{integration → request}/templates/request_spec.rb +0 -0
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: edce77d0d2b773c93324d304106851437971402da3cb8f09cfcd95e0b8aaa043
4
- data.tar.gz: 42c45cdb32667e36ed9e9ae99f833f1f7dcb5c23d0b4daae5b8dd71f2f05928c
3
+ metadata.gz: e5f52b2377b281190553090f208b2d03f030aefb03395fb46afd8af1c63df3a1
4
+ data.tar.gz: 1a7c088f8ee631d5f9756277724554ccc30247719849a1dd0b6d03bfd8279e11
5
5
  SHA512:
6
- metadata.gz: 1d60c04fdfd11a5010b305a5d7af91335d683d027b5c48ea53446b6ae4b9c5388f23007131f6c0bbdf81251670caa7c61c158ce14815b211ca300c4cc545ac61
7
- data.tar.gz: b7d2efcaa5241e0a5a04079f121465426710f3690e8b900a76e6ff43bb71a682ae2072a23b8a80ca079b326a3be55f17c2fd8f97497725f209d10992c78b9e40
6
+ metadata.gz: 5dbf49c52a590a8ce6d91ced03bfc78ebeb4737b8cfcc11932e8959b38c0428eca4414da31a82172ca965db65fed36e490e8c85e761f1fed0f2ef555b9b75210
7
+ data.tar.gz: c47326924297943c4d0704f3da54f8ef13a849a73d3a023405cf290347698c0b486a8c692a8774cc022bbf92a80c424197bca1d44a1cd46c1a613cb0ffca3e79
checksums.yaml.gz.sig CHANGED
Binary file
data/Capybara.md CHANGED
@@ -1,58 +1,19 @@
1
1
  rspec-rails supports integration with Capybara out of the box by adding
2
2
  its Capybara::DSL (visit/page) and Capybara::RSpecMatchers to the
3
- examples in the applicable directories, which differ slightly between
4
- Capybara 1.x and Capybara >= 2.x.
3
+ examples in the applicable directories.
5
4
 
6
5
  ## Capybara::DSL
7
6
 
8
7
  Adds the `visit` and `page` methods, which work together to simulate a
9
8
  GET request and provide access to the result (via `page`).
10
9
 
11
- ## Capybara::RSpecMatchers
12
-
13
- Exposes matchers used to specify expected HTML content (e.g. `should_not have_selector` will work correctly).
14
-
15
- ## Capybara 1.x
16
-
17
- Capybara::DSL is added to examples in:
18
-
19
- * spec/requests # included by Capybara
20
- * spec/controllers
21
-
22
- Capybara::RSpecMatchers is added to examples in:
23
-
24
- * spec/requests # included by Capybara
25
- * spec/controllers
26
- * spec/views
27
- * spec/helpers
28
- * spec/mailers
29
-
30
- ## Capybara 2.0
31
-
32
- To use Capybara 2.0, you need rspec-rails-2.11.1 or greater.
33
-
34
10
  Capybara::DSL is added to examples in:
35
11
 
36
12
  * spec/features
37
13
 
38
- Capybara::RSpecMatchers is added to examples in:
39
-
40
- * spec/features
41
- * spec/controllers
42
- * spec/views
43
- * spec/helpers
44
- * spec/mailers
45
-
46
- ## Upgrading to Capybara-2.0
47
-
48
- Many users have been confused by the co-existence of the the
49
- Capybara::DSL (visit/page) alongside the rack-test DSL
50
- (get|post|put|delete|head/response.body) in examples in spec/requests
51
- and spec/controllers. As of rspec-rails-2.11.1 and capybara-2.0.0.beta2, these
52
- are separated as follows:
14
+ ## Capybara::RSpecMatchers
53
15
 
54
- * Capybara::DSL is included `spec/features`
55
- * rack-test DSL is included in `spec/requests` and `spec/controllers`
16
+ Exposes matchers used to specify expected HTML content (e.g. `should_not have_selector` will work correctly).
56
17
 
57
18
  Capybara::RSpecMatchers is added to examples in:
58
19
 
@@ -62,16 +23,6 @@ Capybara::RSpecMatchers is added to examples in:
62
23
  * spec/helpers
63
24
  * spec/mailers
64
25
 
65
- If you're upgrading to Capybara-2.0 and you used visit/page in
66
- spec/requests you'll want to move those examples to spec/features and
67
- they should just work.
68
-
69
- If you want to leave those examples in spec/requests, you can include
70
- Capybara::DSL in those examples yourself as follows, but this is
71
- absolutely not recommended as you will be overriding the intended
72
- behavior and accepting the risks associated with doing so:
26
+ ## Upgrading to Capybara-3.x
73
27
 
74
- # not recommended!
75
- RSpec.configure do |c|
76
- c.include Capybara::DSL, :file_path => "spec/requests"
77
- end
28
+ Consult the official [Upgrading from Capybara 2.x to 3.x](https://github.com/teamcapybara/capybara/blob/master/UPGRADING.md#upgrading-from-capybara-2x-to-3x) guide.