Skip to content

Commit b0c3451

Browse files
authored
Merge branch 'main' into CDPTKAN-763-software-updates-factory_bot_rails
2 parents ca697c8 + f351d09 commit b0c3451

7 files changed

Lines changed: 73 additions & 63 deletions

File tree

Gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ group :development do
6464
gem 'binding_of_caller'
6565
gem 'listen', '~> 3.8'
6666
gem 'rubocop'
67-
gem 'rubocop-govuk', '~> 5.1.1'
67+
gem 'rubocop-govuk', '~> 5.2.0'
6868
gem 'ruby-lsp'
6969
gem 'spring'
7070
gem 'spring-watcher-listen', '~> 2.1.0'

Gemfile.lock

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -675,31 +675,31 @@ GEM
675675
rspec-support (3.13.2)
676676
rspec_junit_formatter (0.6.0)
677677
rspec-core (>= 2, < 4, != 2.12.0)
678-
rubocop (1.79.2)
678+
rubocop (1.86.0)
679679
json (~> 2.3)
680680
language_server-protocol (~> 3.17.0.2)
681681
lint_roller (~> 1.1.0)
682682
parallel (~> 1.10)
683683
parser (>= 3.3.0.2)
684684
rainbow (>= 2.2.2, < 4.0)
685685
regexp_parser (>= 2.9.3, < 3.0)
686-
rubocop-ast (>= 1.46.0, < 2.0)
686+
rubocop-ast (>= 1.49.0, < 2.0)
687687
ruby-progressbar (~> 1.7)
688688
unicode-display_width (>= 2.4.0, < 4.0)
689-
rubocop-ast (1.46.0)
689+
rubocop-ast (1.49.1)
690690
parser (>= 3.3.7.2)
691-
prism (~> 1.4)
691+
prism (~> 1.7)
692692
rubocop-capybara (2.22.1)
693693
lint_roller (~> 1.1)
694694
rubocop (~> 1.72, >= 1.72.1)
695-
rubocop-govuk (5.1.20)
696-
rubocop (= 1.79.2)
697-
rubocop-ast (= 1.46.0)
695+
rubocop-govuk (5.2.1)
696+
rubocop (= 1.86.0)
697+
rubocop-ast (= 1.49.1)
698698
rubocop-capybara (= 2.22.1)
699-
rubocop-rails (= 2.33.3)
699+
rubocop-rails (= 2.34.3)
700700
rubocop-rake (= 0.7.1)
701-
rubocop-rspec (= 3.6.0)
702-
rubocop-rails (2.33.3)
701+
rubocop-rspec (= 3.9.0)
702+
rubocop-rails (2.34.3)
703703
activesupport (>= 4.2.0)
704704
lint_roller (~> 1.1)
705705
rack (>= 1.1)
@@ -708,9 +708,9 @@ GEM
708708
rubocop-rake (0.7.1)
709709
lint_roller (~> 1.1)
710710
rubocop (>= 1.72.1)
711-
rubocop-rspec (3.6.0)
711+
rubocop-rspec (3.9.0)
712712
lint_roller (~> 1.1)
713-
rubocop (~> 1.72, >= 1.72.1)
713+
rubocop (~> 1.81)
714714
ruby-lsp (0.26.9)
715715
language_server-protocol (~> 3.17.0)
716716
prism (>= 1.2, < 2.0)
@@ -873,7 +873,7 @@ DEPENDENCIES
873873
rspec-rails
874874
rspec_junit_formatter
875875
rubocop
876-
rubocop-govuk (~> 5.1.1)
876+
rubocop-govuk (~> 5.2.0)
877877
ruby-lsp
878878
sass-rails (>= 6)
879879
selenium-webdriver (= 4.15.0)

app/controllers/admin/services_controller.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,12 +159,14 @@ def approve
159159
approval.value = '1'
160160
approval.save!
161161
end
162+
# rubocop:disable Rails/Presence
162163
if revoke.present?
163164
revoke.delete
164165
end
165166
if awaiting.present?
166167
awaiting.delete
167168
end
169+
# rubocop:enable Rails/Presence
168170

169171
if unpublish_review_service(service_id)
170172
flash[:success] = 'Service approved for go live - queueing for unpublish'
@@ -198,12 +200,14 @@ def revoke_approval
198200
revoke.value = '1'
199201
revoke.save!
200202
end
203+
# rubocop:disable Rails/Presence
201204
if approval.present?
202205
approval.delete
203206
end
204207
if awaiting.present?
205208
awaiting.delete
206209
end
210+
# rubocop:enable Rails/Presence
207211

208212
if unpublish_review_service(service_id)
209213
flash[:success] = 'Service requires changes - queueing for unpublish'

app/helpers/moj_forms_components_helper.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ module MojFormsComponentsHelper
77
define_method(name) do |*args, **kwargs, &block|
88
capture do
99
render(klass.constantize.new(*args, **kwargs)) do |com|
10-
block.call(com) if block.present?
10+
block.call(com) if block.present? # rubocop:disable Rails/Presence
1111
end
1212
end
1313
end

app/services/publish_service_creation.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ def service_configuration(name:, deployment_environment:)
5959
name: name.to_s.upcase
6060
)
6161

62-
configuration.decrypt_value if configuration.present?
62+
configuration.decrypt_value if configuration.present? # rubocop:disable Rails/Presence
6363
end
6464

6565
def existing_authentication?(deployment_environment:)

spec/generators/new_flow_branch_generator_spec.rb

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -35,17 +35,19 @@
3535
'next' => {
3636
'default' => 'default-next-uuid',
3737
'conditionals' => [
38-
'_uuid' => 'you-can-do-it',
39-
'_type' => 'if',
40-
'next' => 'another-page-uuid',
41-
'expressions' => [
42-
{
43-
'operator' => 'is',
44-
'page' => 'expression-page-uuid',
45-
'component' => 'component-uuid',
46-
'field' => 'field-uuid'
47-
}
48-
]
38+
{
39+
'_uuid' => 'you-can-do-it',
40+
'_type' => 'if',
41+
'next' => 'another-page-uuid',
42+
'expressions' => [
43+
{
44+
'operator' => 'is',
45+
'page' => 'expression-page-uuid',
46+
'component' => 'component-uuid',
47+
'field' => 'field-uuid'
48+
}
49+
]
50+
}
4951
]
5052
}
5153
}

spec/services/page_updater_spec.rb

Lines changed: 40 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -315,24 +315,26 @@ def find_page_uuid(url, meta)
315315
let(:attributes_to_update) do
316316
{
317317
'components' => [
318-
'_uuid' => 'ac41be35-914e-4b22-8683-f5477716b7d4',
319-
'items' => [
320-
{
321-
'_uuid' => ''
322-
},
323-
{
324-
'_uuid' => ''
325-
},
326-
{
327-
'_uuid' => ''
328-
},
329-
{
330-
'_uuid' => nil
331-
},
332-
{
333-
'_uuid' => nil
334-
}
335-
]
318+
{
319+
'_uuid' => 'ac41be35-914e-4b22-8683-f5477716b7d4',
320+
'items' => [
321+
{
322+
'_uuid' => ''
323+
},
324+
{
325+
'_uuid' => ''
326+
},
327+
{
328+
'_uuid' => ''
329+
},
330+
{
331+
'_uuid' => nil
332+
},
333+
{
334+
'_uuid' => nil
335+
}
336+
]
337+
}
336338
]
337339
}.stringify_keys
338340
end
@@ -387,24 +389,26 @@ def find_page_uuid(url, meta)
387389
let(:attributes_to_update) do
388390
{
389391
'components' => [
390-
'_uuid' => 'ac41be35-914e-4b22-8683-f5477716b7d4',
391-
'items' => [
392-
{
393-
'_uuid' => 'c5571937-9388-4411-b5fa-34ddf9bc4ca0'
394-
},
395-
{
396-
'_uuid' => '67160ff1-6f7c-43a8-8bf6-49b3d5f450f6'
397-
},
398-
{
399-
'_uuid' => 'ac41be35-914e-4b22-8683-f5477716b7d4'
400-
},
401-
{
402-
'_uuid' => 'ac41be35-914e-4b22-8683-f5477716b7d4'
403-
},
404-
{
405-
'_uuid' => 'ac41be35-914e-4b22-8683-f5477716b7d4'
406-
}
407-
]
392+
{
393+
'_uuid' => 'ac41be35-914e-4b22-8683-f5477716b7d4',
394+
'items' => [
395+
{
396+
'_uuid' => 'c5571937-9388-4411-b5fa-34ddf9bc4ca0'
397+
},
398+
{
399+
'_uuid' => '67160ff1-6f7c-43a8-8bf6-49b3d5f450f6'
400+
},
401+
{
402+
'_uuid' => 'ac41be35-914e-4b22-8683-f5477716b7d4'
403+
},
404+
{
405+
'_uuid' => 'ac41be35-914e-4b22-8683-f5477716b7d4'
406+
},
407+
{
408+
'_uuid' => 'ac41be35-914e-4b22-8683-f5477716b7d4'
409+
}
410+
]
411+
}
408412
]
409413
}.stringify_keys
410414
end

0 commit comments

Comments
 (0)