Merge pull request #3980 from consul/erased-users

Filter erased users and show erase reason in admin
This commit is contained in:
Javier Martín
2020-07-17 23:00:12 +02:00
committed by GitHub
6 changed files with 61 additions and 11 deletions

View File

@@ -22,6 +22,28 @@ describe "Admin users" do
expect(page).to have_current_path(user_path(user))
end
scenario "Show active or erased users using filters" do
erased_user = create(:user, username: "Erased")
erased_user.erase("I don't like this site.")
visit admin_users_path
expect(page).not_to have_link("#{erased_user.id}", href: user_path(erased_user))
expect(page).to have_link("Erased")
click_link "Erased"
expect(page).to have_link("Active")
expect(page).to have_link("#{erased_user.id}", href: user_path(erased_user))
expect(page).to have_content "I don't like this site."
expect(page).to have_content("Erased")
fill_in :search, with: "Erased"
click_button "Search"
expect(page).to have_content "There are no users."
end
scenario "Search" do
fill_in :search, with: "Luis"
click_button "Search"