rspec / rspec-rails

RSpec for Rails 6+
https://rspec.info
MIT License
5.19k stars 1.04k forks source link

Extract `cell_selector` method in scaffold index view spec generator #2777

Closed mjankowski closed 3 months ago

mjankowski commented 3 months ago

Basically same change as described in https://github.com/rspec/rspec-rails/pull/2619 - re-attempting only because of last comment - https://github.com/rspec/rspec-rails/pull/2619#issuecomment-1250240003 - which seemed to indicate a desire to get the logic into the generator and out of the generated spec file.

I read the linked discussion and it wasn't totally clear to me which portions involved people talking slightly past each other (about CI vs developer env) and which were genuine issues (that I may have not resolved here, if they exist?) so apologies if that's the case, and I can close and/or attempt to resolve. From my current understanding this does seem safe -- in CI environments or dev environments for working on rspec-rails itself, you'd presumably either have a fresh/clean run and/or clobber first and it should be ok; and for local rails-app development, if you had a prior-version generated spec+view they'd work in conjunction with each other, and this would continue to be true if you switched versions and started generating new ones, I think?

I agree with one of the comments in the linked discussion about how you would likely change this value pretty early on, but also that having the rails version conditional in the generated spec is slightly confusing when you first see it.

pirj commented 3 months ago

Thank you, @mjankowski !

JonRowe commented 3 months ago

Released in 6.1.4