omnikron·12 ปีที่แล้ว·discussOr even better, simply replace let(:client) { create(:client, :inactive) } with subject { create(:client, :inactive) } and then carry on as above.Rspec's syntax is great.
omnikron·12 ปีที่แล้ว·discussNice summary of one of the many different testing philosophies (this one happens to be very close to my own).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!
with
and then carry on as above.
Rspec's syntax is great.