adds banned users section to moderation zone

This commit is contained in:
Juanjo Bazán
2015-09-07 17:56:53 +02:00
parent c7ff431160
commit af6cb16e9b
5 changed files with 93 additions and 8 deletions

View File

@@ -48,4 +48,28 @@ feature 'Moderate users' do
expect(current_path).to eq(new_user_session_path)
end
scenario 'Search and ban users' do
citizen = create(:user, username: 'Wanda Maximoff')
moderator = create(:moderator)
login_as(moderator.user)
visit moderation_users_path
expect(page).not_to have_content citizen.name
fill_in 'name_or_email', with: 'Wanda'
click_button 'Search'
within(".admin-list") do
expect(page).to have_content citizen.name
expect(page).not_to have_content "Banned"
click_link 'Ban'
end
within(".admin-list") do
expect(page).to have_content citizen.name
expect(page).to have_content "Banned"
end
end
end