작업 분배 종결점에서 조회 파라미터를 사용할 수 있습니다
6583 단어 harvested
묘사
이것은 @bloudermilk가 최초로 완성한 작업입니다. 저는 그것을 최신 버전master
의 기초 위에서 고려합니다.사상토론 #1
Good guy@patbenatar는 내가 2년 전의 약속을 PR로 제출한 것이지 새로운 것을 간단하게 변경하는 것이 아니다. clap:토론 #2
@zmoazeni는 이에 대해 어떤 생각을 가지고 있습니까?토론 #셋
+1토론 #4
@patbenatar이 기능을 어떻게 사용하는지 설명하는 규범을 추가할 수 있습니까?그리고 나는 그것을 다른 두 개의 PR과 합쳐서 발표할 수 있다.토론 #5
@jvdp가 로컬에서 테스트 세트 (master
를 실행하는 데 실패했습니다.Failures:
1) harvest expenses allows adding, updating, and removing expenses
Failure/Error: category = harvest.expense_categories.create(
NoMethodError:
undefined method `match' for nil:NilClass
Did you mean? catch
# ./lib/harvest/behavior/crud.rb:33:in `create'
# ./spec/functional/expenses_spec.rb:27:in `block (3 levels) in <top (required)>'
# ./spec/functional/expenses_spec.rb:26:in `block (2 levels) in <top (required)>'
2) harvest expenses categories allows adding, updating and removing categories
Failure/Error: category = harvest.expense_categories.create(
NoMethodError:
undefined method `match' for nil:NilClass
Did you mean? catch
# ./lib/harvest/behavior/crud.rb:33:in `create'
# ./spec/functional/expenses_spec.rb:7:in `block (4 levels) in <top (required)>'
# ./spec/functional/expenses_spec.rb:6:in `block (3 levels) in <top (required)>'
3) harvest invoices allows adding, updating and removing categories
Failure/Error: cat = harvest.invoice_categories.create("name" => "New Category")
Harvest::BadRequest:
Harvest::BadRequest : 400 {"message":"Cannot complete your request. Parameter is missing or the value is empty: invoice_item_category"}
# ./lib/harvest/api/base.rb:47:in `request'
# ./lib/harvest/api/invoice_categories.rb:13:in `create'
# ./spec/functional/invoice_spec.rb:6:in `block (3 levels) in <top (required)>'
# ./spec/functional/invoice_spec.rb:5:in `block (2 levels) in <top (required)>'
4) harvest reporting allows project and people entry reporting
Failure/Error: harvest.reports.time_by_project(project1, Time.utc(2009, 12, 10), Time.utc(2009,12,30), {updated_since: Time.now.utc}).should == []
VCR::Errors::UnhandledHTTPRequestError:
================================================================================
An HTTP request has been made that VCR does not know how to handle:
GET https://nicktestco.harvestapp.com/projects/11630342/entries?from=20091210&to=20091230&updated_since=2016-09-01%2016:41:35%20UTC
VCR is currently using the following cassette:
- /Users/giantcola/Projects/harvested/.cassettes/reports1.yml
- :record => :once
- :match_requests_on => [:method, :uri]
Under the current configuration VCR can not find a suitable HTTP interaction
to replay and is prevented from recording new requests. There are a few ways
you can deal with this:
* If you're surprised VCR is raising this error
and want insight about how VCR attempted to handle the request,
you can use the debug_logger configuration option to log more details [1].
* You can use the :new_episodes record mode to allow VCR to
record this new request to the existing cassette [2].
* If you want VCR to ignore this request (and others like it), you can
set an `ignore_request` callback [3].
* The current record mode (:once) does not allow new requests to be recorded
to a previously recorded cassette. You can delete the cassette file and re-run
your tests to allow the cassette to be recorded with this request [4].
* The cassette contains 12 HTTP interactions that have not been
played back. If your request is non-deterministic, you may need to
change your :match_requests_on cassette option to be more lenient
or use a custom request matcher to allow it to match [5].
[1] https://www.relishapp.com/vcr/vcr/v/3-0-3/docs/configuration/debug-logging
[2] https://www.relishapp.com/vcr/vcr/v/3-0-3/docs/record-modes/new-episodes
[3] https://www.relishapp.com/vcr/vcr/v/3-0-3/docs/configuration/ignore-request
[4] https://www.relishapp.com/vcr/vcr/v/3-0-3/docs/record-modes/once
[5] https://www.relishapp.com/vcr/vcr/v/3-0-3/docs/request-matching
================================================================================
# ./lib/harvest/api/base.rb:40:in `request'
# ./lib/harvest/api/reports.rb:14:in `time_by_project'
# ./spec/functional/reporting_spec.rb:36:in `block (3 levels) in <top (required)>'
# ./spec/functional/reporting_spec.rb:5:in `block (2 levels) in <top (required)>'
5) harvest reporting allows expense reporting
Failure/Error: category = harvest.expense_categories.create(name: "Reporting category", "unit_price" => 100, "unit_name" => "deduction")
NoMethodError:
undefined method `match' for nil:NilClass
Did you mean? catch
# ./lib/harvest/behavior/crud.rb:33:in `create'
# ./spec/functional/reporting_spec.rb:68:in `block (3 levels) in <top (required)>'
# ./spec/functional/reporting_spec.rb:60:in `block (2 levels) in <top (required)>'
6) harvest time tracking allows retrieving trackable projects and tasks
Failure/Error: trackable_projects.first.client.should == "Bobbys Coffee Shop"
expected: "Bobbys Coffee Shop"
got: "Bobby's Coffee Shop" (using ==)
# ./spec/functional/time_tracking_spec.rb:79:in `block (3 levels) in <top (required)>'
# ./spec/functional/time_tracking_spec.rb:72:in `block (2 levels) in <top (required)>'
Finished in 35.97 seconds
63 examples, 6 failures
내가 디버깅을 깊이 들어가기 전에, 증거를 설정하는 것 외에, 나는 통과된 테스트 세트를 얻기 위해 무엇을 해야 합니까?이 테스트들은 통과해야 합니까?토론 #6
@patbenatar 응, 확실하지 않아. 나는 이미 한동안 이 규범들을 실행하지 않았어.이것은 일부 새로운 종속성 또는 Harvest API 때문에 실패할 수 있습니다.VCR 정보에 대해서는 적어도 한번 해 보세요
rake spec VCR_REFRESH=true
.(테스트 세트는 약간의 현대화가 필요하다고 생각한다.)
토론 #7
4.0 버전을 통합합니다.Reference
이 문제에 관하여(작업 분배 종결점에서 조회 파라미터를 사용할 수 있습니다), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다 https://github.com/zmoazeni/harvested/issues/89텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
우수한 개발자 콘텐츠 발견에 전념 (Collection and Share based on the CC Protocol.)