-
-
Save bantic/4272656 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
RSpec::Matchers.define :be_signed_in do | |
match do |user| | |
warden.user == user | |
end | |
failure_message_for_should do |user| | |
"expected #{user} to be signed in, but was not" | |
end | |
failure_message_for_should_not do |user| | |
"expected #{user} not to be signed in, but *was* signed in" | |
end | |
description do | |
"be signed in" | |
end | |
end | |
# use: | |
# @user.should be_signed_in |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment