Skip to content

Commit

Permalink
Merge pull request #1194 from alphagov/dependabot/bundler/rubocop-gov…
Browse files Browse the repository at this point in the history
…uk-4.17.1

Bump rubocop-govuk from 4.17.0 to 4.17.1
  • Loading branch information
lauraghiorghisor-tw authored May 28, 2024
2 parents 1c3602f + 2c4809f commit 699f470
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 19 deletions.
6 changes: 3 additions & 3 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -616,13 +616,13 @@ GEM
rubocop (~> 1.41)
rubocop-factory_bot (2.25.1)
rubocop (~> 1.41)
rubocop-govuk (4.17.0)
rubocop-govuk (4.17.1)
rubocop (= 1.63.5)
rubocop-ast (= 1.31.3)
rubocop-rails (= 2.24.1)
rubocop-rails (= 2.25.0)
rubocop-rake (= 0.6.0)
rubocop-rspec (= 2.29.2)
rubocop-rails (2.24.1)
rubocop-rails (2.25.0)
activesupport (>= 4.2.0)
rack (>= 1.1)
rubocop (>= 1.33.0, < 2.0)
Expand Down
32 changes: 16 additions & 16 deletions test/functional/needs_controller_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ def complete_need_data
}
post(:create, params: { need: need_data })

assert_response 500
assert_response :internal_server_error
end

should "return a 422 error if the base path is in use" do
Expand All @@ -128,7 +128,7 @@ def complete_need_data
}
post(:create, params: { need: need_data })

assert_response 422
assert_response :unprocessable_entity
end

should "remove blank entries from justifications" do
Expand All @@ -147,7 +147,7 @@ def complete_need_data
should "add a blank value to met_when if a 'Add criteria' is requested" do
post(:create, params: { criteria_action: "Add criteria", need: complete_need_data })

assert_response 200
assert_response :ok
assert_equal ["Winning", "Awesome", ""], assigns[:need].met_when
end

Expand All @@ -168,7 +168,7 @@ def complete_need_data

post :create, params: { need: complete_need_data }

assert_response 403
assert_response :forbidden
assert_equal "Invalid authenticity token", response.body
end
end
Expand Down Expand Up @@ -327,7 +327,7 @@ def base_need_fields
content_id: need.content_id,
need: base_need_fields.merge("goal" => ""),
}
assert_response 422
assert_response :unprocessable_entity
end

should "return a 422 error if the base path is in use" do
Expand All @@ -340,7 +340,7 @@ def base_need_fields
content_id: need.content_id,
need: base_need_fields.merge("benefit" => "be awesome"),
}
assert_response 422
assert_response :unprocessable_entity
end

should "save the need if valid and redirect to show it" do
Expand Down Expand Up @@ -383,7 +383,7 @@ def base_need_fields
need: base_need_fields.merge("met_when" => ["something", "something else"]),
}

assert_response 422
assert_response :unprocessable_entity
assert_equal ["something", "something else"], assigns[:need].met_when
end

Expand All @@ -399,7 +399,7 @@ def base_need_fields
}
put(:update, params: { content_id: need.content_id, need: need_data })

assert_response 500
assert_response :internal_server_error
end

should "stop viewers from updating needs" do
Expand Down Expand Up @@ -439,7 +439,7 @@ def base_need_fields
need = complete_need_data.merge("met_when" => %w[Winning])
post(:create, params: { delete_criteria: "0", need: })

assert_response 200
assert_response :ok
assert_equal [], assigns[:need].met_when
end

Expand All @@ -449,14 +449,14 @@ def base_need_fields
)
post(:create, params: { delete_criteria: "2", need: data })

assert_response 200
assert_response :ok
assert_equal %w[0 1 3], assigns[:need].met_when
end

should "do nothing if an invalid request is made" do
post(:create, params: { delete_criteria: "foo", need: complete_need_data })

assert_response 200
assert_response :ok
assert_equal %w[Winning Awesome], assigns[:need].met_when
end
end
Expand Down Expand Up @@ -490,7 +490,7 @@ def base_need_fields
}

assert_equal "A problem was encountered when publishing", @controller.flash[:error]
assert_response 500
assert_response :internal_server_error
end
end

Expand Down Expand Up @@ -552,7 +552,7 @@ def base_need_fields
}

assert_equal "Need cannot be a duplicate of itself", @controller.flash[:error]
assert_response 422
assert_response :unprocessable_entity
end

should "not be able to replace a need with a missing duplicate" do
Expand All @@ -566,7 +566,7 @@ def base_need_fields
}

assert_equal "Duplicate need not found", @controller.flash[:error]
assert_response 422
assert_response :unprocessable_entity
end

should "not be able to edit a need closed as a duplicate" do
Expand All @@ -575,7 +575,7 @@ def base_need_fields
get :edit, params: { content_id: @duplicate_need.content_id }

assert_equal "Closed needs cannot be edited", @controller.flash[:notice]
assert_response 303
assert_response :see_other
end

should "stop viewers from marking needs as duplicates" do
Expand Down Expand Up @@ -605,7 +605,7 @@ def base_need_fields
}

assert_equal "Unknown action: some-other-action", @controller.flash[:error]
assert_response 422
assert_response :unprocessable_entity
end
end

Expand Down

0 comments on commit 699f470

Please sign in to comment.