mirror of
https://gh.wpcy.net/https://github.com/discourse/discourse.git
synced 2026-04-30 03:46:52 +08:00
We should check the H1 is not present anymore only once we have confirmed we changed page.
23 lines
690 B
Ruby
23 lines
690 B
Ruby
# frozen_string_literal: true
|
|
|
|
describe "Private Message", type: :system do
|
|
let(:sender) { Fabricate(:user) }
|
|
let(:recipient) { Fabricate(:user) }
|
|
|
|
let(:post) { Fabricate(:private_message_post, user: sender, recipient: recipient) }
|
|
|
|
before { sign_in(recipient) }
|
|
|
|
context "when being removed from private conversation" do
|
|
it "redirects away from the private message" do
|
|
visit(post.full_url)
|
|
|
|
expect(page).to have_css("h1", text: post.topic.title)
|
|
|
|
post.topic.remove_allowed_user(sender, recipient)
|
|
|
|
expect(page).to have_current_path("/u/#{recipient.username}/messages")
|
|
expect(page).to have_no_css("h1", text: post.topic.title)
|
|
end
|
|
end
|
|
end
|