mirror of
https://gh.wpcy.net/https://github.com/discourse/discourse.git
synced 2026-05-16 09:01:15 +08:00
A previous commit
9b998f10ce
has been causing an error where routes were not defined.
This commit follows an established pattern and adds a spec to ensure
basic behavior is working correctly.
---------
Co-authored-by: Jarek Radosz <jradosz@gmail.com>
31 lines
798 B
Ruby
31 lines
798 B
Ruby
# frozen_string_literal: true
|
|
|
|
RSpec.describe "User Notes", type: :system do
|
|
fab!(:admin)
|
|
fab!(:user)
|
|
|
|
before { SiteSetting.user_notes_enabled = true }
|
|
|
|
it "allows admin to manage user notes" do
|
|
sign_in(admin)
|
|
|
|
visit("/admin/users/#{user.id}/#{user.username}")
|
|
|
|
expect(page).to have_css(".show-user-notes-btn")
|
|
click_button(class: "show-user-notes-btn")
|
|
|
|
expect(page).to have_css(".user-notes-modal")
|
|
|
|
form = PageObjects::Components::FormKit.new(".user-notes-modal .form-kit")
|
|
form.field("content").fill_in("A NOTE")
|
|
form.submit
|
|
|
|
expect(page).to have_css(".user-note", text: "A NOTE")
|
|
|
|
find(".user-note .btn-danger").click
|
|
|
|
PageObjects::Components::Dialog.new.click_danger
|
|
|
|
expect(page).to have_no_css(".user-note", text: "A NOTE")
|
|
end
|
|
end
|