Skip to content

Commit

Permalink
fix: rename apple-icon -> apple-touch-icon
Browse files Browse the repository at this point in the history
  • Loading branch information
StephenHulme committed Nov 14, 2023
1 parent 489255e commit 8445c19
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 17 deletions.
8 changes: 4 additions & 4 deletions app/helpers/application_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,9 @@ def favicon
"favicon#{icon_suffix}.ico"
end

# Return the appropriate apple icon for the current environment
# @return [String] The path to the apple icon
def apple_icon
"apple-icon#{icon_suffix}.png"
# Return the appropriate apple-touch-icon for the current environment
# @return [String] The path to the apple-touch-icon
def apple_touch_icon
"apple-touch-icon#{icon_suffix}.png"
end
end
2 changes: 1 addition & 1 deletion app/views/layouts/application.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<script>$.fx.off = true;</script>
<% end %>

<link rel="apple-touch-icon" sizes="180x180" href="/<%= apple_icon %>" />
<link rel="apple-touch-icon" sizes="180x180" href="/<%= apple_touch_icon %>" />
<link rel="icon" sizes="32x32" href="/icon32.png" />
<link rel="icon" sizes="16x16" href="/icon16.png" />
<link rel="shortcut icon" href="/<%= favicon %>" type="image/x-icon" />
Expand Down
24 changes: 12 additions & 12 deletions spec/helpers/application_helper_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,32 +32,32 @@
end
end

describe '#apple_icon' do
subject(:apple_icon) { helper.apple_icon }
describe '#apple_touch_icon' do
subject(:apple_touch_icon) { helper.apple_touch_icon }

it 'returns the apple icon path for the production environment' do
it 'returns the apple-touch-icon path for the production environment' do
allow(Rails).to receive(:env).and_return('production')
expect(apple_icon).to eq('apple-icon.png')
expect(apple_touch_icon).to eq('apple-touch-icon.png')
end

it 'returns the apple icon path for the training environment' do
it 'returns the apple-touch-icon path for the training environment' do
allow(Rails).to receive(:env).and_return('training')
expect(apple_icon).to eq('apple-icon-training.png')
expect(apple_touch_icon).to eq('apple-touch-icon-training.png')
end

it 'returns the apple icon path for the staging environment' do
it 'returns the apple-touch-icon path for the staging environment' do
allow(Rails).to receive(:env).and_return('staging')
expect(apple_icon).to eq('apple-icon-staging.png')
expect(apple_touch_icon).to eq('apple-touch-icon-staging.png')
end

it 'returns the apple icon path for the development environment' do
it 'returns the apple-touch-icon path for the development environment' do
allow(Rails).to receive(:env).and_return('development')
expect(apple_icon).to eq('apple-icon-development.png')
expect(apple_touch_icon).to eq('apple-touch-icon-development.png')
end

it 'returns the apple icon path for an unknown environment' do
it 'returns the apple-touch-icon path for an unknown environment' do
allow(Rails).to receive(:env).and_return('unknown')
expect(apple_icon).to eq('apple-icon-development.png')
expect(apple_touch_icon).to eq('apple-touch-icon-development.png')
end
end
end

0 comments on commit 8445c19

Please sign in to comment.