Updated

spec/mailers/previews / petition_mailer_preview.rb

B
102 lines of codes
15 methods
5.2 complexity/method
11 churn
78.7 complexity
0 duplications
# Preview all emails at http://localhost:3000/rails/mailers/petition_mailer class PetitionMailerPreview < ActionMailer::Preview def email_confirmation_for_signer
  1. PetitionMailerPreview#email_confirmation_for_signer doesn't depend on instance state (maybe move it to another class?)
PetitionMailer.email_confirmation_for_signer(Signature.last) end def email_duplicate_signatures
  1. PetitionMailerPreview#email_duplicate_signatures doesn't depend on instance state (maybe move it to another class?)
PetitionMailer.email_duplicate_signatures(Signature.last) end def gather_sponsors_for_petition
  1. PetitionMailerPreview#gather_sponsors_for_petition doesn't depend on instance state (maybe move it to another class?)
PetitionMailer.gather_sponsors_for_petition(Petition.last) end def email_signer
  1. PetitionMailerPreview#email_signer doesn't depend on instance state (maybe move it to another class?)
email = Petition::Email.last petition = email.petition signature = petition.signatures.validated.last PetitionMailer.email_signer(petition, signature, email) end def email_creator
  1. PetitionMailerPreview#email_creator doesn't depend on instance state (maybe move it to another class?)
email = Petition::Email.last petition = email.petition signature = petition.creator PetitionMailer.email_creator(petition, signature, email) end def notify_creator_that_moderation_is_delayed
  1. PetitionMailerPreview#notify_creator_that_moderation_is_delayed doesn't depend on instance state (maybe move it to another class?)
petition = Petition.overdue_in_moderation.last signature = petition.creator subject = "Moderation of your petition has been delayed" body = "We are sorry, but moderation of your petition has been delayed due to an overwhelming number of requests." PetitionMailer.notify_creator_that_moderation_is_delayed(signature, subject, body) end def notify_signer_of_threshold_response
  1. PetitionMailerPreview#notify_signer_of_threshold_response doesn't depend on instance state (maybe move it to another class?)
petition = Petition.with_response.last signature = petition.signatures.validated.last PetitionMailer.notify_signer_of_threshold_response(petition, signature) end def notify_creator_of_threshold_response
  1. PetitionMailerPreview#notify_creator_of_threshold_response doesn't depend on instance state (maybe move it to another class?)
petition = Petition.with_response.last signature = petition.creator PetitionMailer.notify_creator_of_threshold_response(petition, signature) end def notify_creator_of_closing_date_change
  1. PetitionMailerPreview#notify_creator_of_closing_date_change doesn't depend on instance state (maybe move it to another class?)
petition = Petition.open_at_dissolution.first signature = petition.creator PetitionMailer.notify_creator_of_closing_date_change(signature) end def notify_creator_of_sponsored_petition_being_stopped
  1. PetitionMailerPreview#notify_creator_of_sponsored_petition_being_stopped doesn't depend on instance state (maybe move it to another class?)
petition = Petition.where(state: "sponsored").last signature = petition.creator PetitionMailer.notify_creator_of_sponsored_petition_being_stopped(signature) end def notify_creator_of_validated_petition_being_stopped
  1. PetitionMailerPreview#notify_creator_of_validated_petition_being_stopped doesn't depend on instance state (maybe move it to another class?)
petition = Petition.where(state: "validated").last signature = petition.creator PetitionMailer.notify_creator_of_validated_petition_being_stopped(signature) end def debated_petition_signer_notification
  1. PetitionMailerPreview#debated_petition_signer_notification doesn't depend on instance state (maybe move it to another class?)
petition = Petition.debated.last signature = petition.signatures.validated.last PetitionMailer.notify_signer_of_debate_outcome(petition, signature) end def debated_petition_creator_notification
  1. PetitionMailerPreview#debated_petition_creator_notification doesn't depend on instance state (maybe move it to another class?)
petition = Petition.debated.last signature = petition.signatures.validated.last PetitionMailer.notify_creator_of_debate_outcome(petition, signature) end def not_debated_petition_signer_notification
  1. PetitionMailerPreview#not_debated_petition_signer_notification doesn't depend on instance state (maybe move it to another class?)
petition = Petition.not_debated.last signature = petition.signatures.validated.last PetitionMailer.notify_signer_of_debate_outcome(petition, signature) end def not_debated_petition_creator_notification
  1. PetitionMailerPreview#not_debated_petition_creator_notification doesn't depend on instance state (maybe move it to another class?)
petition = Petition.not_debated.last signature = petition.signatures.validated.last PetitionMailer.notify_creator_of_debate_outcome(petition, signature) end end