Add and apply Capybara/RSpec/HaveSelector rule
This rule was added in rubocop-capybara 2.19.0. We were following it about 85% of the time. Now we won't have to check both have_css and have_selector when searching the code.
This commit is contained in:
@@ -201,8 +201,8 @@ shared_examples "mappable" do |mappable_factory_name, mappable_association_name,
|
||||
mappable.reload
|
||||
|
||||
expect(page).to have_css(".map-location")
|
||||
expect(page).not_to have_selector(".map-location[data-marker-latitude='#{map_location.latitude}']")
|
||||
expect(page).to have_selector(".map-location[data-marker-latitude='#{mappable.map_location.latitude}']")
|
||||
expect(page).not_to have_css ".map-location[data-marker-latitude='#{map_location.latitude}']"
|
||||
expect(page).to have_css ".map-location[data-marker-latitude='#{mappable.map_location.latitude}']"
|
||||
end
|
||||
|
||||
scenario "Should edit mappable on #{mappable_factory_name} without change map" do
|
||||
@@ -214,8 +214,8 @@ shared_examples "mappable" do |mappable_factory_name, mappable_association_name,
|
||||
mappable.reload
|
||||
|
||||
expect(page).to have_css(".map-location")
|
||||
expect(page).to have_selector(".map-location[data-marker-latitude='#{map_location.latitude}']")
|
||||
expect(page).to have_selector(".map-location[data-marker-latitude='#{mappable.map_location.latitude}']")
|
||||
expect(page).to have_css ".map-location[data-marker-latitude='#{map_location.latitude}']"
|
||||
expect(page).to have_css ".map-location[data-marker-latitude='#{mappable.map_location.latitude}']"
|
||||
end
|
||||
|
||||
scenario "Can not display map on #{mappable_factory_name} edit when remove map marker" do
|
||||
|
||||
Reference in New Issue
Block a user