Skip to content

Commit

Permalink
Merge pull request #309 from dmacvicar/testing_logo
Browse files Browse the repository at this point in the history
Automatically switch Leap logo based on testing/release
  • Loading branch information
dmacvicar authored May 24, 2018
2 parents 9659d5d + b445608 commit 00b71c7
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
7 changes: 7 additions & 0 deletions app/helpers/distribution_helper.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Helper for distribution controller
module DistributionHelper
def leap_image_tag(opts = {})
return image_tag('distributions/testing.svg', opts) if action_name == 'testing'
image_tag('distributions/leap.svg', opts)
end
end
2 changes: 1 addition & 1 deletion app/views/distributions/leap-15.0.html.erb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<header class="download-home-header jumbotron jumbotron-fluid text-center">
<div class="container">
<div class="page-heading">
<%= image_tag 'distributions/testing.svg', alt: "Testing Logo", class: "animated jackInTheBox", width: "256", height: "256" %>
<%= leap_image_tag alt: "Leap 15 Logo", class: "animated jackInTheBox", width: "256", height: "256" %>
<h1 class="display-3">
openSUSE Leap <%= @version %> <sup><%= @testing_state %></sup>
</h1>
Expand Down
4 changes: 4 additions & 0 deletions test/integration/distributions_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,13 @@ def test_distribution_redirection
get '/distributions/leap'
assert_includes body, 'openSUSE Leap 42.3'
assert_includes body, 'Choosing Which Media to Download'
assert_match %r{assets\/distributions\/leap(.*)\.svg}, body
assert_equal 200, status

get '/distributions/testing'
assert_includes body, 'openSUSE Leap 15.0'
assert_includes body, 'Help test the next version of openSUSE Leap!'
assert_match %r{assets\/distributions\/testing(.*)\.svg}, body

assert_equal 200, status
end
Expand All @@ -21,6 +23,8 @@ def test_distribution_redirection
get '/distributions/leap'
assert_includes body, 'openSUSE Leap 15.0'
assert_includes body, 'Choosing Which Media to Download'
assert_match %r{assets\/distributions\/leap(.*)\.svg}, body

assert_equal 200, status

get '/distributions/testing'
Expand Down

0 comments on commit 00b71c7

Please sign in to comment.