decidim-dev/lib/decidim/dev/test/rspec_support/feature.rb in decidim-0.0.4 vs decidim-dev/lib/decidim/dev/test/rspec_support/feature.rb in decidim-0.0.5

- old
+ new

@@ -1,9 +1,9 @@ # frozen_string_literal: true require "decidim/feature_validator" -require "decidim/comments/comments_helper" +require "decidim/comments" module Decidim # Dummy engine to be able to test components. class DummyEngine < Rails::Engine engine_name "dummy" @@ -16,40 +16,41 @@ class DummyResource < ActiveRecord::Base include HasFeature include Resourceable include Authorable + include Decidim::Comments::Commentable feature_manifest_name "dummy" end class DummyResourcesController < ActionController::Base helper Decidim::Comments::CommentsHelper skip_authorization_check def show @commentable = DummyResource.find(params[:id]) - @options = params.slice(:arguable, :votable) - @options.each { |key, val| @options[key] = val === "true" } render inline: %{ <%= javascript_include_tag 'application' %> - <%= comments_for(@commentable, @options) %> - }.html_safe + <%= inline_comments_for(@commentable) %> + } end end end Decidim.register_feature(:dummy) do |feature| feature.engine = Decidim::DummyEngine feature.actions = %w(foo bar) feature.settings(:global) do |settings| + settings.attribute :comments_enabled, type: :boolean, default: true settings.attribute :dummy_global_attribute_1, type: :boolean settings.attribute :dummy_global_attribute_2, type: :boolean end feature.settings(:step) do |settings| + settings.attribute :comments_blocked, type: :boolean, default: false settings.attribute :dummy_step_attribute_1, type: :boolean settings.attribute :dummy_step_attribute_2, type: :boolean end feature.register_resource do |resource|