mirror of
https://github.com/discourse/discourse.git
synced 2024-12-17 03:13:46 +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.
26 lines
726 B
Ruby
26 lines
726 B
Ruby
# frozen_string_literal: true
|
|
|
|
describe "Group members", type: :system do
|
|
let(:group_page) { PageObjects::Pages::Group.new }
|
|
fab!(:admin)
|
|
fab!(:group)
|
|
|
|
before { sign_in(admin) }
|
|
|
|
describe "adds a user to the group" do
|
|
it "should show that the user is already in the group" do
|
|
group_page.visit(group).add_users.select_user_and_add(admin)
|
|
|
|
expect(
|
|
group_page.find(".group-members .directory-table__cell--username.group-member .username"),
|
|
).to have_text(admin.username)
|
|
|
|
group_page.add_users.select_user_and_add(admin)
|
|
|
|
expect(page.find(".modal-container #modal-alert")).to have_text(
|
|
"'#{admin.username}' is already a member of this group",
|
|
)
|
|
end
|
|
end
|
|
end
|