mirror of
https://github.com/discourse/discourse.git
synced 2024-12-30 07:43:48 +08:00
6e161d3e75
The most common thing that we do with fab! is: fab!(:thing) { Fabricate(:thing) } This commit adds a shorthand for this which is just simply: fab!(:thing) i.e. If you omit the block, then, by default, you'll get a `Fabricate`d object using the fabricator of the same name.
33 lines
918 B
Ruby
33 lines
918 B
Ruby
# frozen_string_literal: true
|
|
|
|
describe "Viewing sidebar preferences", type: :system do
|
|
let(:user_preferences_navigation_menu_page) do
|
|
PageObjects::Pages::UserPreferencesNavigationMenu.new
|
|
end
|
|
|
|
before { SiteSetting.navigation_menu = "sidebar" }
|
|
|
|
context "as an admin" do
|
|
fab!(:admin)
|
|
fab!(:user)
|
|
|
|
before { sign_in(admin) }
|
|
|
|
it "should be able to view navigation menu preferences of another user" do
|
|
user.user_option.update!(
|
|
sidebar_link_to_filtered_list: true,
|
|
sidebar_show_count_of_new_items: true,
|
|
)
|
|
|
|
user_preferences_navigation_menu_page.visit(user)
|
|
|
|
expect(user_preferences_navigation_menu_page).to have_navigation_menu_preference_checked(
|
|
"pref-show-count-new-items",
|
|
)
|
|
expect(user_preferences_navigation_menu_page).to have_navigation_menu_preference_checked(
|
|
"pref-link-to-filtered-list",
|
|
)
|
|
end
|
|
end
|
|
end
|