Big commit includes:
[selectricity] / test / unit / selectricityservice_test.rb
index c0f73c02789236df5c23e8728cc0d79aca329144..305bdc4babed47c4970cafa10cafa1eaa5a052ef 100644 (file)
@@ -9,13 +9,16 @@ class SelectricityServiceTest < Test::Unit::TestCase
   end
 
   def test_list_quickvotes
   end
 
   def test_list_quickvotes
-    result= invoke_delegated :vote, :list_quickvotes
+    result = invoke_delegated :vote, :list_quickvotes
     assert_instance_of Array, result
     assert_instance_of Array, result
-    assert_equal result.length, 0
+    assert result.length > 0
   end
 
   def test_create_quickvote
   end
 
   def test_create_quickvote
-    election = ElectionStruct.new :name => "TestVote", :description => "Test Vote", :candidate_names => ["Apple", "Orange", "Banana", "Pineapple"]
+    election = ElectionStruct.new(
+      { :name => "TestVote",
+        :description => "Test Vote",
+        :candidate_names => ["Apple", "Orange", "Banana", "Pineapple"] })
     assert_create_quickvote_succeeds election
   end
 
     assert_create_quickvote_succeeds election
   end
 
@@ -29,10 +32,10 @@ class SelectricityServiceTest < Test::Unit::TestCase
   def test_cast_nil_quickvote
     assert_cast_quickvote_fails nil, nil, nil
     assert_cast_quickvote_fails "foo", nil, nil
   def test_cast_nil_quickvote
     assert_cast_quickvote_fails nil, nil, nil
     assert_cast_quickvote_fails "foo", nil, nil
-    assert_cast_quickvote_fails "foo",33, []
+    assert_cast_quickvote_fails "foo", 33, []
     test_create_quickvote
     test_create_quickvote
-    assert_cast_quickvote_fails "TestVote",42,nil
-    assert_cast_quickvote_fails "TestVote",nil,[]
+    assert_cast_quickvote_fails "TestVote", 42,nil
+    assert_cast_quickvote_fails "TestVote", nil, []
   end
 
   def test_cast_malformed_votelist
   end
 
   def test_cast_malformed_votelist

Benjamin Mako Hill || Want to submit a patch?