Use let only in the examples using the variables
These variables were only used in the `validations` block; the rest of the tests re-defined them, making the code hard to follow.
This commit is contained in:
@@ -1,13 +1,11 @@
|
||||
require "rails_helper"
|
||||
|
||||
describe Poll::Voter do
|
||||
|
||||
let(:poll) { create(:poll) }
|
||||
let(:booth) { create(:poll_booth) }
|
||||
let(:booth_assignment) { create(:poll_booth_assignment, poll: poll, booth: booth) }
|
||||
let(:voter) { create(:poll_voter) }
|
||||
|
||||
describe "validations" do
|
||||
let(:poll) { create(:poll) }
|
||||
let(:booth) { create(:poll_booth) }
|
||||
let(:booth_assignment) { create(:poll_booth_assignment, poll: poll, booth: booth) }
|
||||
let(:voter) { create(:poll_voter) }
|
||||
let(:user) { create(:user, :level_two) }
|
||||
|
||||
it "is valid" do
|
||||
|
||||
Reference in New Issue
Block a user