Skip to content

Commit

Permalink
Moving replication specs
Browse files Browse the repository at this point in the history
  • Loading branch information
thiagopradi committed Dec 14, 2011
1 parent 6fe4289 commit 9dd5249
Showing 1 changed file with 10 additions and 1 deletion.
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -59,13 +59,22 @@
end end
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 it "should work with validate_uniquess_of" do
Keyboard.create!(:name => "thiago") Keyboard.create!(:name => "thiago")


using_environment :production_fully_replicated do using_environment :production_fully_replicated do
k = Keyboard.new(:name => "thiago") k = Keyboard.new(:name => "thiago")
k.save.should be_false 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
end end


Expand Down

0 comments on commit 9dd5249

Please sign in to comment.