What is difference between let
and a before
block in RSpec?
And when to use each?
What will be good approach (let or before) in below example?
let(:user) { User.make !}
let(:account) {user.account.make!}
before(:each) do
@user = User.make!
@account = @user.account.make!
end
I studied this stackoverflow post
But is it good to define let for association stuff like above?