rspec-rails 3.7.0 → 4.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (81) hide show
  1. checksums.yaml +5 -5
  2. checksums.yaml.gz.sig +0 -0
  3. data/Capybara.md +5 -54
  4. data/Changelog.md +259 -70
  5. data/README.md +265 -496
  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 +21 -4
  9. data/lib/generators/rspec/controller/templates/request_spec.rb +14 -0
  10. data/lib/generators/rspec/controller/templates/routing_spec.rb +13 -0
  11. data/lib/generators/rspec/feature/feature_generator.rb +4 -4
  12. data/lib/generators/rspec/generator/generator_generator.rb +24 -0
  13. data/lib/generators/rspec/generator/templates/generator_spec.rb +6 -0
  14. data/lib/generators/rspec/helper/helper_generator.rb +1 -1
  15. data/lib/generators/rspec/install/install_generator.rb +4 -4
  16. data/lib/generators/rspec/install/templates/spec/rails_helper.rb +25 -12
  17. data/lib/generators/rspec/integration/integration_generator.rb +4 -4
  18. data/lib/generators/rspec/integration/templates/request_spec.rb +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 +2 -1
  22. data/lib/generators/rspec/mailer/templates/preview.rb +1 -1
  23. data/lib/generators/rspec/model/model_generator.rb +6 -5
  24. data/lib/generators/rspec/model/templates/fixtures.yml +1 -1
  25. data/lib/generators/rspec/request/request_generator.rb +1 -1
  26. data/lib/generators/rspec/scaffold/scaffold_generator.rb +43 -23
  27. data/lib/generators/rspec/scaffold/templates/api_controller_spec.rb +2 -38
  28. data/lib/generators/rspec/scaffold/templates/api_request_spec.rb +131 -0
  29. data/lib/generators/rspec/scaffold/templates/controller_spec.rb +17 -17
  30. data/lib/generators/rspec/scaffold/templates/edit_spec.rb +1 -1
  31. data/lib/generators/rspec/scaffold/templates/index_spec.rb +2 -2
  32. data/lib/generators/rspec/scaffold/templates/new_spec.rb +1 -1
  33. data/lib/generators/rspec/scaffold/templates/request_spec.rb +133 -0
  34. data/lib/generators/rspec/scaffold/templates/routing_spec.rb +10 -13
  35. data/lib/generators/rspec/scaffold/templates/show_spec.rb +1 -1
  36. data/lib/generators/rspec/system/system_generator.rb +26 -0
  37. data/lib/generators/rspec/system/templates/system_spec.rb +9 -0
  38. data/lib/generators/rspec/view/view_generator.rb +2 -2
  39. data/lib/generators/rspec.rb +0 -6
  40. data/lib/rspec/rails/adapters.rb +11 -76
  41. data/lib/rspec/rails/configuration.rb +47 -36
  42. data/lib/rspec/rails/example/channel_example_group.rb +93 -0
  43. data/lib/rspec/rails/example/controller_example_group.rb +4 -4
  44. data/lib/rspec/rails/example/feature_example_group.rb +6 -26
  45. data/lib/rspec/rails/example/helper_example_group.rb +2 -9
  46. data/lib/rspec/rails/example/mailbox_example_group.rb +80 -0
  47. data/lib/rspec/rails/example/mailer_example_group.rb +1 -1
  48. data/lib/rspec/rails/example/rails_example_group.rb +1 -1
  49. data/lib/rspec/rails/example/system_example_group.rb +96 -60
  50. data/lib/rspec/rails/example/view_example_group.rb +47 -28
  51. data/lib/rspec/rails/example.rb +3 -3
  52. data/lib/rspec/rails/extensions/active_record/proxy.rb +1 -9
  53. data/lib/rspec/rails/feature_check.rb +12 -29
  54. data/lib/rspec/rails/fixture_file_upload_support.rb +40 -0
  55. data/lib/rspec/rails/fixture_support.rb +37 -31
  56. data/lib/rspec/rails/matchers/action_cable/have_broadcasted_to.rb +170 -0
  57. data/lib/rspec/rails/matchers/action_cable/have_streams.rb +58 -0
  58. data/lib/rspec/rails/matchers/action_cable.rb +65 -0
  59. data/lib/rspec/rails/matchers/action_mailbox.rb +64 -0
  60. data/lib/rspec/rails/matchers/active_job.rb +180 -22
  61. data/lib/rspec/rails/matchers/base_matcher.rb +179 -0
  62. data/lib/rspec/rails/matchers/be_a_new.rb +1 -1
  63. data/lib/rspec/rails/matchers/be_new_record.rb +1 -1
  64. data/lib/rspec/rails/matchers/be_valid.rb +1 -1
  65. data/lib/rspec/rails/matchers/have_enqueued_mail.rb +198 -0
  66. data/lib/rspec/rails/matchers/have_http_status.rb +34 -13
  67. data/lib/rspec/rails/matchers/have_rendered.rb +2 -1
  68. data/lib/rspec/rails/matchers/redirect_to.rb +1 -1
  69. data/lib/rspec/rails/matchers/routing_matchers.rb +14 -14
  70. data/lib/rspec/rails/matchers.rb +11 -0
  71. data/lib/rspec/rails/tasks/rspec.rake +7 -17
  72. data/lib/rspec/rails/vendor/capybara.rb +10 -15
  73. data/lib/rspec/rails/version.rb +1 -1
  74. data/lib/rspec/rails/view_path_builder.rb +1 -1
  75. data/lib/rspec/rails/view_rendering.rb +16 -5
  76. data/lib/rspec/rails.rb +1 -0
  77. data/lib/rspec-rails.rb +13 -10
  78. data.tar.gz.sig +0 -0
  79. metadata +55 -33
  80. metadata.gz.sig +0 -0
  81. data/lib/generators/rspec/observer/observer_generator.rb +0 -13
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: af8e2712271eef87e27c945e5d3752b46c0c6c44
4
- data.tar.gz: f7a2803d48fd6e3130f2e3a3acccd083d13e615b
2
+ SHA256:
3
+ metadata.gz: 8e8f5dabd4f5335dc409c77670d7aef552636874486111f105613d54e4270375
4
+ data.tar.gz: 72f211f8667a1d6faedaa8e02877958ccd742c5591107ed568a620fc38999c55
5
5
  SHA512:
6
- metadata.gz: 7246455923effd2d777053e85788a72d979528422466821432257dc1d564c8ec2206f51199d2846dd66b7d201723d5c4e6405bc588321f8bd3c09c13f4a7c0e9
7
- data.tar.gz: ee14397f82807074ac6c979272083d336ca8e76f1a62d1dee8dfcc41d3856a7a0c9f4e09e7be54eede82dee4da609bc75ae7cb5b813d977040e5f4c6dd870494
6
+ metadata.gz: a4125a040fcc9d7b1e9d8ee802f2d9ad75bc581a3e9263c329db8ddaccfd49988ccaab066c0aebad50e3b78a99d0ebe22e04a9648e44f6e1284325ea112e4c63
7
+ data.tar.gz: e08c9439828c7f1b2f3ec543ea72d554f92d79adde6cb01e19d8486c3fc64887432239d1159d4aea7a6b8811cd4f3aaff811b777b3dff80569facfaa38ede625
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.