creates polling officers from admin

This commit is contained in:
rgarcia
2016-09-14 13:53:35 +02:00
parent 76cd435808
commit c9b8a58e3f
19 changed files with 216 additions and 2 deletions

View File

@@ -0,0 +1,36 @@
require 'rails_helper'
feature 'Admin poll officers' do
background do
@admin = create(:administrator)
@user = create(:user, username: 'Pedro Jose Garcia')
@officer = create(:poll_officer)
login_as(@admin.user)
visit admin_poll_officers_path
end
scenario 'Index' do
expect(page).to have_content @officer.name
expect(page).to have_content @officer.email
expect(page).to_not have_content @user.name
end
scenario 'Create poll officer', :js do
fill_in 'email', with: @user.email
click_button 'Search'
expect(page).to have_content @user.name
click_link 'Add'
within("#officers") do
expect(page).to have_content @user.name
end
end
scenario 'Delete poll officer' do
click_link 'Delete'
within("#officers") do
expect(page).to_not have_content @officer.name
end
end
end