aboutsummaryrefslogtreecommitdiffstats
path: root/activeresource/test/cases/base_test.rb
diff options
context:
space:
mode:
authorTaryn East <git@taryneast.org>2009-10-02 10:13:40 -0500
committerJoshua Peek <josh@joshpeek.com>2009-10-02 10:13:40 -0500
commit8377646d68b32de362fefad0d752a923f6b36da6 (patch)
treea2f4b8d2d9b4021acc5efc551ec7578d5e24d923 /activeresource/test/cases/base_test.rb
parentf4f68885efd0e1135217433cafd368902b1fd58a (diff)
downloadrails-8377646d68b32de362fefad0d752a923f6b36da6.tar.gz
rails-8377646d68b32de362fefad0d752a923f6b36da6.tar.bz2
rails-8377646d68b32de362fefad0d752a923f6b36da6.zip
add indifferent access to the attributes
Signed-off-by: Joshua Peek <josh@joshpeek.com>
Diffstat (limited to 'activeresource/test/cases/base_test.rb')
-rw-r--r--activeresource/test/cases/base_test.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/activeresource/test/cases/base_test.rb b/activeresource/test/cases/base_test.rb
index 96fc6fc2fe..fc366430d4 100644
--- a/activeresource/test/cases/base_test.rb
+++ b/activeresource/test/cases/base_test.rb
@@ -102,6 +102,9 @@ class BaseTest < Test::Unit::TestCase
Person.password = nil
end
+ ########################################################################
+ # Tests relating to setting up the API-connection configuration
+ ########################################################################
def test_site_accessor_accepts_uri_or_string_argument
site = URI.parse('http://localhost')
@@ -509,6 +512,11 @@ class BaseTest < Test::Unit::TestCase
assert_not_equal(first_connection, second_connection, 'Connection should be re-created')
end
+
+ ########################################################################
+ # Tests for setting up remote URLs for a given model (including adding
+ # parameters appropriately)
+ ########################################################################
def test_collection_name
assert_equal "people", Person.collection_name
end
@@ -637,6 +645,10 @@ class BaseTest < Test::Unit::TestCase
assert_equal [:person_id].to_set, StreetAddress.__send__(:prefix_parameters)
end
+
+ ########################################################################
+ # Tests basic CRUD functions (find/save/create etc)
+ ########################################################################
def test_respond_to
matz = Person.find(1)
assert matz.respond_to?(:name)
@@ -910,6 +922,9 @@ class BaseTest < Test::Unit::TestCase
assert_raise(ActiveResource::ResourceGone) { Person.find(1) }
end
+ ########################################################################
+ # Tests the more miscelaneous helper methods
+ ########################################################################
def test_exists
# Class method.
assert !Person.exists?(nil)