Permalink
Browse files

Moving replication specs

  • Loading branch information...
1 parent 6fe4289 commit 9dd5249e11a2f47f2bb2d5f8ab96ef8865dda73b @thiagopradi committed Dec 14, 2011
Showing with 10 additions and 1 deletion.
  1. +10 −1 spec/octopus/{replication_specs.rb → replication_spec.rb}
@@ -59,13 +59,22 @@
end
end
+ it "should send all writes queries to master" do
+ using_environment :production_fully_replicated do
+ Cat.create!(:name => "Slave Cat")
+ Cat.find_by_name("Slave Cat").should be_nil
+ Client.create!(:name => "Slave Client")
+ Client.find_by_name("Slave Client").should be_nil
+ end
+ end
+
it "should work with validate_uniquess_of" do
Keyboard.create!(:name => "thiago")
using_environment :production_fully_replicated do
k = Keyboard.new(:name => "thiago")
k.save.should be_false
- k.errors.should == {:name=>["has already been taken"]}
+ k.errors.full_messages.should == ["Name has already been taken"]
end
end

0 comments on commit 9dd5249

Please sign in to comment.