Skip to content

Commit

Permalink
sketch spec approach
Browse files Browse the repository at this point in the history
Example how the whole spec suite could be run three times for the
different implementations.

Alternatively, a very restricted set (2 or 3 examples) could be
used for the sister implementations, with the trust coming
from the correct well-speced implementation of link_to .
  • Loading branch information
fwolfst committed May 30, 2024
1 parent 8cdb578 commit 70db8e4
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions spec/rubocop/cop/rails/link_to_blank_spec.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,18 @@
# frozen_string_literal: true

RSpec.describe RuboCop::Cop::Rails::LinkToBlank, :config do
['link_to', 'link_to_if condition?, ', 'link_to_unless condition?, '].each do |link_helper_method|
context "with '#{link_helper_method}'" do
context 'when not using target _blank' do
it 'does not register an offense' do
expect_no_offenses(<<~RUBY)
#{link_helper_method} 'Click here', 'https://www.example.com'
RUBY
end
end
end
end

context 'when not using target _blank' do
it 'does not register an offense' do
expect_no_offenses(<<~RUBY)
Expand Down

0 comments on commit 70db8e4

Please sign in to comment.