diff options
Diffstat (limited to 'activeresource/test/cases')
-rw-r--r-- | activeresource/test/cases/base/load_test.rb | 25 | ||||
-rw-r--r-- | activeresource/test/cases/base_test.rb | 8 |
2 files changed, 13 insertions, 20 deletions
diff --git a/activeresource/test/cases/base/load_test.rb b/activeresource/test/cases/base/load_test.rb index 53fa94d07f..189a4d81fe 100644 --- a/activeresource/test/cases/base/load_test.rb +++ b/activeresource/test/cases/base/load_test.rb @@ -15,26 +15,21 @@ module Highrise module Deeply module Nested - class Note < ActiveResource::Base self.site = "http://37s.sunrise.i:3000" end - class Comment < ActiveResource::Base - self.site = "http://37s.sunrise.i:3000" - end - - module TestDifferentLevels - - class Note < ActiveResource::Base - self.site = "http://37s.sunrise.i:3000" - end - - end + class Comment < ActiveResource::Base + self.site = "http://37s.sunrise.i:3000" + end + module TestDifferentLevels + class Note < ActiveResource::Base + self.site = "http://37s.sunrise.i:3000" + end + end end end - end @@ -156,7 +151,7 @@ class BaseLoadTest < Test::Unit::TestCase assert_kind_of String, places.first assert_equal @deep[:street][:state][:places].first, places.first end - + def test_nested_collections_within_the_same_namespace n = Highrise::Note.new(:comments => [{ :name => "1" }]) assert_kind_of Highrise::Comment, n.comments.first @@ -171,6 +166,4 @@ class BaseLoadTest < Test::Unit::TestCase n = Highrise::Deeply::Nested::TestDifferentLevels::Note.new(:comments => [{ :name => "1" }]) assert_kind_of Highrise::Deeply::Nested::Comment, n.comments.first end - - end diff --git a/activeresource/test/cases/base_test.rb b/activeresource/test/cases/base_test.rb index fc366430d4..1593e25595 100644 --- a/activeresource/test/cases/base_test.rb +++ b/activeresource/test/cases/base_test.rb @@ -828,7 +828,7 @@ class BaseTest < Test::Unit::TestCase ###### # update_attribute(s)(!) - + def test_update_attribute_as_symbol matz = Person.first matz.expects(:save).returns(true) @@ -837,7 +837,7 @@ class BaseTest < Test::Unit::TestCase assert matz.update_attribute(:name, "David") assert_equal "David", matz.name end - + def test_update_attribute_as_string matz = Person.first matz.expects(:save).returns(true) @@ -847,7 +847,7 @@ class BaseTest < Test::Unit::TestCase assert_equal "David", matz.name end - + def test_update_attributes_as_symbols addy = StreetAddress.first(:params => {:person_id => 1}) addy.expects(:save).returns(true) @@ -913,7 +913,7 @@ class BaseTest < Test::Unit::TestCase end assert_raise(ActiveResource::ResourceNotFound) { StreetAddress.find(1, :params => { :person_id => 1 }) } end - + def test_delete_with_410_gone assert Person.delete(1) ActiveResource::HttpMock.respond_to do |mock| |