mirror of
https://github.com/discourse/discourse.git
synced 2024-12-30 08:04:53 +08:00
4a6b79dead
When visiting a user profile, and then opening the search, there's an option to filter down by posts made by that user. When clicking that option, it used to pre-fill the "search bar" with "@<username>" to filter down the search. This restore this behaviour and add a system spec to ensure it doesn't regress. Context - https://meta.discourse.org/t/in-posts-by-search-option-does-not-work-when-clicked/312916
18 lines
430 B
Ruby
18 lines
430 B
Ruby
# frozen_string_literal: true
|
|
|
|
describe "User page search", type: :system do
|
|
fab!(:user)
|
|
let(:search_page) { PageObjects::Pages::Search.new }
|
|
|
|
it "filters down to the user" do
|
|
sign_in(user)
|
|
|
|
visit("/u/#{user.username}")
|
|
search_page.click_search_icon
|
|
search_page.click_in_posts_by_user
|
|
|
|
expect(search_page).to have_found_no_results
|
|
expect(search_page.search_term).to eq("@#{user.username}")
|
|
end
|
|
end
|