Skip to content

Instantly share code, notes, and snippets.

View Lackoftactics's full-sized avatar

Przemyslaw Mroczek Lackoftactics

  • Warsaw, Poland
  • 03:24 (UTC +02:00)
View GitHub Profile
#encoding: utf-8
def fetch_job_links
job_links = []
if next_page_selector
index_doc = Nokogiri::HTML(open(url))
base_url = parse_base_url(url, index_doc)
pagination = index_doc.at_xpath(next_page_selector)
next_page_link = URI.join(base_url, pagination['href']).to_s rescue nil
##przed tą pętlą ustawia mi się next_page_link na nila, wiesz może dlaczego?
{"first_name":"Tomek","last_name":"K","avatar_url":null,"short_address":"Brandenburg, Germany","user_url":"/users/user5-el","pending_friendships":[{"agripoints":0,"avatar_content_type":null,"avatar_file_name":null,"avatar_file_size":null,"avatar_updated_at":null,"confirmation_reminder":false,"created_at":"2013-06-11T14:17:51Z","deals_newsletter":false,"email":"[email protected]","first_name":"User5","id":20,"language":"English","last_name":"El","newsletter":false,"slug":"user5-el","terms_of_service":true,"title":"Mr","updated_at":"2013-06-11T14:17:51Z","user_type":"Farmer","website":"http:\\codequest.com"}]}
context "Validates presence of either start time or open time" do
setup do
@user = FactoryGirl.create(:user)
@account = FactoryGirl.create(:account, user: @user)
@location = FactoryGirl.create(:location, account: @account)
end
should "not be valid without open time or start time " do
event = FactoryGirl.build(:event, fb_id: '12345', account: @account, location: @location, start_at: nil, open_at: nil, end_at: Time.now + 1.hour)
assert !event.valid?
context "Validates presence of either start time or open time" do
setup do
@user = FactoryGirl.create(:user)
@account = FactoryGirl.create(:account, user: @user)
@location = FactoryGirl.create(:location, account: @account)
end
should "not be valid without open time or start time " do
event = FactoryGirl.build(:event, fb_id: '12345', account: @account, location: @location, start_at: nil, open_at: nil, end_at: Time.now + 1.hour)
assert !event.valid?