From 454ae678e6e5fb9b4e148d4865b05d78c463df22 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juanjo=20Baza=CC=81n?= Date: Tue, 27 Dec 2016 18:51:38 +0100 Subject: [PATCH] adds spec for user#poll_officer? --- spec/models/user_spec.rb | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/spec/models/user_spec.rb b/spec/models/user_spec.rb index ed0bac164..0f03086ba 100644 --- a/spec/models/user_spec.rb +++ b/spec/models/user_spec.rb @@ -151,6 +151,18 @@ describe User do end end + describe "poll_officer?" do + it "is false when the user is not a poll officer" do + expect(subject.poll_officer?).to be false + end + + it "is true when the user is a poll officer" do + subject.save + create(:poll_officer, user: subject) + expect(subject.poll_officer?).to be true + end + end + describe "organization?" do it "is false when the user is not an organization" do expect(subject.organization?).to be false