career_builder 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.document +5 -0
- data/.gitignore +22 -0
- data/Gemfile +10 -0
- data/LICENSE +20 -0
- data/README.md +91 -0
- data/Rakefile +48 -0
- data/VERSION +1 -0
- data/career_builder.gemspec +95 -0
- data/lib/career_builder.rb +39 -0
- data/lib/career_builder/api/company.rb +17 -0
- data/lib/career_builder/api/interest.rb +16 -0
- data/lib/career_builder/api/job_type.rb +15 -0
- data/lib/career_builder/api/language.rb +15 -0
- data/lib/career_builder/api/location.rb +19 -0
- data/lib/career_builder/api/pay.rb +16 -0
- data/lib/career_builder/api/resume.rb +67 -0
- data/lib/career_builder/api/resume_search.rb +22 -0
- data/lib/career_builder/api/resume_search_result.rb +28 -0
- data/lib/career_builder/api/school.rb +18 -0
- data/lib/career_builder/api/shift_preference.rb +15 -0
- data/lib/career_builder/api/word_document.rb +16 -0
- data/lib/career_builder/client.rb +37 -0
- data/lib/career_builder/errors.rb +7 -0
- data/lib/career_builder/request.rb +82 -0
- data/lib/career_builder/request/authenticated.rb +23 -0
- data/lib/career_builder/requests/advanced_resume_search.rb +41 -0
- data/lib/career_builder/requests/authentication.rb +25 -0
- data/lib/career_builder/requests/get_resume.rb +24 -0
- data/lib/career_builder/requests/resume_actions_remaining_today.rb +21 -0
- data/lib/career_builder/resume.rb +44 -0
- data/lib/career_builder/resume/lazy_collection.rb +39 -0
- data/spec/career_builder/client_spec.rb +554 -0
- data/spec/career_builder/resume/lazy_collection_spec.rb +30 -0
- data/spec/career_builder/resume_spec.rb +5 -0
- data/spec/career_builder_spec.rb +5 -0
- data/spec/spec.opts +1 -0
- data/spec/spec_helper.rb +13 -0
- data/spec/support/webmock.rb +7 -0
- metadata +169 -0
@@ -0,0 +1,44 @@
|
|
1
|
+
module CareerBuilder
|
2
|
+
|
3
|
+
class Resume < BasicObject
|
4
|
+
|
5
|
+
attr_reader :client
|
6
|
+
|
7
|
+
def initialize(client, partial_resume)
|
8
|
+
@partial_resume = partial_resume
|
9
|
+
@client = client
|
10
|
+
end
|
11
|
+
|
12
|
+
def real_contact_email
|
13
|
+
full_resume.contact_email
|
14
|
+
end
|
15
|
+
|
16
|
+
def home_location
|
17
|
+
full_resume.home_location
|
18
|
+
end
|
19
|
+
|
20
|
+
private
|
21
|
+
|
22
|
+
def method_missing(meth, *args, &block)
|
23
|
+
if partial_resume.respond_to?(meth)
|
24
|
+
partial_resume.send(meth, *args, &block)
|
25
|
+
else
|
26
|
+
if full_resume.respond_to?(meth)
|
27
|
+
full_resume.send(meth, *args, &block)
|
28
|
+
else
|
29
|
+
super
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
def partial_resume
|
35
|
+
@partial_resume
|
36
|
+
end
|
37
|
+
|
38
|
+
def full_resume
|
39
|
+
@full_resume ||= client.get_resume(:resume_id => @partial_resume.id)
|
40
|
+
end
|
41
|
+
|
42
|
+
end
|
43
|
+
|
44
|
+
end
|
@@ -0,0 +1,39 @@
|
|
1
|
+
module CareerBuilder
|
2
|
+
|
3
|
+
class Resume::LazyCollection
|
4
|
+
|
5
|
+
attr_reader :search_options, :client
|
6
|
+
|
7
|
+
def initialize(client, options)
|
8
|
+
@client = client
|
9
|
+
@search_options = options
|
10
|
+
end
|
11
|
+
|
12
|
+
def each
|
13
|
+
current_page = search_options[:page] || 1
|
14
|
+
|
15
|
+
search = client.advanced_resume_search(search_options.merge(:page_number => current_page))
|
16
|
+
|
17
|
+
results = search.results
|
18
|
+
hits = search.hits
|
19
|
+
max_page = search.max_page
|
20
|
+
|
21
|
+
loop do
|
22
|
+
|
23
|
+
results.each do |resume|
|
24
|
+
yield Resume.new(client, resume)
|
25
|
+
end
|
26
|
+
|
27
|
+
current_page += 1
|
28
|
+
|
29
|
+
break if current_page > max_page
|
30
|
+
|
31
|
+
search = client.advanced_resume_search(search_options.merge(:page_number => current_page))
|
32
|
+
results = search.results
|
33
|
+
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
37
|
+
end
|
38
|
+
|
39
|
+
end
|
@@ -0,0 +1,554 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe CareerBuilder::Client do
|
4
|
+
|
5
|
+
describe "#authenticate" do
|
6
|
+
|
7
|
+
context "with valid credentials" do
|
8
|
+
|
9
|
+
before do
|
10
|
+
stub_request(:post, "http://ws.careerbuilder.com/resumes/resumes.asmx/BeginSessionV2").with(:body => 'Packet=%3cPacket%3e%3cEmail%3evalid_email%3c%2fEmail%3e%3cPassword%3evalid_password%3c%2fPassword%3e%3c%2fPacket%3e').to_return(:body => "<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<string xmlns=\"http://ws.careerbuilder.com/resumes/\"><Packet><Errors /><SessionToken>42df77a98a874c6ca8644cf8e8ceffa6-330779842-RY-4</SessionToken></Packet></string>")
|
11
|
+
@client = CareerBuilder::Client.new("valid_email", "valid_password")
|
12
|
+
end
|
13
|
+
|
14
|
+
it 'should return true' do
|
15
|
+
@client.authenticate.should be_true
|
16
|
+
end
|
17
|
+
|
18
|
+
it 'should be authenticated' do
|
19
|
+
@client.authenticate
|
20
|
+
@client.should be_authenticated
|
21
|
+
end
|
22
|
+
|
23
|
+
end
|
24
|
+
|
25
|
+
context "with invalid credentials" do
|
26
|
+
|
27
|
+
before do
|
28
|
+
stub_request(:post, "http://ws.careerbuilder.com/resumes/resumes.asmx/BeginSessionV2").with(:body => 'Packet=%3cPacket%3e%3cEmail%3evalid_email%3c%2fEmail%3e%3cPassword%3einvalid_password%3c%2fPassword%3e%3c%2fPacket%3e').to_return(:body => "<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<string xmlns=\"http://ws.careerbuilder.com/resumes/\"><Packet><Errors><CBError><Code>300</Code><Text>300|Email (ryan@recruitmilitary.com) and password (AZG24N4) could not be validated.</Text></CBError></Errors><SessionToken>Invalid</SessionToken></Packet></string>")
|
29
|
+
@client = CareerBuilder::Client.new("valid_email", "invalid_password")
|
30
|
+
end
|
31
|
+
|
32
|
+
it 'should return false' do
|
33
|
+
@client.authenticate.should be_false
|
34
|
+
end
|
35
|
+
|
36
|
+
it 'should not be authenticated' do
|
37
|
+
@client.authenticate
|
38
|
+
@client.should_not be_authenticated
|
39
|
+
end
|
40
|
+
|
41
|
+
end
|
42
|
+
|
43
|
+
end
|
44
|
+
|
45
|
+
describe "#advanced_resume_search" do
|
46
|
+
|
47
|
+
context "with invalid credentials" do
|
48
|
+
|
49
|
+
before do
|
50
|
+
@client = CareerBuilder::Client.new("valid_email", "invalid_password")
|
51
|
+
@client.stub(:authenticate).and_return(false)
|
52
|
+
end
|
53
|
+
|
54
|
+
context "with valid options" do
|
55
|
+
|
56
|
+
it 'should raise InvalidCredentials' do
|
57
|
+
expect {
|
58
|
+
@client.advanced_resume_search(:keywords => "Ruby")
|
59
|
+
}.to raise_error(CareerBuilder::InvalidCredentials)
|
60
|
+
end
|
61
|
+
|
62
|
+
end
|
63
|
+
|
64
|
+
context "with invalid options" do
|
65
|
+
|
66
|
+
it 'should raise ArgumentError' do
|
67
|
+
expect {
|
68
|
+
@client.advanced_resume_search(:foo => "bar")
|
69
|
+
}.to raise_error(ArgumentError)
|
70
|
+
end
|
71
|
+
|
72
|
+
end
|
73
|
+
|
74
|
+
end
|
75
|
+
|
76
|
+
context "with valid credentials" do
|
77
|
+
|
78
|
+
before do
|
79
|
+
@client = CareerBuilder::Client.new("valid_email", "valid_password")
|
80
|
+
@client.stub(:session_token).and_return(42)
|
81
|
+
@client.stub(:authenticate).and_return(true)
|
82
|
+
end
|
83
|
+
|
84
|
+
context "with valid options" do
|
85
|
+
|
86
|
+
before do
|
87
|
+
stub_request(:post, "http://ws.careerbuilder.com/resumes/resumes.asmx/V2_AdvancedResumeSearch").with(:body => 'Packet=%3cPacket%3e%3cSessionToken%3e42%3c%2fSessionToken%3e%3cKeywords%3eRuby%3c%2fKeywords%3e%3c%2fPacket%3e').to_return(:body => "<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<string xmlns=\"http://ws.careerbuilder.com/resumes/\"><Packet><Errors /><PageNumber>1</PageNumber><SearchTime>06/25/2010 12:03:14</SearchTime><FirstRec>1</FirstRec><LastRec>100</LastRec><Hits>3</Hits><MaxPage>1</MaxPage><Results><ResumeResultItem_V3><ContactEmail>Rhd4G067G4JVTLW99H7_A7C14Q67VKG000YBSCR~CBWS^U7A3LY6YY46V1MT0RJK@resume.cbdr.com</ContactEmail><ContactName>Rebecca Bernard</ContactName><HomeLocation>US-OH-Milford</HomeLocation><LastUpdate>2010/5/13</LastUpdate><ResumeTitle>BERNARD_SYSTEMS_ENGINEER</ResumeTitle><JobTitle>BERNARD_SYSTEMS_ENGINEER</JobTitle><RecentEmployer>TATA CONSULTANCY SERVICES</RecentEmployer><RecentJobTitle>CONSULTANCY SERVICES- Systems Engineer</RecentJobTitle><RecentPay>0</RecentPay><ResumeID>Rhd4G067G4JVTLW99H7</ResumeID><UserDID>U7X86R61VVKS4FWS03T</UserDID><ContactEmailMD5>139013c2fa2b945bdc340f8a698b009e</ContactEmailMD5></ResumeResultItem_V3><ResumeResultItem_V3><ContactEmail>Rhe7TZ764LHG1GQTPSM_A7C14Q67VKG000YBSCR~CBWS^U7A3LY6YY46V1MT0RJK@resume.cbdr.com</ContactEmail><ContactName>chris grader</ContactName><HomeLocation>US-OH-Milford</HomeLocation><LastUpdate>2010/6/4</LastUpdate><ResumeTitle>Chris Grader resume</ResumeTitle><JobTitle>Chris Grader resume</JobTitle><RecentEmployer>Millennial Medical, Inc</RecentEmployer><RecentJobTitle>Regional Sales Manager/Midwest Distributor</RecentJobTitle><RecentPay>0</RecentPay><ResumeID>Rhe7TZ764LHG1GQTPSM</ResumeID><UserDID>U346V1MKGCHPGCF9S8</UserDID><ContactEmailMD5>cfba57bf848b78211d99348cf0f90879</ContactEmailMD5></ResumeResultItem_V3><ResumeResultItem_V3><ContactEmail>RH52G867678F7GH02Q3_A7C14Q67VKG000YBSCR~CBWS^U7A3LY6YY46V1MT0RJK@resume.cbdr.com</ContactEmail><ContactName>Jeffrey Davis</ContactName><HomeLocation>US-OH-Goshen</HomeLocation><LastUpdate>2010/5/23</LastUpdate><ResumeTitle>Warehouse Distribution Specialist</ResumeTitle><JobTitle>Warehouse Distribution Specialist</JobTitle><RecentEmployer>OWENS &amp; MINOR</RecentEmployer><RecentJobTitle>Warehouse Lead Supervisor</RecentJobTitle><RecentPay>35776</RecentPay><ResumeID>RH52G867678F7GH02Q3</ResumeID><UserDID>U1C29V68M3YM95SP0XK</UserDID><ContactEmailMD5>e814ebaa93aae5c3719e27d26d5af917</ContactEmailMD5></ResumeResultItem_V3></Results></Packet></string>")
|
88
|
+
@search = @client.advanced_resume_search(:keywords => "Ruby")
|
89
|
+
end
|
90
|
+
|
91
|
+
it 'should have the correct page number' do
|
92
|
+
@search.page_number.should == 1
|
93
|
+
end
|
94
|
+
|
95
|
+
it 'should have the correct search time' do
|
96
|
+
@search.search_time.should == Time.mktime(2010, 6, 25, 12, 3, 14)
|
97
|
+
end
|
98
|
+
|
99
|
+
it 'should return the correct number of hits' do
|
100
|
+
@search.hits.should == 3
|
101
|
+
end
|
102
|
+
|
103
|
+
it 'should return the correct max page' do
|
104
|
+
@search.max_page.should == 1
|
105
|
+
end
|
106
|
+
|
107
|
+
describe "#results" do
|
108
|
+
|
109
|
+
before do
|
110
|
+
@results = @search.results
|
111
|
+
@result = @results.first
|
112
|
+
end
|
113
|
+
|
114
|
+
it 'should return the correct contact email' do
|
115
|
+
@result.contact_email.should == "Rhd4G067G4JVTLW99H7_A7C14Q67VKG000YBSCR~CBWS^U7A3LY6YY46V1MT0RJK@resume.cbdr.com"
|
116
|
+
end
|
117
|
+
|
118
|
+
it 'should return the correct contact name' do
|
119
|
+
@result.contact_name.should == "Rebecca Bernard"
|
120
|
+
end
|
121
|
+
|
122
|
+
it 'should return the correct home location' do
|
123
|
+
@result.home_location.should == "US-OH-Milford"
|
124
|
+
end
|
125
|
+
|
126
|
+
it 'should return the correct last update' do
|
127
|
+
@result.last_update.should == Date.new(2010, 5, 13)
|
128
|
+
end
|
129
|
+
|
130
|
+
it 'should return the correct resume title' do
|
131
|
+
@result.title.should == "BERNARD_SYSTEMS_ENGINEER"
|
132
|
+
end
|
133
|
+
|
134
|
+
it 'should return the correct job title' do
|
135
|
+
@result.job_title.should == "BERNARD_SYSTEMS_ENGINEER"
|
136
|
+
end
|
137
|
+
|
138
|
+
it 'should return the correct recent pay' do
|
139
|
+
@result.recent_pay.should == 0
|
140
|
+
end
|
141
|
+
|
142
|
+
it 'should return the correct id' do
|
143
|
+
@result.id.should == "Rhd4G067G4JVTLW99H7"
|
144
|
+
end
|
145
|
+
|
146
|
+
it 'should return the correct user id' do
|
147
|
+
@result.user_did.should == "U7X86R61VVKS4FWS03T"
|
148
|
+
end
|
149
|
+
|
150
|
+
it 'should return the correct contact email md5' do
|
151
|
+
@result.contact_email_md5.should == "139013c2fa2b945bdc340f8a698b009e"
|
152
|
+
end
|
153
|
+
|
154
|
+
end
|
155
|
+
|
156
|
+
end
|
157
|
+
|
158
|
+
context "with invalid options" do
|
159
|
+
|
160
|
+
it 'should raise ArgumentError' do
|
161
|
+
expect {
|
162
|
+
@client.advanced_resume_search(:foo => "bar")
|
163
|
+
}.to raise_error(ArgumentError)
|
164
|
+
end
|
165
|
+
|
166
|
+
end
|
167
|
+
|
168
|
+
end
|
169
|
+
|
170
|
+
end
|
171
|
+
|
172
|
+
describe "get_resume" do
|
173
|
+
|
174
|
+
context "with invalid credentials" do
|
175
|
+
|
176
|
+
before do
|
177
|
+
@client = CareerBuilder::Client.new("valid_email", "invalid_password")
|
178
|
+
@client.stub(:authenticate).and_return(false)
|
179
|
+
end
|
180
|
+
|
181
|
+
context "with valid options" do
|
182
|
+
|
183
|
+
it 'should raise InvalidCredentials' do
|
184
|
+
expect {
|
185
|
+
@client.get_resume(:resume_id => "4242424242")
|
186
|
+
}.to raise_error(CareerBuilder::InvalidCredentials)
|
187
|
+
end
|
188
|
+
|
189
|
+
end
|
190
|
+
|
191
|
+
context "with invalid options" do
|
192
|
+
|
193
|
+
it 'should raise ArgumentError' do
|
194
|
+
expect {
|
195
|
+
@client.get_resume(:foo => "bar")
|
196
|
+
}.to raise_error(ArgumentError)
|
197
|
+
end
|
198
|
+
|
199
|
+
end
|
200
|
+
|
201
|
+
end
|
202
|
+
|
203
|
+
context "with valid credentials" do
|
204
|
+
|
205
|
+
before do
|
206
|
+
@client = CareerBuilder::Client.new("valid_email", "valid_password")
|
207
|
+
@client.stub(:session_token).and_return(42)
|
208
|
+
@client.stub(:authenticate).and_return(true)
|
209
|
+
end
|
210
|
+
|
211
|
+
context "with invalid options" do
|
212
|
+
|
213
|
+
it 'should raise ArgumentError' do
|
214
|
+
expect {
|
215
|
+
@client.get_resume(:foo => "bar")
|
216
|
+
}.to raise_error(ArgumentError)
|
217
|
+
end
|
218
|
+
|
219
|
+
end
|
220
|
+
|
221
|
+
context "when out of credits" do
|
222
|
+
|
223
|
+
before do
|
224
|
+
stub_request(:post, "http://ws.careerbuilder.com/resumes/resumes.asmx/V2_GetResume").with(:body => 'Packet=%3cPacket%3e%3cSessionToken%3e42%3c%2fSessionToken%3e%3cResumeID%3eRH52G867678F7GH02Q3%3c%2fResumeID%3e%3c%2fPacket%3e').to_return(:body => "<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<string xmlns=\"http://ws.careerbuilder.com/resumes/\"><Packet><Warning></Warning></Packet></string>")
|
225
|
+
end
|
226
|
+
|
227
|
+
it 'should raise OutOfCredits' do
|
228
|
+
expect {
|
229
|
+
@resume = @client.get_resume(:resume_id => "RH52G867678F7GH02Q3")
|
230
|
+
}.to raise_error(CareerBuilder::OutOfCredits)
|
231
|
+
end
|
232
|
+
|
233
|
+
end
|
234
|
+
|
235
|
+
context "with valid options" do
|
236
|
+
|
237
|
+
before do
|
238
|
+
stub_request(:post, "http://ws.careerbuilder.com/resumes/resumes.asmx/V2_GetResume").with(:body => 'Packet=%3cPacket%3e%3cSessionToken%3e42%3c%2fSessionToken%3e%3cResumeID%3eRH52G867678F7GH02Q3%3c%2fResumeID%3e%3c%2fPacket%3e').to_return(:body => "<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<string xmlns=\"http://ws.careerbuilder.com/resumes/\"><Packet><TimeStamp>6/25/2010 3:19:20 PM</TimeStamp><ResumeID>RH52G867678F7GH02Q3</ResumeID><ResumeTitle>Warehouse Distribution Specialist</ResumeTitle><ContactName>Jeffrey Davis</ContactName><ContactEmail>Jeffd1969@aol.com</ContactEmail><ContactPhone>513-625-7228</ContactPhone><HomeLocation><City>Goshen</City><State>OH</State><Country>US</Country><ZipCode>45122</ZipCode><WorkStatus>Can work for any employer</WorkStatus></HomeLocation><Relocations><ExtLocation><City>Tokyo</City><State/><Country>JP</Country><ZipCode /><WorkStatus>Can work for any employer</WorkStatus></ExtLocation></Relocations><MaxCommuteMiles>10</MaxCommuteMiles><TravelPreference>Up to 25%</TravelPreference><CurrentlyEmployed>Yes</CurrentlyEmployed><MostRecentPay><Amount>35776</Amount><Per>year</Per></MostRecentPay><DesiredPay><Amount>45000</Amount><Per>year</Per></DesiredPay><DesiredJobTypes><string>Full Time</string></DesiredJobTypes><MostRecentTitle>Warehouse Lead Supervisor</MostRecentTitle><ExperienceMonths>216</ExperienceMonths><Management><ManagedOthers>No</ManagedOthers><NumberManaged>0</NumberManaged></Management><JobsLastThreeYears>0</JobsLastThreeYears><LastJobTenureMonths>0</LastJobTenureMonths><SecurityClearance>No</SecurityClearance><FelonyConvictions>No</FelonyConvictions><HighestDegree>None</HighestDegree><Certifications /><MotivationToChangeJobs /><EmploymentType /><LastUpdated>5/23/2010 10:41:12 PM</LastUpdated><Languages><string>English</string></Languages><DesiredShiftPreferences><string /></DesiredShiftPreferences><Interests><ExtInterest><Interest>Warehouse</Interest><ExperienceMonths>216</ExperienceMonths></ExtInterest></Interests><ResumeText>JEFFREY A. DAVIS</ResumeText><MilitaryExperience>Veteran</MilitaryExperience><WorkHistory><ExtCompany><CompanyName>OWENS &amp; MINOR</CompanyName><JobTitle>Warehouse Lead Supervisor</JobTitle><Tenure>01/01/2008 - Present</Tenure></ExtCompany><ExtCompany><CompanyName>THE HOME DEPOT</CompanyName><JobTitle>- Sales Specialist</JobTitle><Tenure>01/01/2005 - Present</Tenure></ExtCompany><ExtCompany><CompanyName>RUBIES COSTUME CO</CompanyName><JobTitle>- Warehouse Assistant Manager</JobTitle><Tenure>01/01/2004 - 01/01/2006</Tenure></ExtCompany><ExtCompany><CompanyName>UNITED ELECTRIC POWER</CompanyName><JobTitle>Inventory Operations Manager</JobTitle><Tenure>01/01/2000 - 01/01/2004</Tenure></ExtCompany><ExtCompany><CompanyName>VEECO INSTRUMENTS, INC</CompanyName><JobTitle>Warehouse Supervisor</JobTitle><Tenure>01/01/1996 - 01/01/2000</Tenure></ExtCompany></WorkHistory><EducationHistory><ExtSchool><SchoolName>Eastern Oklahoma State College</SchoolName><Major>Business Management</Major><Degree /><GraduationDate>11993</GraduationDate></ExtSchool><ExtSchool><SchoolName>Suffolk County Community College</SchoolName><Major>Business Management</Major><Degree /><GraduationDate>11997</GraduationDate></ExtSchool></EducationHistory><Warning></Warning></Packet></string>")
|
239
|
+
@resume = @client.get_resume(:resume_id => "RH52G867678F7GH02Q3")
|
240
|
+
end
|
241
|
+
|
242
|
+
it 'should return the correct timestamp' do
|
243
|
+
@resume.timestamp.should == Time.mktime(2010, 6, 25, 15, 19, 20)
|
244
|
+
end
|
245
|
+
|
246
|
+
it 'should return the correct id' do
|
247
|
+
@resume.id.should == "RH52G867678F7GH02Q3"
|
248
|
+
end
|
249
|
+
|
250
|
+
it 'should return the correct title' do
|
251
|
+
@resume.title.should == "Warehouse Distribution Specialist"
|
252
|
+
end
|
253
|
+
|
254
|
+
it 'should return the correct contact name' do
|
255
|
+
@resume.contact_name.should == "Jeffrey Davis"
|
256
|
+
end
|
257
|
+
|
258
|
+
it 'should return the correct contact email' do
|
259
|
+
@resume.contact_email.should == "Jeffd1969@aol.com"
|
260
|
+
end
|
261
|
+
|
262
|
+
it 'should return the correct contact phone' do
|
263
|
+
@resume.contact_phone.should == "513-625-7228"
|
264
|
+
end
|
265
|
+
|
266
|
+
describe "#home_location" do
|
267
|
+
|
268
|
+
before do
|
269
|
+
@home_location = @resume.home_location
|
270
|
+
end
|
271
|
+
|
272
|
+
it 'should return the correct city' do
|
273
|
+
@home_location.city.should == "Goshen"
|
274
|
+
end
|
275
|
+
|
276
|
+
it 'should return the correct state' do
|
277
|
+
@home_location.state.should == "OH"
|
278
|
+
end
|
279
|
+
|
280
|
+
it 'should return the correct zip code' do
|
281
|
+
@home_location.zip_code.should == "45122"
|
282
|
+
end
|
283
|
+
|
284
|
+
it 'should return the correct country' do
|
285
|
+
@home_location.country.should == "US"
|
286
|
+
end
|
287
|
+
|
288
|
+
it 'should return the correct work status' do
|
289
|
+
@home_location.work_status.should == "Can work for any employer"
|
290
|
+
end
|
291
|
+
|
292
|
+
end
|
293
|
+
|
294
|
+
describe "#relocations" do
|
295
|
+
|
296
|
+
before do
|
297
|
+
@relocations = @resume.relocations
|
298
|
+
@relocation = @relocations.first
|
299
|
+
end
|
300
|
+
|
301
|
+
it 'should return the correct city' do
|
302
|
+
@relocation.city.should == "Tokyo"
|
303
|
+
end
|
304
|
+
|
305
|
+
it 'should return the correct state' do
|
306
|
+
@relocation.state.should == ""
|
307
|
+
end
|
308
|
+
|
309
|
+
it 'should return the correct zip code' do
|
310
|
+
@relocation.zip_code.should == ""
|
311
|
+
end
|
312
|
+
|
313
|
+
it 'should return the correct country' do
|
314
|
+
@relocation.country.should == "JP"
|
315
|
+
end
|
316
|
+
|
317
|
+
it 'should return the correct work status' do
|
318
|
+
@relocation.work_status.should == "Can work for any employer"
|
319
|
+
end
|
320
|
+
|
321
|
+
end
|
322
|
+
|
323
|
+
it 'should return the correct max commute miles' do
|
324
|
+
@resume.max_commute_miles.should == 10
|
325
|
+
end
|
326
|
+
|
327
|
+
it 'should return the correct travel preference' do
|
328
|
+
@resume.travel_preference.should == "Up to 25%"
|
329
|
+
end
|
330
|
+
|
331
|
+
it 'should return the correct currently employed' do
|
332
|
+
@resume.currently_employed.should == "Yes"
|
333
|
+
end
|
334
|
+
|
335
|
+
describe "#most_recent_pay" do
|
336
|
+
|
337
|
+
before do
|
338
|
+
@most_recent_pay = @resume.most_recent_pay
|
339
|
+
end
|
340
|
+
|
341
|
+
it 'should return the correct amount' do
|
342
|
+
@most_recent_pay.amount.should == 35776
|
343
|
+
end
|
344
|
+
|
345
|
+
it 'should return the correct per' do
|
346
|
+
@most_recent_pay.per.should == "year"
|
347
|
+
end
|
348
|
+
|
349
|
+
end
|
350
|
+
|
351
|
+
describe "#desired_pay" do
|
352
|
+
|
353
|
+
before do
|
354
|
+
@desired_pay = @resume.desired_pay
|
355
|
+
end
|
356
|
+
|
357
|
+
it 'should return the correct amount' do
|
358
|
+
@desired_pay.amount.should == 45000
|
359
|
+
end
|
360
|
+
|
361
|
+
it 'should return the correct per' do
|
362
|
+
@desired_pay.per.should == "year"
|
363
|
+
end
|
364
|
+
|
365
|
+
end
|
366
|
+
|
367
|
+
describe "#desired_job_types" do
|
368
|
+
|
369
|
+
before do
|
370
|
+
@desired_job_types = @resume.desired_job_types
|
371
|
+
@desired_job_type = @desired_job_types.first
|
372
|
+
end
|
373
|
+
|
374
|
+
it 'should return the correct text' do
|
375
|
+
@desired_job_type.text.should == "Full Time"
|
376
|
+
end
|
377
|
+
|
378
|
+
end
|
379
|
+
|
380
|
+
it 'should return the correct most recent title' do
|
381
|
+
@resume.most_recent_title.should == "Warehouse Lead Supervisor"
|
382
|
+
end
|
383
|
+
|
384
|
+
it 'should return the correct experience months' do
|
385
|
+
@resume.experience_months.should == 216
|
386
|
+
end
|
387
|
+
|
388
|
+
it 'should return the correct managed others' do
|
389
|
+
@resume.managed_others.should == "No"
|
390
|
+
end
|
391
|
+
|
392
|
+
it 'should return the correct number managed' do
|
393
|
+
@resume.number_managed.should == 0
|
394
|
+
end
|
395
|
+
|
396
|
+
it 'should return the correct jobs last three years' do
|
397
|
+
@resume.jobs_last_three_years.should == 0
|
398
|
+
end
|
399
|
+
|
400
|
+
it 'should return the correct last job tenure months' do
|
401
|
+
@resume.last_job_tenure_months.should == 0
|
402
|
+
end
|
403
|
+
|
404
|
+
it 'should return the correct security clearance' do
|
405
|
+
@resume.security_clearance.should == "No"
|
406
|
+
end
|
407
|
+
|
408
|
+
it 'should return the correct felony convictions' do
|
409
|
+
@resume.felony_convictions.should == "No"
|
410
|
+
end
|
411
|
+
|
412
|
+
it 'should return the correct highest degree' do
|
413
|
+
@resume.highest_degree.should == "None"
|
414
|
+
end
|
415
|
+
|
416
|
+
it 'should return the correct certifications' do
|
417
|
+
@resume.certifications.should == ""
|
418
|
+
end
|
419
|
+
|
420
|
+
it 'should return the correct motivation to change jobs' do
|
421
|
+
@resume.motivation_to_change_jobs.should == ""
|
422
|
+
end
|
423
|
+
|
424
|
+
it 'should return the correct employment type' do
|
425
|
+
@resume.employment_type.should == ""
|
426
|
+
end
|
427
|
+
|
428
|
+
it 'should return the correct last updated' do
|
429
|
+
@resume.last_updated.should == Time.mktime(2010, 5, 23, 22, 41, 12)
|
430
|
+
end
|
431
|
+
|
432
|
+
describe "#languages" do
|
433
|
+
|
434
|
+
before do
|
435
|
+
@languages = @resume.languages
|
436
|
+
@language = @languages.first
|
437
|
+
end
|
438
|
+
|
439
|
+
it 'should return the correct text' do
|
440
|
+
@language.text.should == "English"
|
441
|
+
end
|
442
|
+
|
443
|
+
end
|
444
|
+
|
445
|
+
describe "#desired_shift_preferences" do
|
446
|
+
|
447
|
+
before do
|
448
|
+
@desired_shift_preferences = @resume.desired_shift_preferences
|
449
|
+
@desired_shift_preference = @desired_shift_preferences.first
|
450
|
+
end
|
451
|
+
|
452
|
+
it 'should return the correct desired shift preferences' do
|
453
|
+
@desired_shift_preference.text.should == ""
|
454
|
+
end
|
455
|
+
|
456
|
+
end
|
457
|
+
|
458
|
+
describe "#interests" do
|
459
|
+
|
460
|
+
before do
|
461
|
+
@interests = @resume.interests
|
462
|
+
@interest = @interests.first
|
463
|
+
end
|
464
|
+
|
465
|
+
it 'should return the correct interest' do
|
466
|
+
@interest.interest.should == "Warehouse"
|
467
|
+
end
|
468
|
+
|
469
|
+
it 'should return the correct experience in months' do
|
470
|
+
@interest.experience_months.should == 216
|
471
|
+
end
|
472
|
+
|
473
|
+
end
|
474
|
+
|
475
|
+
it 'should return the correct resume text' do
|
476
|
+
@resume.text.should == "JEFFREY A. DAVIS"
|
477
|
+
end
|
478
|
+
|
479
|
+
it 'should return the military experience' do
|
480
|
+
@resume.military_experience.should == "Veteran"
|
481
|
+
end
|
482
|
+
|
483
|
+
describe "#companies" do
|
484
|
+
|
485
|
+
before do
|
486
|
+
@companies = @resume.companies
|
487
|
+
@company = @companies.first
|
488
|
+
end
|
489
|
+
|
490
|
+
it 'should return the correct company name' do
|
491
|
+
@company.name.should == "OWENS & MINOR"
|
492
|
+
end
|
493
|
+
|
494
|
+
it 'should return the correct job title' do
|
495
|
+
@company.job_title.should == "Warehouse Lead Supervisor"
|
496
|
+
end
|
497
|
+
|
498
|
+
it 'should return the correct tenure' do
|
499
|
+
@company.tenure.should == "01/01/2008 - Present"
|
500
|
+
end
|
501
|
+
|
502
|
+
end
|
503
|
+
|
504
|
+
describe "#schools" do
|
505
|
+
|
506
|
+
before do
|
507
|
+
@schools = @resume.schools
|
508
|
+
@school = @schools.first
|
509
|
+
end
|
510
|
+
|
511
|
+
it 'should return the correct school name' do
|
512
|
+
@school.name.should == "Eastern Oklahoma State College"
|
513
|
+
end
|
514
|
+
|
515
|
+
it 'should return the correct major' do
|
516
|
+
@school.major.should == "Business Management"
|
517
|
+
end
|
518
|
+
|
519
|
+
it 'should return the correct degree' do
|
520
|
+
@school.degree.should == ""
|
521
|
+
end
|
522
|
+
|
523
|
+
it 'should return the correct graduation date' do
|
524
|
+
@school.graduation_date.should == "11993"
|
525
|
+
end
|
526
|
+
|
527
|
+
end
|
528
|
+
|
529
|
+
it 'should return the correct warning' do
|
530
|
+
@resume.warning.should == ""
|
531
|
+
end
|
532
|
+
|
533
|
+
end
|
534
|
+
|
535
|
+
end
|
536
|
+
|
537
|
+
end
|
538
|
+
|
539
|
+
describe "#resume_actions_remaining_today" do
|
540
|
+
|
541
|
+
before do
|
542
|
+
stub_request(:post, "http://ws.careerbuilder.com/resumes/resumes.asmx/V2_ResumeActionsRemainingToday").with(:body => 'Packet=%3cPacket%3e%3cSessionToken%3e42%3c%2fSessionToken%3e%3cAccountDID%3eD7D15Q67VKG105ZB12%3c%2fAccountDID%3e%3c%2fPacket%3e').to_return(:body => "<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<string xmlns=\"http://ws.careerbuilder.com/resumes/\"><Packet>1</Packet></string>")
|
543
|
+
@client = CareerBuilder::Client.new("valid_email", "valid_password")
|
544
|
+
@client.stub(:session_token).and_return(42)
|
545
|
+
@client.stub(:authenticate).and_return(true)
|
546
|
+
end
|
547
|
+
|
548
|
+
it 'should return the number of credits remaining' do
|
549
|
+
@client.resume_actions_remaining_today(:account_did => "D7D15Q67VKG105ZB12").should == 1
|
550
|
+
end
|
551
|
+
|
552
|
+
end
|
553
|
+
|
554
|
+
end
|