richardkmichael / buy-my-beer

Make broken builds a thing of the past! Broken builds cost you a beer!
1 stars 0 forks source link

Project model testing. #22

Open richardkmichael opened 13 years ago

richardkmichael commented 13 years ago

UUID testing

  # it 'must have a unique uuid' do
  #   # TODO: A uniqueness test on the UUID.
  #   # create a Project with a known UUID -> use chronic to stick Time.now?  but
  #   # that's Project implementation specific.  it would be nice to hijack the
  #   # object and change the random UUID generate.
  # end

Test classes

Q: What about "after do ; @project.save ; end' to be sure the record always saves? Would this slow down the testsuite? Use Factories in "before do" ? Or, ruby def setup ; end ; def teardown ; end ;?

class ProjectTest < MiniTest::Rails::Model
  ...
end

The following tests really need before/after setup/teardown to insure objects are in the DB but are also properly removed at the end of the testcase (to avoid leakage to other tests when randomized).

  it 'should delete collaborations when deleted' do
    ...
  end

  it 'should not delete users when deleted' do
    ...
  end