Files
nairobi/spec/features/budget_polls/officing_spec.rb
Javi Martín db97f9d08c Add and apply rubocop rules for empty lines
We were very inconsistent regarding these rules.

Personally I prefer no empty lines around blocks, clases, etc... as
recommended by the Ruby style guide [1], and they're the default values
in rubocop, so those are the settings I'm applying.

The exception is the `private` access modifier, since we were leaving
empty lines around it most of the time. That's the default rubocop rule
as well. Personally I don't have a strong preference about this one.


[1] https://rubystyle.guide/#empty-lines-around-bodies
2019-10-24 17:11:47 +02:00

38 lines
1.4 KiB
Ruby

require "rails_helper"
describe "Budget Poll Officing" do
scenario "Show sidebar menus if officer has shifts assigned" do
booth = create(:poll_booth)
booth_assignment = create(:poll_booth_assignment, booth: booth)
officer = create(:poll_officer)
create(:poll_shift, officer: officer, booth: booth, date: Date.current, task: :vote_collection)
login_as officer.user
visit officing_root_path
expect(page).not_to have_content("You don't have officing shifts today")
expect(page).to have_content("Validate document")
expect(page).not_to have_content("Total recounts and results")
create(:poll_shift, officer: officer, booth: booth, date: Date.current, task: :recount_scrutiny)
create(:poll_officer_assignment, booth_assignment: booth_assignment, officer: officer)
visit officing_root_path
expect(page).not_to have_content("You don't have officing shifts today")
expect(page).to have_content("Validate document")
expect(page).to have_content("Total recounts and results")
end
scenario "Do not show sidebar menus if officer has no shifts assigned" do
login_as(create(:poll_officer).user)
visit officing_root_path
expect(page).to have_content("You don't have officing shifts today")
expect(page).not_to have_content("Validate document")
expect(page).not_to have_content("Total recounts and results")
end
end