forked from binarylogic/authlogic
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
003bd21
commit 3424ecf
Showing
1 changed file
with
37 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# Place this file into your spec/support/matchers directory | ||
# | ||
# Example: | ||
# | ||
# describe User do | ||
# it { should have_authlogic } | ||
# end | ||
|
||
module Authlogic | ||
module RspecMatchers | ||
def have_authlogic | ||
HaveAuthlogic.new | ||
end | ||
|
||
class HaveAuthlogic | ||
|
||
def matches?(subject) | ||
subject.respond_to?(:password=) && subject.respond_to?(:valid_password?) | ||
end | ||
|
||
def failure_message | ||
"Add the line 'acts_as_authentic' to your model" | ||
end | ||
|
||
def description | ||
"have Authlogic" | ||
end | ||
end | ||
end | ||
|
||
end | ||
|
||
if defined?(Spec) | ||
Spec::Runner.configure do |config| | ||
config.include(Authlogic::RspecMatchers) | ||
end | ||
end |