-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathspec.rb
64 lines (47 loc) · 1.5 KB
/
spec.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
require_relative 'spec_helper'
describe Contact do
before :each do
@contact = Contact.new
end
describe "#find" do
it "should return array with contact if contact is find" do
result = Contact.find("and") #and sure is in DB
expect(result).to be_kind_of(Array)
end
it "should return nil with contact if contact is find" do
result = Contact.find("ZzZZzzzzzzzzzzzzzz").class #and sure is in DB
expect(result).to be(NilClass)
end
end
describe "#find_exactly" do
it "should return array with contact if contact is find" do
result = Contact.find("and") #and sure is in DB
expect(result).to be_kind_of(Array)
end
it "should return nil with contact if contact is find" do
result = Contact.find("ZzZZzzzzzzzzzzzzzz").class #and sure is in DB
expect(result).to be(NilClass)
end
end
end
describe Application do
before :each do
@app = Application.new
end
describe "#self.repeated_mail?" do
it "Should return true if contact found" do
Contact.should_receive(:find_exactly).and_return true
result = Application.repeated_mail? ("Blah")
expect(result).to be(true)
end
it "Should return true if contact found" do
Contact.should_receive(:find_exactly).and_return false
result = Application.repeated_mail? ("Blah")
expect(result).to be(false)
end
end
describe"#add_phone" do
it "return 'old' contact with phone" do
end
end
end