projects
/
selectricity
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Rename Selectricity API calls to more explicitly call itself quickvotes.
[selectricity]
/
test
/
unit
/
selectricityservice_test.rb
diff --git
a/test/unit/selectricityservice_test.rb
b/test/unit/selectricityservice_test.rb
index 1c28cf1b5277a4125f99953444bd80dcb1aabdc0..cdc2b4239b12348e010759ad4412ce063e49201f 100644
(file)
--- a/
test/unit/selectricityservice_test.rb
+++ b/
test/unit/selectricityservice_test.rb
@@
-15,7
+15,7
@@
class SelectricityServiceTest < Test::Unit::TestCase
end
def test_create_quickvote
end
def test_create_quickvote
- election =
Election
Struct.new(
+ election =
QuickVote
Struct.new(
{ :name => "TestVote",
:description => "Test Vote",
:candidate_names => ["Apple", "Orange", "Banana", "Pineapple"] })
{ :name => "TestVote",
:description => "Test Vote",
:candidate_names => ["Apple", "Orange", "Banana", "Pineapple"] })
@@
-88,7
+88,7
@@
class SelectricityServiceTest < Test::Unit::TestCase
def test_create_mass_quickvote
10.times do |t|
def test_create_mass_quickvote
10.times do |t|
- assert_create_quickvote_succeeds
Election
Struct.new({
+ assert_create_quickvote_succeeds
QuickVote
Struct.new({
:name => "test#{t}",
:description => "Test Vote",
:candidate_names => ["Apple", "Orange", "Banana", "Pineapple"]})
:name => "test#{t}",
:description => "Test Vote",
:candidate_names => ["Apple", "Orange", "Banana", "Pineapple"]})
@@
-96,7
+96,7
@@
class SelectricityServiceTest < Test::Unit::TestCase
end
def test_create_quickvote_bad_name
end
def test_create_quickvote_bad_name
- assert_create_quickvote_fails
Election
Struct.new({
+ assert_create_quickvote_fails
QuickVote
Struct.new({
:name => "invalid space",
:description => "Test Vote",
:candidate_names => ["Apple", "Orange", "Banana", "Pineapple"]})
:name => "invalid space",
:description => "Test Vote",
:candidate_names => ["Apple", "Orange", "Banana", "Pineapple"]})
@@
-104,58
+104,58
@@
class SelectricityServiceTest < Test::Unit::TestCase
end
def test_create_quickvote_nil
end
def test_create_quickvote_nil
- assert_create_quickvote_fails
Election
Struct.new()
+ assert_create_quickvote_fails
QuickVote
Struct.new()
end
def test_create_quickvote_name_nil
end
def test_create_quickvote_name_nil
- assert_create_quickvote_fails
Election
Struct.new({
+ assert_create_quickvote_fails
QuickVote
Struct.new({
:name => "",
:description => "Test Vote",
:candidate_names => ["Apple", "Orange", "Banana", "Pineapple"]})
end
def test_create_quickvote_description_nil
:name => "",
:description => "Test Vote",
:candidate_names => ["Apple", "Orange", "Banana", "Pineapple"]})
end
def test_create_quickvote_description_nil
- assert_create_quickvote_fails
Election
Struct.new({
+ assert_create_quickvote_fails
QuickVote
Struct.new({
:name => "foobar",
:description => nil,
:candidate_names => ["Apple", "Orange", "Banana", "Pineapple"]})
end
def test_create_quickvote_description_whitespace
:name => "foobar",
:description => nil,
:candidate_names => ["Apple", "Orange", "Banana", "Pineapple"]})
end
def test_create_quickvote_description_whitespace
- assert_create_quickvote_fails
Election
Struct.new({
+ assert_create_quickvote_fails
QuickVote
Struct.new({
:name => "foobar",
:description => " ",
:candidate_names => ["Apple", "Orange", "Banana", "Pineapple"]})
:name => "foobar",
:description => " ",
:candidate_names => ["Apple", "Orange", "Banana", "Pineapple"]})
- assert_create_quickvote_fails
Election
Struct.new({
+ assert_create_quickvote_fails
QuickVote
Struct.new({
:name => "foobar",
:description => "\t\t",
:candidate_names => ["Apple", "Orange", "Banana", "Pineapple"]})
end
def test_create_quickvote_candidates_nil
:name => "foobar",
:description => "\t\t",
:candidate_names => ["Apple", "Orange", "Banana", "Pineapple"]})
end
def test_create_quickvote_candidates_nil
- assert_create_quickvote_fails
Election
Struct.new({
+ assert_create_quickvote_fails
QuickVote
Struct.new({
:name => "foobar",
:description => "valid",
:candidate_names => nil })
end
def test_create_quickvote_insufficient_candidates
:name => "foobar",
:description => "valid",
:candidate_names => nil })
end
def test_create_quickvote_insufficient_candidates
- assert_create_quickvote_fails
Election
Struct.new({
+ assert_create_quickvote_fails
QuickVote
Struct.new({
:name => "foobar",
:description => "valid",
:candidate_names => ["Apple"] })
end
def test_create_quickvote_candidates_whitespace
:name => "foobar",
:description => "valid",
:candidate_names => ["Apple"] })
end
def test_create_quickvote_candidates_whitespace
- assert_create_quickvote_fails
Election
Struct.new({
+ assert_create_quickvote_fails
QuickVote
Struct.new({
:name => "foobar",
:description => "valid",
:candidate_names => [" ", " ", " ", " "]})
end
def test_create_quickvote_dupe_candidates
:name => "foobar",
:description => "valid",
:candidate_names => [" ", " ", " ", " "]})
end
def test_create_quickvote_dupe_candidates
- assert_create_quickvote_fails
Election
Struct.new({
+ assert_create_quickvote_fails
QuickVote
Struct.new({
:name => "foobar",
:description => "valid",
:candidate_names => ["Apple", "Apple", "Apple", "Apple"]})
:name => "foobar",
:description => "valid",
:candidate_names => ["Apple", "Apple", "Apple", "Apple"]})
@@
-166,7
+166,7
@@
class SelectricityServiceTest < Test::Unit::TestCase
# We don't want this to happen. Dupe canidates should fail
# regardless of how many are left.
# We don't want this to happen. Dupe canidates should fail
# regardless of how many are left.
- assert_create_quickvote_fails
Election
Struct.new({
+ assert_create_quickvote_fails
QuickVote
Struct.new({
:name => "foobar",
:description => "valid",
:candidate_names => ["Apple", "Apple", "Orange",
:name => "foobar",
:description => "valid",
:candidate_names => ["Apple", "Apple", "Orange",
@@
-174,7
+174,7
@@
class SelectricityServiceTest < Test::Unit::TestCase
end
def test_create_quickvote_candidates_nil_mixed
end
def test_create_quickvote_candidates_nil_mixed
- assert_create_quickvote_fails
Election
Struct.new({
+ assert_create_quickvote_fails
QuickVote
Struct.new({
:name => "foobar",
:description => "valid",
:candidate_names => ["Apple", nil ]})
:name => "foobar",
:description => "valid",
:candidate_names => ["Apple", nil ]})
@@
-183,21
+183,21
@@
class SelectricityServiceTest < Test::Unit::TestCase
def test_create_quickvote_description_xmlescape
# Will an embedded XML element bork the table?
def test_create_quickvote_description_xmlescape
# Will an embedded XML element bork the table?
- assert_create_quickvote_succeeds
Election
Struct.new({
+ assert_create_quickvote_succeeds
QuickVote
Struct.new({
:name => "foobar",
:description => "test </string>",
:candidate_names => ["Apple", "Orange", "Banana", "Pineapple"]})
end
def test_create_quickvote_unprintable_description
:name => "foobar",
:description => "test </string>",
:candidate_names => ["Apple", "Orange", "Banana", "Pineapple"]})
end
def test_create_quickvote_unprintable_description
- assert_create_quickvote_succeeds
Election
Struct.new ({
+ assert_create_quickvote_succeeds
QuickVote
Struct.new ({
:name => "foobar",
:description => "test \x01\x02\x03\x04\x05\x06\x07\x08",
:candidate_names => ["Apple", "Orange", "Banana", "Pineapple"]})
end
def test_quickvote_proper_results
:name => "foobar",
:description => "test \x01\x02\x03\x04\x05\x06\x07\x08",
:candidate_names => ["Apple", "Orange", "Banana", "Pineapple"]})
end
def test_quickvote_proper_results
- assert_create_quickvote_succeeds
Election
Struct.new({
+ assert_create_quickvote_succeeds
QuickVote
Struct.new({
:name => "favdev",
:description => "Who is your favorite developer?",
:candidate_names => ["mako", "jdong", "justin"]})
:name => "favdev",
:description => "Who is your favorite developer?",
:candidate_names => ["mako", "jdong", "justin"]})
Benjamin Mako Hill
||
Want to submit a patch?