-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add test coverage for ApplicationHelper
- Loading branch information
1 parent
3a9fb68
commit 4c429c1
Showing
1 changed file
with
19 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
require 'rails_helper' | ||
|
||
RSpec.describe ApplicationHelper, type: :helper do | ||
describe '#icon' do | ||
it 'returns the correct HTML tag with the correct attributes' do | ||
# Arrange | ||
id = 'test' | ||
label = 'Test Label' | ||
|
||
# Act | ||
result = helper.icon(id, label) | ||
|
||
# Assert | ||
expect(result).to eq("<i class=\"bi bi-#{id}\" role=\"img\" aria-label=\"#{label}\" title=\"#{label}\"></i>") | ||
end | ||
end | ||
|
||
# Add similar describe and it blocks for the other methods in the ApplicationHelper module | ||
end |