Permalink
Browse files

Add a campaign_notification header

This is the specific header that apps will set to turn on/off whether
they want this functionality.
  • Loading branch information...
1 parent a975c5f commit 201491c249e1d8de6ca36d5dd6ce415392191fcd Kushal Pisavadia committed Oct 11, 2012
Showing with 10 additions and 0 deletions.
  1. +1 −0 lib/slimmer/headers.rb
  2. +9 −0 test/headers_test.rb
@@ -5,6 +5,7 @@ module Headers
HEADER_PREFIX = "X-Slimmer"
SLIMMER_HEADER_MAPPING = {
+ campaign_notification:"Campaign-Notification",
format: "Format",
need_id: "Need-ID",
proposition: "Proposition",
@@ -63,6 +63,15 @@ def test_should_set_meta_viewport_header
set_slimmer_headers remove_meta_viewport: true
assert_equal "true", headers["X-Slimmer-Remove-Meta-Viewport"]
end
+
+ def test_should_not_have_campaign_notification_set
+ assert_equal nil, headers["X-Slimmer-Campaign-Notification"]
+ end
+
+ def test_should_set_campaign_notification_header
+ set_slimmer_headers campaign_notification: true
+ assert_equal "true", headers["X-Slimmer-Campaign-Notification"]
+ end
end
describe Slimmer::Headers do

0 comments on commit 201491c

Please sign in to comment.