Spec: test email_domain_for_officials

This commit is contained in:
Jakub
2015-11-29 14:23:50 +01:00
parent b4be4259b7
commit a1e4c1526b

View File

@@ -240,6 +240,15 @@ describe User do
end end
end end
describe "check_email_domain" do
it "assigns official level to users with the officials' email domain" do
user1 = create(:user, email: "john@madrid.es")
user2 = create(:user, email: "john@example.org")
expect(user1.official_level).to eq(1)
expect(user2.official?).to_not eq(true)
end
end
describe "self.search" do describe "self.search" do
it "find users by email" do it "find users by email" do
user1 = create(:user, email: "larry@madrid.es") user1 = create(:user, email: "larry@madrid.es")