Rails unit-testing best practices
blog.rainforestqa.com
blog.rainforestqa.com
I would have written a different title though, because as the last paragraph indicates, the post recommends some tools but not best practices (which at this basic level would be things like: minimize the interaction with the database and external systems, extract duplicated test code to helpers, label your tests with descriptive names, etc).
Yeah, good point on the title! ;)
As an alternative, where you currently have:
it { expect(client.active?).to be_false }
It might be even more idiomatic to write: subject { client }
it { should_not be_active }
# etc.
...beautiful! let(:client) { create(:client, :inactive) }
with subject { create(:client, :inactive) }
and then carry on as above.Rspec's syntax is great.