Sha256: 1356b774cb368faf29d642d76ae9b3f7b9420992e9acd7a56070c45efa0ef1fb

Contents?: true

Size: 1.54 KB

Versions: 54

Compression:

Stored size: 1.54 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
    end
  end
end

Version data entries

54 entries across 54 versions & 1 rubygems

Version Path
govuk_content_models-41.0.0 lib/govuk_content_models/test_helpers/action_processor_helpers.rb
govuk_content_models-40.0.0 lib/govuk_content_models/test_helpers/action_processor_helpers.rb
govuk_content_models-39.0.0 lib/govuk_content_models/test_helpers/action_processor_helpers.rb
govuk_content_models-38.0.0 lib/govuk_content_models/test_helpers/action_processor_helpers.rb
govuk_content_models-37.0.0 lib/govuk_content_models/test_helpers/action_processor_helpers.rb
govuk_content_models-36.0.0 lib/govuk_content_models/test_helpers/action_processor_helpers.rb
govuk_content_models-35.0.1 lib/govuk_content_models/test_helpers/action_processor_helpers.rb
govuk_content_models-35.0.0 lib/govuk_content_models/test_helpers/action_processor_helpers.rb
govuk_content_models-34.0.0 lib/govuk_content_models/test_helpers/action_processor_helpers.rb
govuk_content_models-33.0.0 lib/govuk_content_models/test_helpers/action_processor_helpers.rb
govuk_content_models-32.3.1 lib/govuk_content_models/test_helpers/action_processor_helpers.rb
govuk_content_models-32.3.0 lib/govuk_content_models/test_helpers/action_processor_helpers.rb
govuk_content_models-32.2.0 lib/govuk_content_models/test_helpers/action_processor_helpers.rb
govuk_content_models-32.1.0 lib/govuk_content_models/test_helpers/action_processor_helpers.rb
govuk_content_models-32.0.0 lib/govuk_content_models/test_helpers/action_processor_helpers.rb
govuk_content_models-31.4.0 lib/govuk_content_models/test_helpers/action_processor_helpers.rb
govuk_content_models-31.3.0 lib/govuk_content_models/test_helpers/action_processor_helpers.rb
govuk_content_models-31.2.2 lib/govuk_content_models/test_helpers/action_processor_helpers.rb
govuk_content_models-31.2.1 lib/govuk_content_models/test_helpers/action_processor_helpers.rb
govuk_content_models-31.2.0 lib/govuk_content_models/test_helpers/action_processor_helpers.rb