rspec-rails 7.0.0 → 7.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e12619053ed39f2f0fed4bc0aed2b2e552e400315663632d97cf9a82e2eaa5d3
4
- data.tar.gz: 7bde5b94d9f990a0d9d08143529ce3e25b9df1df2cf62c216515c0cc6e96cd4c
3
+ metadata.gz: e5f52b2377b281190553090f208b2d03f030aefb03395fb46afd8af1c63df3a1
4
+ data.tar.gz: 1a7c088f8ee631d5f9756277724554ccc30247719849a1dd0b6d03bfd8279e11
5
5
  SHA512:
6
- metadata.gz: fa5533f32e4ffaf30b13d83677aff9170bf57c42a2c6ec9a591de3f422f73f719a6b575fb14efe8e54f7b8fbc389aa7c7e0f39710017dc8b02834f8dbb6b0aa3
7
- data.tar.gz: '094c02d867dba7258ea54da266403929508f2601c0ba1e8a8c579e01c6a2b200aaa688b5a8fed58145c2bf6cd53ed4799fecba36dc9acdb23e06d75eea5b2323'
6
+ metadata.gz: 5dbf49c52a590a8ce6d91ced03bfc78ebeb4737b8cfcc11932e8959b38c0428eca4414da31a82172ca965db65fed36e490e8c85e761f1fed0f2ef555b9b75210
7
+ data.tar.gz: c47326924297943c4d0704f3da54f8ef13a849a73d3a023405cf290347698c0b486a8c692a8774cc022bbf92a80c424197bca1d44a1cd46c1a613cb0ffca3e79
checksums.yaml.gz.sig CHANGED
Binary file
data/Changelog.md CHANGED
@@ -1,5 +1,15 @@
1
1
  ### Development
2
- [Full Changelog](https://github.com/rspec/rspec-rails/compare/v7.0.0...7-0-maintenance)
2
+ [Full Changelog](https://github.com/rspec/rspec-rails/compare/v7.0.1...7-0-maintenance)
3
+
4
+ ### 7.0.1 / 2024-09-03
5
+ [Full Changelog](https://github.com/rspec/rspec-rails/compare/v7.0.0...v7.0.1)
6
+
7
+ Bug Fixes:
8
+
9
+ * Remove mutation of Rails constant in favour of public api. (Petrik de Heus, #2789)
10
+ * Cleanup Rails scaffold for unsupported versions. (Matt Jankowski, #2790)
11
+ * Remove deprecated scaffold that was unintentionally included in 7.0.0
12
+ (Jon Rowe, #2791)
3
13
 
4
14
  ### 7.0.0 / 2024-09-02
5
15
  [Full Changelog](https://github.com/rspec/rspec-rails/compare/v6.1.5...v7.0.0)
@@ -90,17 +90,10 @@ RSpec.describe <%= controller_class_name %>Controller, <%= type_metatag(:control
90
90
  end
91
91
 
92
92
  context "with invalid params" do
93
- <% if Rails.version.to_f < 7.0 %>
94
- it "returns a success response (i.e. to display the 'new' template)" do
95
- post :create, params: {<%= singular_table_name %>: invalid_attributes}, session: valid_session
96
- expect(response).to be_successful
97
- end
98
- <% else %>
99
93
  it "renders a response with 422 status (i.e. to display the 'new' template)" do
100
94
  post :create, params: {<%= singular_table_name %>: invalid_attributes}, session: valid_session
101
95
  expect(response).to have_http_status(:unprocessable_entity)
102
96
  end
103
- <% end %>
104
97
  end
105
98
  end
106
99
 
@@ -125,19 +118,11 @@ RSpec.describe <%= controller_class_name %>Controller, <%= type_metatag(:control
125
118
  end
126
119
 
127
120
  context "with invalid params" do
128
- <% if Rails.version.to_f < 7.0 %>
129
- it "returns a success response (i.e. to display the 'edit' template)" do
130
- <%= file_name %> = <%= class_name %>.create! valid_attributes
131
- put :update, params: {id: <%= file_name %>.to_param, <%= singular_table_name %>: invalid_attributes}, session: valid_session
132
- expect(response).to be_successful
133
- end
134
- <% else %>
135
121
  it "renders a response with 422 status (i.e. to display the 'edit' template)" do
136
122
  <%= file_name %> = <%= class_name %>.create! valid_attributes
137
123
  put :update, params: {id: <%= file_name %>.to_param, <%= singular_table_name %>: invalid_attributes}, session: valid_session
138
124
  expect(response).to have_http_status(:unprocessable_entity)
139
125
  end
140
- <% end %>
141
126
  end
142
127
  end
143
128
 
@@ -18,7 +18,7 @@ RSpec.describe "<%= ns_table_name %>/index", <%= type_metatag(:view) %> do
18
18
 
19
19
  it "renders a list of <%= ns_table_name %>" do
20
20
  render
21
- cell_selector = <%= Rails::VERSION::STRING >= '7' ? "'div>p'" : "'tr>td'" %>
21
+ cell_selector = 'div>p'
22
22
  <% for attribute in output_attributes -%>
23
23
  assert_select cell_selector, text: Regexp.new(<%= value_for(attribute) %>.to_s), count: 2
24
24
  <% end -%>
@@ -83,17 +83,10 @@ RSpec.describe "/<%= name.underscore.pluralize %>", <%= type_metatag(:request) %
83
83
  }.to change(<%= class_name %>, :count).by(0)
84
84
  end
85
85
 
86
- <% if Rails.version.to_f < 7.0 %>
87
- it "renders a successful response (i.e. to display the 'new' template)" do
88
- post <%= index_helper %>_url, params: { <%= singular_table_name %>: invalid_attributes }
89
- expect(response).to be_successful
90
- end
91
- <% else %>
92
86
  it "renders a response with 422 status (i.e. to display the 'new' template)" do
93
87
  post <%= index_helper %>_url, params: { <%= singular_table_name %>: invalid_attributes }
94
88
  expect(response).to have_http_status(:unprocessable_entity)
95
89
  end
96
- <% end %>
97
90
  end
98
91
  end
99
92
 
@@ -119,19 +112,11 @@ RSpec.describe "/<%= name.underscore.pluralize %>", <%= type_metatag(:request) %
119
112
  end
120
113
 
121
114
  context "with invalid parameters" do
122
- <% if Rails.version.to_f < 7.0 %>
123
- it "renders a successful response (i.e. to display the 'edit' template)" do
124
- <%= file_name %> = <%= class_name %>.create! valid_attributes
125
- patch <%= show_helper %>, params: { <%= singular_table_name %>: invalid_attributes }
126
- expect(response).to be_successful
127
- end
128
- <% else %>
129
115
  it "renders a response with 422 status (i.e. to display the 'edit' template)" do
130
116
  <%= file_name %> = <%= class_name %>.create! valid_attributes
131
117
  patch <%= show_helper %>, params: { <%= singular_table_name %>: invalid_attributes }
132
118
  expect(response).to have_http_status(:unprocessable_entity)
133
119
  end
134
- <% end %>
135
120
  end
136
121
  end
137
122
 
@@ -2,10 +2,8 @@
2
2
  # suite and ammeter.
3
3
  require 'rspec/rails/matchers'
4
4
 
5
- if ::Rails::VERSION::MAJOR >= 7
6
- require 'active_support/current_attributes/test_helper'
7
- require 'active_support/execution_context/test_helper'
8
- end
5
+ require 'active_support/current_attributes/test_helper'
6
+ require 'active_support/execution_context/test_helper'
9
7
 
10
8
  module RSpec
11
9
  module Rails
@@ -17,11 +15,9 @@ module RSpec
17
15
  include RSpec::Rails::MinitestLifecycleAdapter
18
16
  include RSpec::Rails::MinitestAssertionAdapter
19
17
  include RSpec::Rails::FixtureSupport
20
- if ::Rails::VERSION::MAJOR >= 7
21
- include RSpec::Rails::TaggedLoggingAdapter
22
- include ActiveSupport::CurrentAttributes::TestHelper
23
- include ActiveSupport::ExecutionContext::TestHelper
24
- end
18
+ include RSpec::Rails::TaggedLoggingAdapter
19
+ include ActiveSupport::CurrentAttributes::TestHelper
20
+ include ActiveSupport::ExecutionContext::TestHelper
25
21
  end
26
22
  end
27
23
  end
@@ -3,7 +3,7 @@ module RSpec
3
3
  # Version information for RSpec Rails.
4
4
  module Version
5
5
  # Current version of RSpec Rails, in semantic versioning format.
6
- STRING = '7.0.0'
6
+ STRING = '7.0.1'
7
7
  end
8
8
  end
9
9
  end
data/lib/rspec-rails.rb CHANGED
@@ -22,8 +22,7 @@ module RSpec
22
22
  Hash[dirs.map { |d| [d.split('/').last, d] }].each do |type, dir|
23
23
  name = type.singularize.capitalize
24
24
 
25
- ::Rails::CodeStatistics.register_directory "#{name} specs", dir
26
- ::Rails::CodeStatistics::TEST_TYPES << "#{name} specs"
25
+ ::Rails::CodeStatistics.register_directory "#{name} specs", dir, test_directory: true
27
26
  end
28
27
  end
29
28
 
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rspec-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 7.0.0
4
+ version: 7.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Chelimsky
@@ -44,7 +44,7 @@ cert_chain:
44
44
  ZsVDj6a7lH3cNqtWXZxrb2wO38qV5AkYj8SQK7Hj3/Yui9myUX3crr+PdetazSqQ
45
45
  F3MdtaDehhjC
46
46
  -----END CERTIFICATE-----
47
- date: 2024-09-02 00:00:00.000000000 Z
47
+ date: 2024-09-03 00:00:00.000000000 Z
48
48
  dependencies:
49
49
  - !ruby/object:Gem::Dependency
50
50
  name: actionpack
@@ -215,7 +215,6 @@ files:
215
215
  - lib/generators/rspec/helper/templates/helper_spec.rb
216
216
  - lib/generators/rspec/install/install_generator.rb
217
217
  - lib/generators/rspec/install/templates/spec/rails_helper.rb
218
- - lib/generators/rspec/integration/integration_generator.rb
219
218
  - lib/generators/rspec/job/job_generator.rb
220
219
  - lib/generators/rspec/job/templates/job_spec.rb.erb
221
220
  - lib/generators/rspec/mailbox/mailbox_generator.rb
@@ -297,7 +296,7 @@ licenses:
297
296
  - MIT
298
297
  metadata:
299
298
  bug_tracker_uri: https://github.com/rspec/rspec-rails/issues
300
- changelog_uri: https://github.com/rspec/rspec-rails/blob/v7.0.0/Changelog.md
299
+ changelog_uri: https://github.com/rspec/rspec-rails/blob/v7.0.1/Changelog.md
301
300
  documentation_uri: https://rspec.info/documentation/
302
301
  mailing_list_uri: https://groups.google.com/forum/#!forum/rspec
303
302
  source_code_uri: https://github.com/rspec/rspec-rails
metadata.gz.sig CHANGED
Binary file
@@ -1,29 +0,0 @@
1
- require 'generators/rspec'
2
- require 'rspec/core/warnings'
3
-
4
- module Rspec
5
- module Generators
6
- # @private
7
- class IntegrationGenerator < Base
8
- class_option :request_specs,
9
- type: :boolean,
10
- default: true,
11
- desc: "Generate request specs"
12
-
13
- source_paths << File.expand_path('../request/templates', __dir__)
14
-
15
- def generate_request_spec
16
- return unless options[:request_specs]
17
-
18
- RSpec.warn_deprecation <<-WARNING.gsub(/\s*\|/, ' ')
19
- |The integration generator is deprecated
20
- |and will be deleted in RSpec-Rails 7.
21
- |Please use the request generator instead.
22
- WARNING
23
-
24
- template 'request_spec.rb',
25
- target_path('requests', "#{name.underscore.pluralize}_spec.rb")
26
- end
27
- end
28
- end
29
- end