Created
May 29, 2009 23:31
-
-
Save fizx/120278 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| require File.dirname(__FILE__) + '/../spec_helper' | |
| describe DetailsPage do | |
| before do | |
| @desc = companies(:fleishman).crawl_description | |
| @session = @desc.crawl_sessions.create! | |
| @simple_html = <<-HTML | |
| <html> | |
| <body> | |
| <h1 class="iCIMS_Header_JobTitle">CEO</h1> | |
| <div class="iCIMS_JobHeaderTable"> | |
| <tr> | |
| <p /> | |
| <p /> | |
| <p /> | |
| <p>San Francisco</p> | |
| </tr> | |
| </div> | |
| </body> | |
| </html> | |
| HTML | |
| @page = @session.details_pages.create!(:content => @simple_html, :url => "http://www.example.com") | |
| end | |
| # fleishman_descr_settings = { | |
| # :entry_url => "http://localhost:4000/fixtures/jobs-fleishman.icims.com/jobs/search?ss=1&searchLocation=&searchCategory=", | |
| # :pagination_selector => ".iCIMS_JobsTablePaging img", | |
| # :detail_selector => ".iCIMS_Anchor", | |
| # :title_selector => ".iCIMS_Header_JobTitle", | |
| # :description_selector => ".iCIMS_InfoM", | |
| # :experience_selector => ".iCIMS_InfoM", | |
| # :education_selector => ".iCIMS_InfoM", | |
| # :posted_at_selector => "tr:nth-child(3) :nth-child(2)", | |
| # :location_selector => ".iCIMS_JobHeaderTable tr:nth-child(1) :nth-child(4)" | |
| # } | |
| describe "#make_jobs!" do | |
| before do | |
| @page.make_jobs! | |
| @page.jobs.should have(1).jobs | |
| end | |
| it "should create a job with a title from a page" do | |
| @page.jobs.first.title.should == 'CEO' | |
| @page.jobs.first.location.should == 'San Francisco' | |
| end | |
| end | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment