Skip to content
Browse files

Move Ordering Tests into appropriate area

Move Ordering tests to parse_resoruce tests.
  • Loading branch information...
1 parent aa89229 commit ed1faadc31e287838f5ec10c6ac4f1b47a1e50b3 @mattvv mattvv committed Oct 29, 2012
Showing with 24 additions and 27 deletions.
  1. +24 −0 test/test_parse_resource.rb
  2. +0 −27 test/test_query_options.rb
View
24 test/test_parse_resource.rb
@@ -161,6 +161,30 @@ def test_limit
end
end
+ def test_order_descending
+ e1 = Event.create(:name => "1st")
+ e2 = Event.create(:name => "2nd")
+ events = Event.order("name desc").all
+ Event.destroy_all
+ assert_equal true, (events[0].name == "2nd")
+ end
+
+ def test_order_ascending
+ e1 = Event.create(:name => "1st")
+ e2 = Event.create(:name => "2nd")
+ events = Event.order("name asc").all
+ Event.destroy_all
+ assert_equal true, (events[0].name == "1st")
+ end
+
+ def test_order_no_field
+ e1 = Event.create(:name => "1st")
+ e2 = Event.create(:name => "2nd")
+ events = Event.order("desc").all
+ Event.destroy_all
+ assert_equal true, (events[0].name == "1st")
+ end
+
#def test_skip
# 15.times do |i|
# Post.create(:title => "skip", :author => i)
View
27 test/test_query_options.rb
@@ -17,32 +17,6 @@ class TestQueryOptions < Test::Unit::TestCase
#def teardown
# Event.destroy_all
#end
-
- def test_order_descending
- e1 = Event.create(:name => "1st")
- e2 = Event.create(:name => "2nd")
- events = Event.order("name desc").all
- Event.destroy_all
- assert_equal true, (events[0].name == "2nd")
- end
-
- def test_order_ascending
- e1 = Event.create(:name => "1st")
- e2 = Event.create(:name => "2nd")
- events = Event.order("name asc").all
- Event.destroy_all
- assert_equal true, (events[0].name == "1st")
- end
-
- def test_order_no_field
- e1 = Event.create(:name => "1st")
- e2 = Event.create(:name => "2nd")
- events = Event.order("desc").all
- Event.destroy_all
- puts events[0].name
- puts events[1].name
- assert_equal true, (events[0].name == "1st")
- end
def test_skip
VCR.use_cassette('test_skip', :record => :new_episodes) do
@@ -57,7 +31,6 @@ def test_skip
all_events += results
count += results.count
end while not results.empty?
-
assert_equal true, (all_events.count == num_to_test)
found_names = []

0 comments on commit ed1faad

Please sign in to comment.
Something went wrong with that request. Please try again.