summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--spec/support/matchers.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/spec/support/matchers.rb b/spec/support/matchers.rb
index e0672166e92..14a03870a6c 100644
--- a/spec/support/matchers.rb
+++ b/spec/support/matchers.rb
@@ -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)