Sha256: be0ba6d78bbd59dec9f9273489ef6f757315dc4a5112734ec943ec542fd03634

Contents?: true

Size: 1 KB

Versions: 29

Compression:

Stored size: 1 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
      }
    }
  end
  let(:form) do
    Decidim::Comments::CommentForm.from_params(
      form_params
    ).with_context(
      current_organization: organization
    )
  end
  let(:command) { described_class.new(form, author, commentable) }
end

Version data entries

29 entries across 29 versions & 1 rubygems

Version Path
decidim-comments-0.21.0 lib/decidim/comments/test/shared_examples/create_comment_context.rb
decidim-comments-0.20.1 lib/decidim/comments/test/shared_examples/create_comment_context.rb
decidim-comments-0.20.0 lib/decidim/comments/test/shared_examples/create_comment_context.rb
decidim-comments-0.19.1 lib/decidim/comments/test/shared_examples/create_comment_context.rb
decidim-comments-0.18.1 lib/decidim/comments/test/shared_examples/create_comment_context.rb
decidim-comments-0.19.0 lib/decidim/comments/test/shared_examples/create_comment_context.rb
decidim-comments-0.17.2 lib/decidim/comments/test/shared_examples/create_comment_context.rb
decidim-comments-0.18.0 lib/decidim/comments/test/shared_examples/create_comment_context.rb
decidim-comments-0.17.1 lib/decidim/comments/test/shared_examples/create_comment_context.rb
decidim-comments-0.16.1 lib/decidim/comments/test/shared_examples/create_comment_context.rb
decidim-comments-0.17.0 lib/decidim/comments/test/shared_examples/create_comment_context.rb
decidim-comments-0.16.0 lib/decidim/comments/test/shared_examples/create_comment_context.rb
decidim-comments-0.15.2 lib/decidim/comments/test/shared_examples/create_comment_context.rb
decidim-comments-0.15.1 lib/decidim/comments/test/shared_examples/create_comment_context.rb
decidim-comments-0.15.0 lib/decidim/comments/test/shared_examples/create_comment_context.rb
decidim-comments-0.14.4 lib/decidim/comments/test/shared_examples/create_comment_context.rb
decidim-comments-0.14.3 lib/decidim/comments/test/shared_examples/create_comment_context.rb
decidim-comments-0.14.2 lib/decidim/comments/test/shared_examples/create_comment_context.rb
decidim-comments-0.14.1 lib/decidim/comments/test/shared_examples/create_comment_context.rb
decidim-comments-0.13.1 lib/decidim/comments/test/shared_examples/create_comment_context.rb