-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feature/transition to usajobs api (#159)
* update search-gov to point to usajobs * remove highlighting for jobs * exception error refactor * highlighting_disabled not being used * update connection to usajobs * post-process jobs results * update helper specs * squashme: use single quotes * refacter location name * cleanup * fix indents, update key, remove debug * place adapter back in * remove headers[:accept] not being used anywhere * fix test cases * remove debug statement * typo and debug statement * use geoip_info * changes made to get rspec working * changes made to job_openings to use the fixture json hash * cleanup code * changes made to rspec to add correct mapping for test * add keyword instead of query * update test to use job instead of foo * reset cossettes * update vcr cassettes * fix specs * remove put * remove logger debug * pass Keyword instead of query in jobs spec * hide secrets from vcr cassettes * require results keyword arg in post processor * pass correct rate interval codes to jobs helper * remove TODO * add location_name method to GeoIP::City objects * add location_name method to GeoIP::City * misc vcr cassettes * fix intermittent test failure * add basic jobs search spec * remove "is usajob?" view & helper conditionals * update readme to have new phantomjs instructions * - fix nil rate interval code - add cucumber test for salary format * fix missing application deadline * remove neogov specs - remove unused neogov case in jobs helper * remove extra line break * get host from config file
- Loading branch information
Showing
29 changed files
with
6,616 additions
and
247 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
class JobResultsPostProcessor | ||
attr_reader :results | ||
|
||
def initialize(results:) | ||
@results = results.map(&:matched_object_descriptor) | ||
end | ||
|
||
def post_processed_results | ||
results.each do |result| | ||
result.id = result.position_id | ||
result.url = result.position_uri | ||
result.locations = result.position_location.map(&:location_name) | ||
result.minimum = result.position_remuneration.first.minimum_range.to_f | ||
result.maximum = result.position_remuneration.first.maximum_range.to_f | ||
result.rate_interval_code = result.position_remuneration.first.rate_interval_code | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
require 'geoip_extensions' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,13 @@ | ||
Then /^I should see (\d+) job postings?$/ do |num_results| | ||
html = Nokogiri::HTML(page.body) | ||
job_postings = html.search('.content-block-item.job.result') | ||
job_postings.size == num_results.to_i | ||
page.should have_selector('.content-block-item.job.result') | ||
end | ||
|
||
Then /I should see an annual salary/ do | ||
annual_salary_regex = /\$\d{2,3},\d{3}\.\d{2}\+\/yr/ | ||
page.should have_selector('.job-locations-money', text: annual_salary_regex) | ||
end | ||
|
||
Then /I should see an application deadline/ do | ||
deadline_regex = /Apply by [[:alpha:]]+ \d{1,2}, \d{4}/ | ||
page.should have_selector('.job-dates', text: deadline_regex) | ||
end |
Oops, something went wrong.