Skip to content

Commit

Permalink
style: Layout/LineLength RuboCop
Browse files Browse the repository at this point in the history
  • Loading branch information
alexander-griffen committed Jun 23, 2023
1 parent 0bca88d commit aa5a4fd
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 39 deletions.
10 changes: 5 additions & 5 deletions spec/factories/incoming_messages.rb
Original file line number Diff line number Diff line change
Expand Up @@ -73,15 +73,15 @@
end

factory :incoming_message_with_attachments do
# foi_attachments_count is declared as an ignored attribute and available in
# attributes on the factory, as well as the callback via the evaluator
# foi_attachments_count is declared as an ignored attribute and available
# in attributes on the factory, as well as the callback via the evaluator
transient do
foi_attachments_count { 2 }
end

# the after(:build) yields two values; the incoming_message instance itself and the
# evaluator, which stores all values from the factory, including ignored
# attributes;
# the after(:build) yields two values; the incoming_message instance
# itself and the evaluator, which stores all values from the factory,
# including ignored attributes;
after(:build) do |incoming_message, evaluator|
evaluator.foi_attachments_count.times do |count|
incoming_message.foi_attachments << build(
Expand Down
57 changes: 32 additions & 25 deletions spec/factories/info_requests.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,35 +3,35 @@
#
# Table name: info_requests
#
# id :integer not null, primary key
# title :text not null
# id :integer not null, primary key
# title :text not null
# user_id :integer
# public_body_id :integer not null
# created_at :datetime not null
# updated_at :datetime not null
# described_state :string not null
# awaiting_description :boolean default(FALSE), not null
# prominence :string default("normal"), not null
# url_title :text not null
# law_used :string default("foi"), not null
# allow_new_responses_from :string default("anybody"), not null
# handle_rejected_responses :string default("bounce"), not null
# idhash :string not null
# public_body_id :integer not null
# created_at :datetime not null
# updated_at :datetime not null
# described_state :string not null
# awaiting_description :boolean default(FALSE), not null
# prominence :string default("normal"), not null
# url_title :text not null
# law_used :string default("foi"), not null
# allow_new_responses_from :string default("anybody"), not null
# handle_rejected_responses :string default("bounce"), not null
# idhash :string not null
# external_user_name :string
# external_url :string
# attention_requested :boolean default(FALSE)
# comments_allowed :boolean default(TRUE), not null
# attention_requested :boolean default(FALSE)
# comments_allowed :boolean default(TRUE), not null
# info_request_batch_id :integer
# last_public_response_at :datetime
# reject_incoming_at_mta :boolean default(FALSE), not null
# rejected_incoming_count :integer default(0)
# reject_incoming_at_mta :boolean default(FALSE), not null
# rejected_incoming_count :integer default(0)
# date_initial_request_last_sent_at :date
# date_response_required_by :date
# date_very_overdue_after :date
# last_event_forming_initial_request_id :integer
# use_notifications :boolean
# last_event_time :datetime
# incoming_messages_count :integer default(0)
# incoming_messages_count :integer default(0)
# public_token :string
# prominence_reason :text
#
Expand Down Expand Up @@ -165,7 +165,8 @@

trait :with_internal_review_request do
after(:create) do |info_request, _evaluator|
outgoing_message = create(:internal_review_request, info_request: info_request)
outgoing_message = create(:internal_review_request,
info_request: info_request)
end
end

Expand Down Expand Up @@ -273,7 +274,8 @@
end

factory :info_request_with_incoming, traits: [:with_incoming] do
factory :waiting_clarification_info_request, traits: [:waiting_clarification]
factory :waiting_clarification_info_request,
traits: [:waiting_clarification]
factory :successful_request, traits: [:successful]
factory :requires_admin_request, traits: [:requires_admin]
factory :error_message_request, traits: [:error_message]
Expand All @@ -283,15 +285,20 @@
end

factory :info_request_with_plain_incoming, traits: [:with_plain_incoming]
factory :info_request_with_html_attachment, traits: [:with_incoming_with_html_attachment]
factory :info_request_with_incoming_attachments, traits: [:with_incoming_with_attachments]
factory :info_request_with_internal_review_request, traits: [:with_internal_review_request]
factory :embargoed_request, traits: [:embargoed, :with_incoming_with_attachments]
factory :info_request_with_html_attachment,
traits: [:with_incoming_with_html_attachment]
factory :info_request_with_incoming_attachments,
traits: [:with_incoming_with_attachments]
factory :info_request_with_internal_review_request,
traits: [:with_internal_review_request]
factory :embargoed_request,
traits: [:embargoed, :with_incoming_with_attachments]
factory :embargo_expiring_request, traits: [:embargo_expiring]
factory :re_embargoed_request, traits: [:re_embargoed]
factory :embargo_expired_request, traits: [:embargo_expired]
factory :external_request, traits: [:external]
factory :old_unclassified_request, traits: [:with_old_incoming, :awaiting_description]
factory :old_unclassified_request,
traits: [:with_old_incoming, :awaiting_description]
factory :awaiting_description, traits: [:awaiting_description]
factory :hidden_request, traits: [:hidden]
factory :backpage_request, traits: [:backpage]
Expand Down
5 changes: 4 additions & 1 deletion spec/factories/post_redirects.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,10 @@
public_body = FactoryBot.create(:public_body)
{
"outgoing_message" => {
"body" => "Dear Ministry of Defence,\r\n\r\nThis is my test\r\n\r\n\r\nYours faithfully,\r\n\r\nSteve Day",
"body" => "Dear Ministry of Defence,\r\n\r\n
This is my test\r\n\r\n\r\n
Yours faithfully,\r\n\r\n
Steve Day",
"what_doing"=>"normal_sort"
},
"info_request" => {
Expand Down
16 changes: 8 additions & 8 deletions spec/factories/public_bodies.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,21 @@
#
# Table name: public_bodies
#
# id :integer not null, primary key
# version :integer not null
# last_edit_editor :string not null
# id :integer not null, primary key
# version :integer not null
# last_edit_editor :string not null
# last_edit_comment :text
# created_at :datetime not null
# updated_at :datetime not null
# created_at :datetime not null
# updated_at :datetime not null
# home_page :text
# api_key :string not null
# info_requests_count :integer default(0), not null
# api_key :string not null
# info_requests_count :integer default(0), not null
# disclosure_log :text
# info_requests_successful_count :integer
# info_requests_not_held_count :integer
# info_requests_overdue_count :integer
# info_requests_visible_classified_count :integer
# info_requests_visible_count :integer default(0), not null
# info_requests_visible_count :integer default(0), not null
# name :text
# short_name :text
# request_email :text
Expand Down

0 comments on commit aa5a4fd

Please sign in to comment.