Skip to content

Commit

Permalink
fix UT
Browse files Browse the repository at this point in the history
  • Loading branch information
Cesium-Ice committed Dec 26, 2024
1 parent 79aa4f8 commit 9f3c3c5
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions spec/controllers/locale_languages_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -196,10 +196,7 @@
{
id: finnish.short,
locale_language: {
name: "Suomi",
short: "fi",
support_available: "1",

Check warning on line 199 in spec/controllers/locale_languages_controller_spec.rb

View workflow job for this annotation

GitHub Actions / Rubocop

[rubocop] reported by reviewdog 🐶 Avoid comma after the last item of a hash. Raw Output: spec/controllers/locale_languages_controller_spec.rb:199:33: C: Style/TrailingCommaInHashLiteral: Avoid comma after the last item of a hash.
sortable_name: ""
}
}
end
Expand Down Expand Up @@ -259,7 +256,7 @@
end


context "when logged in as an admin with policy_and_abuse role and I attempt to edit a non-abuse field" do
context "when logged in as an admin with policy_and_abuse role and I attempt to edit a field other than abuse_support_available" do
let(:admin) { create(:admin, roles: ["policy_and_abuse"]) }
before do
fake_login_admin(admin)
Expand Down Expand Up @@ -308,19 +305,16 @@
end
end

context "when logged in as an admin with support role and attempt to edit non-abuse fields" do
context "when logged in as an admin with support role and attempt to edit support_available field" do
let(:admin) { create(:admin, roles: ["support"]) }
before do
fake_login_admin(admin)
put :update, params: language_params_support
end
it "updates the language" do
finnish.reload
expect(finnish.name).to eq("Suomi")
expect(finnish.short).to eq("fi")
expect(finnish.support_available).to eq(true)
expect(finnish.abuse_support_available).to eq(true)
expect(finnish.sortable_name).to eq("")
end

it "redirects and returns success message" do
Expand Down

0 comments on commit 9f3c3c5

Please sign in to comment.