@@ -84,31 +84,31 @@ def test_ignores_when_aria_labelledby_is_set_on_link_tag
8484 end
8585
8686 def test_warns_when_link_rails_helper_text_is_banned_text
87- @file = "<%= link_to('click here', redirect_url, id: 'redirect' ) %>"
87+ @file = "<%= link_to('click here', redirect_url) %>"
8888 @linter . run ( processed_source )
8989
9090 refute_empty @linter . offenses
9191 end
9292
9393 def test_warns_when_link_rails_helper_text_is_banned_text_with_aria_description
9494 @file = <<~ERB
95- <%= link_to ( 'click here' , 'aria-describedby' : 'element123' , id : 'redirect' ) %>
95+ <%= link_to ( 'click here' , redirect_url , 'aria-describedby' : 'element123' , id : 'redirect' ) %>
9696 ERB
9797 @linter . run ( processed_source )
9898
9999 refute_empty @linter . offenses
100100 end
101101
102102 def test_ignores_when_link_rails_helper_text_is_banned_text_with_aria_labelled_by
103- @file = "<%= link_to('learn more', 'aria-labelledby': 'element1234', id: 'redirect') %>"
103+ @file = "<%= link_to('learn more', redirect_url, 'aria-labelledby': 'element1234', id: 'redirect') %>"
104104 @linter . run ( processed_source )
105105
106106 assert_empty @linter . offenses
107107 end
108108
109109 def test_ignores_when_link_rails_helper_text_is_banned_text_with_aria_label_that_cannot_be_parsed_by_linter
110110 @file = <<~ERB
111- <%= link_to ( 'learn more' , 'aria-label' : some_variable , id : 'redirect' ) %>
111+ <%= link_to ( 'learn more' , redirect_url , 'aria-label' : some_variable , id : 'redirect' ) %>
112112 ERB
113113 @linter . run ( processed_source )
114114
@@ -117,22 +117,22 @@ def test_ignores_when_link_rails_helper_text_is_banned_text_with_aria_label_that
117117
118118 def test_ignores_when_link_rails_helper_text_is_banned_text_with_aria_label_since_cannot_be_parsed_accurately_by_linter
119119 @file = <<~ERB
120- <%= link_to ( 'learn more' , 'aria-label' : "Learn #{ @variable } ", id: 'redirect') %>
120+ <%= link_to ( 'learn more' , redirect_url , 'aria-label' : "Learn #{ @variable } ", id: 'redirect') %>
121121 ERB
122122 @linter . run ( processed_source )
123123
124124 assert_empty @linter . offenses
125125 end
126126
127127 def test_ignores_when_link_rails_helper_text_is_banned_text_with_aria_label
128- @file = "<%= link_to('learn more', 'aria-label': 'learn more about GitHub', id: 'redirect') %>"
128+ @file = "<%= link_to('learn more', redirect_url, 'aria-label': 'learn more about GitHub', id: 'redirect') %>"
129129 @linter . run ( processed_source )
130130
131131 assert_empty @linter . offenses
132132 end
133133
134134 def test_ignores_when_link_rails_helper_text_is_banned_text_with_aria_label_hash
135- @file = "<%= link_to('learn more', aria: { label: 'learn more about GitHub' }, id: 'redirect') %>"
135+ @file = "<%= link_to('learn more', redirect_url, aria: { label: 'learn more about GitHub' }, id: 'redirect') %>"
136136 @linter . run ( processed_source )
137137
138138 assert_empty @linter . offenses
0 commit comments