lib/decidim/dev/test/rspec_support/feature.rb in decidim-dev-0.6.8 vs lib/decidim/dev/test/rspec_support/feature.rb in decidim-dev-0.7.0
- old
+ new
@@ -25,33 +25,39 @@
class DummyResourceEvent < Events::BaseEvent
include Decidim::Events::EmailEvent
include Decidim::Events::NotificationEvent
end
- class DummyResource < ActiveRecord::Base
- include HasFeature
- include Resourceable
- include Reportable
- include Authorable
- include HasCategory
- include HasScope
- include Decidim::Comments::Commentable
- include Followable
+ module DummyResources
+ class ApplicationRecord < ActiveRecord::Base
+ self.abstract_class = true
+ end
- feature_manifest_name "dummy"
+ class DummyResource < ApplicationRecord
+ include HasFeature
+ include Resourceable
+ include Reportable
+ include Authorable
+ include HasCategory
+ include HasScope
+ include Decidim::Comments::Commentable
+ include Followable
- def reported_content_url
- ResourceLocatorPresenter.new(self).url
+ feature_manifest_name "dummy"
+
+ def reported_content_url
+ ResourceLocatorPresenter.new(self).url
+ end
end
end
class DummyResourcesController < ActionController::Base
helper Decidim::Comments::CommentsHelper
skip_authorization_check
def show
- @commentable = DummyResource.find(params[:id])
+ @commentable = DummyResources::DummyResource.find(params[:id])
render inline: %{
<%= csrf_meta_tags %>
<%= display_flash_messages %>
<div class="reveal" id="loginModal" data-reveal></div>
<%= javascript_include_tag 'application' %>
@@ -92,10 +98,10 @@
settings.attribute :dummy_step_attribute_2, type: :boolean
end
feature.register_resource do |resource|
resource.name = :dummy
- resource.model_class_name = "Decidim::DummyResource"
+ resource.model_class_name = "Decidim::DummyResources::DummyResource"
resource.template = "decidim/dummy_resource/linked_dummys"
end
feature.exports :dummies do |exports|
exports.collection do