Simplify login for officer user in tests

The same way it's done in other places. We also remove a useless
assignment.
This commit is contained in:
Javi Martín
2019-09-23 00:23:19 +02:00
parent 175163adb6
commit 24aa4744f1
3 changed files with 8 additions and 15 deletions

View File

@@ -47,8 +47,7 @@ describe "Admin" do
end
scenario "Access as poll officer is not authorized" do
create(:poll_officer, user: user)
login_as(user)
login_as(create(:poll_officer).user)
visit admin_root_path
expect(page).not_to have_current_path(admin_root_path)