Module: GovukContentModels::TestHelpers::ActionProcessorHelpers

Defined in:
lib/govuk_content_models/test_helpers/action_processor_helpers.rb

Instance Method Summary collapse

Instance Method Details

#approve_fact_check(user, edition, comment = "No changes needed, this is all correct") ⇒ Object



20
21
22
# File 'lib/govuk_content_models/test_helpers/action_processor_helpers.rb', line 20

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

#approve_review(user, edition) ⇒ Object



8
9
10
# File 'lib/govuk_content_models/test_helpers/action_processor_helpers.rb', line 8

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

#publish(user, edition, comment = 'Yo!') ⇒ Object



28
29
30
# File 'lib/govuk_content_models/test_helpers/action_processor_helpers.rb', line 28

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

#receive_fact_check(user, edition, comment = "Please verify these facts.") ⇒ Object



16
17
18
# File 'lib/govuk_content_models/test_helpers/action_processor_helpers.rb', line 16

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

#request_amendments(user, edition) ⇒ Object



24
25
26
# File 'lib/govuk_content_models/test_helpers/action_processor_helpers.rb', line 24

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

#request_review(user, edition) ⇒ Object



4
5
6
# File 'lib/govuk_content_models/test_helpers/action_processor_helpers.rb', line 4

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

#schedule_for_publishing(user, edition, action_attributes) ⇒ Object



32
33
34
35
36
# File 'lib/govuk_content_models/test_helpers/action_processor_helpers.rb', line 32

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

#send_fact_check(user, edition, comment = "Fact check this guide please.") ⇒ Object



12
13
14
# File 'lib/govuk_content_models/test_helpers/action_processor_helpers.rb', line 12

def send_fact_check(user, edition, comment="Fact check this guide please.")
  user.progress(edition,{ request_type: :send_fact_check, comment: comment, email_addresses: "[email protected]" })
end