Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

refactoring to use factory

  • Loading branch information...
commit 22138ee873d4a177f536cdb3ab49af63db332e5f 1 parent 1226437
@chrislo chrislo authored
Showing with 3 additions and 4 deletions.
  1. +3 −4 test/google_map_test.rb
View
7 test/google_map_test.rb
@@ -6,7 +6,6 @@ class GoogleMapTest < Test::Unit::TestCase
# Replace this with your real tests.
def setup
@map = GoogleMap.new
- @marker = marker_factory()
end
def test_new_map_has_empty_markers
@@ -14,7 +13,7 @@ def test_new_map_has_empty_markers
end
def test_add_markers
- @map.markers << @marker
+ @map.markers << marker_factory
assert_equal @map.markers.length, 1
assert @map.to_html.include? "google_map_marker_1 = new GMarker(new GLatLng(40, -100));"
end
@@ -24,12 +23,12 @@ def test_center_on_markers_function_for_empty_map
end
def test_center_on_markers_function_for_one_marker
- @map.markers << @marker
+ @map.markers << marker_factory
assert @map.center_on_markers_function_js.include? "new GLatLngBounds(new GLatLng(40, -100), new GLatLng(40, -100))"
end
def test_center_on_markers_function_for_two_markers
- @map.markers << @marker
+ @map.markers << marker_factory
@map.markers << marker_factory({:lng => 100})
assert @map.center_on_markers_function_js.include? "new GLatLngBounds(new GLatLng(40, -100), new GLatLng(40, 100))"
end
Please sign in to comment.
Something went wrong with that request. Please try again.