Sha256: d55bf50218570fecef63eeaab45834dec66983dfa2a56edef660c725a4f6b6f1

Contents?: true

Size: 1.72 KB

Versions: 20

Compression:

Stored size: 1.72 KB

Contents

module GovukContentModels
  module TestHelpers
    module ActionProcessorHelpers
      def request_review(user, edition)
        user.progress(edition, { request_type: :request_review, comment: "Review this edition please." })
      end

      def approve_review(user, edition)
        user.progress(edition, { request_type: :approve_review, comment: "I've reviewed it" })
      end

      def send_fact_check(user, edition, comment="Fact check this guide please.")
        user.progress(edition,{ request_type: :send_fact_check, comment: comment, email_addresses: "test@test.com" })
      end

      def receive_fact_check(user, edition, comment="Please verify these facts.")
        user.progress(edition, { request_type: :receive_fact_check, comment: comment })
      end

      def approve_fact_check(user, edition, comment="No changes needed, this is all correct")
        user.progress(edition, { request_type: :approve_fact_check, comment: comment })
      end

      def request_amendments(user, edition)
        user.progress(edition, { request_type: :request_amendments, comment: "More amendments are required" })
      end

      def publish(user, edition, comment='Yo!')
        user.progress(edition, { request_type: :publish, comment: comment })
      end

      def schedule_for_publishing(user, edition, action_attributes)
        user.progress(edition, { request_type: :schedule_for_publishing,
          publish_at: action_attributes[:publish_at] || Time.zone.now.utc,
          comment: action_attributes[:comment] || 'Schedule!' })
      end

      def skip_review(user, edition)
        user.progress(edition, request_type: :skip_review, comment: "Skipping review as this is an out of hours urgent update.")
      end
    end
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
govuk_content_models-47.0.0 lib/govuk_content_models/test_helpers/action_processor_helpers.rb
govuk_content_models-46.0.1 lib/govuk_content_models/test_helpers/action_processor_helpers.rb
govuk_content_models-46.0.0 lib/govuk_content_models/test_helpers/action_processor_helpers.rb
govuk_content_models-45.0.0 lib/govuk_content_models/test_helpers/action_processor_helpers.rb
govuk_content_models-44.4.0 lib/govuk_content_models/test_helpers/action_processor_helpers.rb
govuk_content_models-44.3.0 lib/govuk_content_models/test_helpers/action_processor_helpers.rb
govuk_content_models-44.2.1 lib/govuk_content_models/test_helpers/action_processor_helpers.rb
govuk_content_models-44.2.0 lib/govuk_content_models/test_helpers/action_processor_helpers.rb
govuk_content_models-44.1.0 lib/govuk_content_models/test_helpers/action_processor_helpers.rb
govuk_content_models-44.0.1 lib/govuk_content_models/test_helpers/action_processor_helpers.rb
govuk_content_models-44.0.0 lib/govuk_content_models/test_helpers/action_processor_helpers.rb
govuk_content_models-43.2.0 lib/govuk_content_models/test_helpers/action_processor_helpers.rb
govuk_content_models-43.1.0 lib/govuk_content_models/test_helpers/action_processor_helpers.rb
govuk_content_models-43.0.1 lib/govuk_content_models/test_helpers/action_processor_helpers.rb
govuk_content_models-43.0.0 lib/govuk_content_models/test_helpers/action_processor_helpers.rb
govuk_content_models-42.1.0 lib/govuk_content_models/test_helpers/action_processor_helpers.rb
govuk_content_models-42.0.1 lib/govuk_content_models/test_helpers/action_processor_helpers.rb
govuk_content_models-42.0.0 lib/govuk_content_models/test_helpers/action_processor_helpers.rb
govuk_content_models-41.1.1 lib/govuk_content_models/test_helpers/action_processor_helpers.rb
govuk_content_models-41.1.0 lib/govuk_content_models/test_helpers/action_processor_helpers.rb