If you have an ActiveRecord model associated with another model that has a uniqueness constraint, modeling it in FactoryGirl when writing specs doesn’t work out of the box. But there is a simple solution. Continue reading “Make FactoryGirl Respect Uniqueness When Creating Associations”
Spying on Function Calls in Jasmine Doesn’t Work as You Expect It To
Say you want to test that a function is called in your javascript code. What could be simpler, you say. Just write a simple Jasmine spec, throw a spy in, and you are set. That’s what I thought, before stumbling on a weird issue. Continue reading “Spying on Function Calls in Jasmine Doesn’t Work as You Expect It To”
Rspec Shared Contexts Have to Be Included Separately (Sometimes)
Let’s say you have two shared_context blocks in your rspec spec that each redefines the same variable or mocks the same method: Continue reading “Rspec Shared Contexts Have to Be Included Separately (Sometimes)”