Permalink
Browse files

Fixed broken test.

  • Loading branch information...
1 parent aca0e16 commit 3ac621d9d989f92c6d63b466e7e4115b43e2ab9f Anton Lindqvist committed Oct 11, 2010
Showing with 2 additions and 2 deletions.
  1. +1 −1 lib/iphone_helpers.rb
  2. +1 −1 test/iphone_helpers_test.rb
View
@@ -45,7 +45,7 @@ def iphone_status_bar(options)
def iphone_viewport(options)
options.each { |k,v| options[k.to_s.gsub('_', '-').to_sym] = v if options.delete(k) }
defaults = {:'initial-scale' => 1, :'maximum-scale' => 1, :width => 'device-width'}
- content = defaults.merge(options).collect { |k,v| "#{k}=#{v}" }.join('; ')
+ content = defaults.merge(options).stringify_keys.sort.collect { |k,v| "#{k}=#{v}" }.join('; ')
options = {:content => content, :name => 'viewport'}
[:meta, options]
end
@@ -44,6 +44,6 @@ class IphoneHelpersTest < ActionView::TestCase
end
test 'viewport with custom attributes' do
- assert_equal iphone(:viewport, :width => 320, :height => 480, :initial_scale => 2.5, :minimum_scale => 0.5, :maximum_scale => 3, :user_scalable => 'no'), '<meta content="initial-scale=2.5; minimum-scale=0.5; maximum-scale=3; user-scalable=no; width=320; height=480" name="viewport" />'
+ assert_equal iphone(:viewport, :width => 320, :height => 480, :initial_scale => 2.5, :minimum_scale => 0.5, :maximum_scale => 3, :user_scalable => 'no'), '<meta content="height=480; initial-scale=2.5; maximum-scale=3; minimum-scale=0.5; user-scalable=no; width=320" name="viewport" />'
end
end

0 comments on commit 3ac621d

Please sign in to comment.