aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZog2017-12-18 09:34:15 +0100
committerZog2017-12-19 14:21:52 +0100
commit3aa5ff0d1f5e74b4c46c14e6240e7def82f0451d (patch)
tree905d85a780ecf558d0f520af6e2b5ff731d17aab
parentf875a1b07db4f877f406952ef9074d7ed54f5a6d (diff)
downloadchouette-core-3aa5ff0d1f5e74b4c46c14e6240e7def82f0451d.tar.bz2
Refs #5291@0.1h; Fix rebase
Fix integration_spec_helper after rebase
-rw-r--r--spec/support/integration_spec_helper.rb37
1 files changed, 22 insertions, 15 deletions
diff --git a/spec/support/integration_spec_helper.rb b/spec/support/integration_spec_helper.rb
index 5bcf0bd3a..78efb9027 100644
--- a/spec/support/integration_spec_helper.rb
+++ b/spec/support/integration_spec_helper.rb
@@ -1,26 +1,33 @@
module IntegrationSpecHelper
- def with_permission permission, &block
- context "with permission #{permission}" do
- let(:permissions){ [permission] }
- context('', &block) if block_given?
- end
- def paginate_collection klass, decorator, page=1
- ModelDecorator.decorate( klass.page(page), with: decorator )
- end
+ def paginate_collection klass, decorator, page=1
+ ModelDecorator.decorate( klass.page(page), with: decorator )
+ end
- def build_paginated_collection factory, decorator, opts={}
- count = opts.delete(:count) || 2
- page = opts.delete(:page) || 1
- klass = nil
- count.times { klass ||= create(factory, opts).class }
- paginate_collection klass, decorator, page
+ def build_paginated_collection factory, decorator, opts={}
+ count = opts.delete(:count) || 2
+ page = opts.delete(:page) || 1
+ klass = nil
+ count.times { klass ||= create(factory, opts).class }
+ paginate_collection klass, decorator, page
+ end
+
+ module Methods
+ def with_permission permission, &block
+ context "with permission #{permission}" do
+ let(:permissions){ [permission] }
+ context('', &block) if block_given?
+ end
end
end
+
+ def self.included into
+ into.extend Methods
+ end
end
RSpec.configure do |config|
- config.extend IntegrationSpecHelper, type: :view
+ config.include IntegrationSpecHelper, type: :view
end
RSpec::Matchers.define :have_link_for_each_item do |collection, name, href|