Last active
August 29, 2015 14:16
-
-
Save coreyhaines/db2257c18549b6f87c1e to your computer and use it in GitHub Desktop.
Using super() in rspec's subject
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Phew! Turns out this was generated by transpec, not by a human! | |
before do | |
@admin = User.create(username: "user", password: "password", password_confirmation: "password") | |
end | |
subject{ @admin } | |
describe '#remember_token' do | |
subject { super().remember_token } | |
it { is_expected.not_to be_blank } | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Okay, turns out that this is a result of running transpec. I'm glad to hear nobody actually wrote this. :)
But, in general, my personal style hasn't evolved to using explicit subject / it. I'm pretty old school. :)