mirror of
https://github.com/discourse/discourse.git
synced 2024-12-24 06:33:53 +08:00
b4f8ea6ade
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.
22 lines
638 B
Ruby
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
|