Skip to content

Instantly share code, notes, and snippets.

View hvillero's full-sized avatar

Hugo Villero hvillero

  • Toronto, Ontario, canada
View GitHub Profile
@hvillero
hvillero / gist:100e120715776643660a
Created June 10, 2015 16:16
Falling test for development
1) Elasticsearchable search cache DimProperty SecondaryPropTypeMaj matches
Failure/Error: expect(es_result).to eq ar_result
expected: ["Healthcare", "Hospitality", "Industrial", "Mixed Use", "Mobile Home Park", "Multifamily", "Office", "Other", "Retail", "Self-Storage"]
got: []
(compared using ==)
# ./spec/integrations/elasticsearchable_cache_spec.rb:70:in `(root)'
# ./spec/rails_helper.rb:67:in `(root)'
@hvillero
hvillero / gist:66949bf63941c0a0d9b8
Created May 27, 2015 01:24
elasticsearch errors
Failures:
1) Elasticsearchable index structure mappings should match defined properties
Failure/Error: _mappings = model.__elasticsearch__.client.perform_request('GET', "#{_index_name}/_mapping").body[_index_name]['mappings'][_type.to_s]['properties']
WebMock::NetConnectNotAllowedError:
Real HTTP connections are disabled. Unregistered request: GET http://ec2-54-88-156-195.compute-1.amazonaws.com:9200/dim_properties/_mapping with headers {'Accept'=>'*/*', 'Accept-Encoding'=>'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'User-Agent'=>'Faraday v0.9.1'}
You can stub this request with the following snippet:
stub_request(:get, "http://ec2-54-88-156-195.compute-1.amazonaws.com:9200/dim_properties/_mapping").
Failures:
1) DataTables date sorting Securitization with Various date value sorts correctly
Failure/Error: expect(date_values.size).to be > 0
expected: > 0
got: 0
# ./spec/features/data_tables_date_sorting_spec.rb:51:in `(root)'
# ./spec/rails_helper.rb:67:in `(root)'
2) Elasticsearchable ActiveRecord/Elasticsearch data validation Elasticsearch index sizes match SQL counts
@hvillero
hvillero / gist:c64dd02a8b6f59f97d15
Created April 28, 2015 13:10
Finished in 8 minutes 51 seconds (files took 42.82 seconds to load) 937 examples, 71 failures, 1 pending
Failures:
1) LoansController (while signed in) show action Loan Level Assumptions validates load loan property units (count) and cash_flow_analysis income line items
Failure/Error: expect((value['value'].to_f / @loan_property_units).round(2)).to eq(value['per_unit'].to_f.round(2))
expected: 0.0
got: 44001387.67
(compared using ==)
# ./spec/controllers/loans_controller_spec.rb:197:in `(root)'
#!/usr/bin/env ruby
hits = []
checks = {
#'_spec\.rb$' => ['focus:[:space:]*true'],
'\.rb$' => ['binding\.pry', 'debugger'],
'\.erb$' => ['binding\.pry', 'debugger'],
'\.coffee' => ['console\.log'],
'\.js' => ['console\.log']
}