Sha256: c24a39bc1e39ed5b90fe4976c18f4124abffa361ee357595d011d8182aec5e75

Contents?: true

Size: 1.03 KB

Versions: 46

Compression:

Stored size: 1.03 KB

Contents

# frozen_string_literal: true

RSpec.shared_context "when creating a comment" do
  let(:organization) { create(:organization) }
  let(:participatory_process) { create(:participatory_process, organization: organization) }
  let(:component) { create(:component, participatory_space: participatory_process) }
  let(:user) { create(:user, organization: organization) }
  let(:author) { create(:user, organization: organization) }
  let(:dummy_resource) { create :dummy_resource, component: component }
  let(:commentable) { dummy_resource }
  let(:body) { ::Faker::Lorem.paragraph }
  let(:alignment) { 1 }
  let(:user_group_id) { nil }
  let(:form_params) do
    {
      "comment" => {
        "body" => body,
        "alignment" => alignment,
        "user_group_id" => user_group_id,
        "commentable" => commentable
      }
    }
  end
  let(:form) do
    Decidim::Comments::CommentForm.from_params(
      form_params
    ).with_context(
      current_organization: organization
    )
  end
  let(:command) { described_class.new(form, author) }
end

Version data entries

46 entries across 46 versions & 1 rubygems

Version Path
decidim-comments-0.27.9 lib/decidim/comments/test/shared_examples/create_comment_context.rb
decidim-comments-0.27.8 lib/decidim/comments/test/shared_examples/create_comment_context.rb
decidim-comments-0.27.7 lib/decidim/comments/test/shared_examples/create_comment_context.rb
decidim-comments-0.27.6 lib/decidim/comments/test/shared_examples/create_comment_context.rb
decidim-comments-0.26.10 lib/decidim/comments/test/shared_examples/create_comment_context.rb
decidim-comments-0.26.9 lib/decidim/comments/test/shared_examples/create_comment_context.rb
decidim-comments-0.27.5 lib/decidim/comments/test/shared_examples/create_comment_context.rb
decidim-comments-0.26.8 lib/decidim/comments/test/shared_examples/create_comment_context.rb
decidim-comments-0.27.4 lib/decidim/comments/test/shared_examples/create_comment_context.rb
decidim-comments-0.27.3 lib/decidim/comments/test/shared_examples/create_comment_context.rb
decidim-comments-0.26.7 lib/decidim/comments/test/shared_examples/create_comment_context.rb
decidim-comments-0.26.5 lib/decidim/comments/test/shared_examples/create_comment_context.rb
decidim-comments-0.27.2 lib/decidim/comments/test/shared_examples/create_comment_context.rb
decidim-comments-0.27.1 lib/decidim/comments/test/shared_examples/create_comment_context.rb
decidim-comments-0.26.4 lib/decidim/comments/test/shared_examples/create_comment_context.rb
decidim-comments-0.27.0 lib/decidim/comments/test/shared_examples/create_comment_context.rb
decidim-comments-0.26.3 lib/decidim/comments/test/shared_examples/create_comment_context.rb
decidim-comments-0.27.0.rc2 lib/decidim/comments/test/shared_examples/create_comment_context.rb
decidim-comments-0.27.0.rc1 lib/decidim/comments/test/shared_examples/create_comment_context.rb
decidim-comments-0.26.2 lib/decidim/comments/test/shared_examples/create_comment_context.rb