Created
August 6, 2013 01:59
-
-
Save masatomo/6161367 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/spec/functional/embedded_document_spec.rb b/spec/functional/embedded_document_spec.rb | |
index 22112d5..166eefe 100644 | |
--- a/spec/functional/embedded_document_spec.rb | |
+++ b/spec/functional/embedded_document_spec.rb | |
@@ -9,6 +9,7 @@ describe "EmbeddedDocument" do | |
@pet_klass = EDoc('Pet') do | |
key :name, String | |
+ key :flag, Boolean | |
end | |
@klass.many :pets, :class => @pet_klass | |
@@ -294,4 +295,20 @@ describe "EmbeddedDocument" do | |
pets[0].name.should == "Sasha" | |
end | |
end | |
-end | |
\ No newline at end of file | |
+ | |
+ it "should pass but fails" do | |
+ person = @klass.create(:pets => [@pet_klass.new(:name => 'Rasmus', :flag => true)]) | |
+ person.update_attributes!({"pets" => ["name" => "sparky", "flag" => "false"]}) | |
+ person.reload | |
+ person.pets.first.name.should == "sparky" | |
+ person.pets.first.flag.should be_false # THIS FAILS | |
+ end | |
+ | |
+ it "passes" do | |
+ person = @klass.create(:pets => [@pet_klass.new(:name => 'Rasmus', :flag => true)]) | |
+ person.update_attributes!({pets: [:name => "sparky", :flag => "false"]}) | |
+ person.reload | |
+ person.pets.first.name.should == "sparky" | |
+ person.pets.first.flag.should be_false | |
+ end | |
+end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment