* use let(!) where appropriate (see [1] for more info). * use `context` to portray scenarios * use `describe` to portray method and Class specifications * omit the word "should" from example descriptions (Dave Chelimsky remarked to me that it was "tantamount to line-noise" and I'm of the opinion that it adds no value. * use more idiomatic Ruby (prefer things like 2.times to 1.upto(2)) * use more idiomatic Rails (prefer 1.minute.from_now to Time.now + 60*60) * use more idiomatic Rspec (prefer album.should be_valid to album.valid?.should be_true * also ensure to only make one assertion per example Other sundry cleanups. [1] http://rdoc.info/github/rspec/rspec-core/master/RSpec/Core/Let/ClassMethods#let-instance_method |
||
|---|---|---|
| .. | ||
| controllers | ||
| fixtures | ||
| helpers | ||
| lib | ||
| models | ||
| factories.rb | ||
| misc_spec.rb | ||
| spec_helper.rb | ||
| user_encryption_spec.rb | ||