Add include_module matcher

This commit is contained in:
Robert Speicher 2012-08-29 01:49:26 -04:00
parent 2c95074a5f
commit 14daf2e2ba

View file

@ -28,6 +28,16 @@ RSpec::Matchers.define :be_404_for do |user|
end
end
RSpec::Matchers.define :include_module do |expected|
match do
described_class.included_modules.include?(expected)
end
failure_message_for_should do
"expected #{described_class} to include the #{expected} module"
end
end
module UrlAccess
def url_allowed?(user, url)
emulate_user(user)