discourse/spec/system/admin_badges_grouping_modal_spec.rb
Joffrey JAFFEUX b4f8ea6ade
FIX: correctly pass updateGroupings to the modal (#28683)
A previous refactor has moved this function in the controller instead of the route making it inaccessible to the modal.

This commit is fixing this and also adding a spec.
2024-09-02 17:32:18 +02:00

22 lines
638 B
Ruby

# frozen_string_literal: true
describe "Admin Badges Grouping Modal", type: :system do
before { SiteSetting.enable_badges = true }
fab!(:current_user) { Fabricate(:admin) }
let(:badges_page) { PageObjects::Pages::AdminBadges.new }
let(:badges_groupings_page) { PageObjects::Pages::AdminBadgesGroupings.new }
before { sign_in(current_user) }
context "when adding a new grouping" do
it "saves it" do
badges_page.visit_page(Badge::Autobiographer).edit_groupings
badges_groupings_page.add_grouping("a new grouping")
try_until_success { BadgeGrouping.exists?(name: "a new grouping") }
end
end
end