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
File.open(source_file_name, "r") { |f| page = Nokogiri::HTML(f.read()) } |
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
class Wod < ActiveRecord::Base | |
HOST_BOX_NAME = "CrossFit HQ" | |
def from_html crossfit_hq_source | |
page = Nokogiri::HTML(crossfit_hq_source) | |
self.date = Date.parse(page.search("//h3")[0].inner_text.split[1]).to_s | |
self.details = page.search("//p")[0].inner_text | |
if(hero_wod || games_wod) | |
self.details << "\n" << page.search("//p")[1].inner_html.gsub(/<br>/,"\n") | |
end |
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 'concept_im_evolving' | |
require 'rspec/given' | |
#Sample1: Run rspec >> No examples found. | |
describe ConceptImEvolving do | |
Given (:getter) { ConceptImEvolving.new } | |
context "when there is a new item" do | |
When { getter.get_latest_item("some_uri") } | |
end |
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
Then /^I should see$/ do |table| | |
table.hashes.each do |stuff| | |
stuff.keys.each { |key| page.should have_content stuff[key] } | |
end | |
end |
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
1 Feature: Manage rentals | |
2 In order to optimize my investments | |
3 As a rental baron | |
4 I want to be able to manage my rentals | |
5 | |
6 Scenario Outline: Rental count | |
7 Given I have <number> rentals | |
8 When I go to the rentals page | |
9 Then I should see "<number> rentals found" | |
10 |