Skip to content

Commit 0beb36e

Browse files
committed
Merge pull request #2790 from mjankowski/cell-selector-rails-version
Drop support for rails versions < 7 in scaffold generator
1 parent a124bb7 commit 0beb36e

File tree

2 files changed

+2
-6
lines changed

2 files changed

+2
-6
lines changed

lib/generators/rspec/scaffold/templates/index_spec.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
1919
it "renders a list of <%= ns_table_name %>" do
2020
render
21-
cell_selector = <%= Rails::VERSION::STRING >= '7' ? "'div>p'" : "'tr>td'" %>
21+
cell_selector = 'div>p'
2222
<% for attribute in output_attributes -%>
2323
assert_select cell_selector, text: Regexp.new(<%= value_for(attribute) %>.to_s), count: 2
2424
<% end -%>

spec/generators/rspec/scaffold/scaffold_generator_spec.rb

+1-5
Original file line numberDiff line numberDiff line change
@@ -269,11 +269,7 @@
269269
.and(contain(/assign\(:posts, /))
270270
.and(contain(/it "renders a list of (.*)"/))
271271

272-
if ::Rails::VERSION::STRING >= '7.0.0'
273-
expect(filename).to contain(/'div>p'/)
274-
else
275-
expect(filename).to contain(/'tr>td'/)
276-
end
272+
expect(filename).to contain(/'div>p'/)
277273
end
278274
end
279275

0 commit comments

Comments
 (0)