Better HN
topnewbestaskshowjobs
Log inSign up

omnikron

1 karma · joined Jun 20, 2014 (12y ago) · 2 submissions

Freelance Rails developer living in Berlin.
Submissions

comment 12y ago · link · parent

Or 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.

comment 12y ago · link · parent

Nice 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!