Consistently use net_http_persistent
with a memorized Faraday object
#5401
Annotations
6 errors and 4 warnings
Run tests:
spec/lib/nbp/push_connector_spec.rb#L129
Nbp::PushConnector push_lom! when the token cannot be renewed raises an error
Failure/Error: expect { push_lom! }.to raise_error(Nbp::PushConnector::Error)
expected Nbp::PushConnector::Error but nothing was raised
|
Run tests:
spec/lib/nbp/push_connector_spec.rb#L133
Nbp::PushConnector push_lom! when the token cannot be renewed does not push the metadata
Failure/Error: expect(WebMock).not_to have_requested(:put, "#{api_host}/push-connector/api/lom-v2/#{source_slug}")
The request PUT https://test.api.host/push-connector/api/lom-v2/CoHaP2 was not expected to execute but it executed 1 time
The following requests were made:
PUT https://test.api.host/push-connector/api/lom-v2/CoHaP2 with body '{"metadata":"\u003c?xml version=\"1.0\" encoding=\"UTF-8\"?\u003e\n\u003clom xmlns=\"http://ltsc.ieee.org/xsd/LOM\"\u003e\n \u003cgeneral\u003e\n \u003cidentifier\u003e\n \u003ccatalog\u003eUUID\u003c/catalog\u003e\n \u003centry\u003ec3a2173e-ffc0-4965-acfb-02be853d645e\u003c/entry\u003e\n \u003c/identifier\u003e\n \u003ctitle\u003e\n \u003cstring language=\"de\"\u003eTest Exercise 944\u003c/string\u003e\n \u003c/title\u003e\n \u003clanguage\u003ede\u003c/language\u003e\n \u003cdescription\u003e\n \u003cstring language=\"de\"\u003e\u0026lt;p\u0026gt;description\u0026lt;/p\u0026gt;\u003c/string\u003e\n \u003c/description\u003e\n \u003cstructure\u003e\n \u003cvalue\u003eatomic\u003c/value\u003e\n \u003c/structure\u003e\n \u003caggregationLevel\u003e\n \u003cvalue\u003e1\u003c/value\u003e\n \u003c/aggregationLevel\u003e\n \u003c/general\u003e\n \u003clifeCycle\u003e\n \u003cversion\u003e\n \u003cstring language=\"en\"\u003e1\u003c/string\u003e\n \u003c/version\u003e\n \u003cstatus\u003e\n \u003cvalue\u003efinal\u003c/value\u003e\n \u003c/status\u003e\n \u003ccontribute\u003e\n \u003crole\u003e\n \u003cvalue\u003eauthor\u003c/value\u003e\n \u003c/role\u003e\n \u003centity\u003eBEGIN:VCARD\nVERSION:3.0\nFN;CHARSET=UTF-8:John_1604 Doe\nN;CHARSET=UTF-8:Doe;John_1604;;;\nEND:VCARD\n\u003c/entity\u003e\n \u003cdate\u003e\n \u003cdateTime\u003e2025-02-12\u003c/dateTime\u003e\n \u003c/date\u003e\n \u003c/contribute\u003e\n \u003c/lifeCycle\u003e\n \u003cmetaMetadata\u003e\n \u003cidentifier\u003e\n \u003ccatalog\u003eURI\u003c/catalog\u003e\n \u003centry\u003ehttp://localhost/bridges/lom/tasks/627\u003c/entry\u003e\n \u003c/identifier\u003e\n \u003cmetadataSchema\u003eProFormA MD 1.0\u003c/metadataSchema\u003e\n \u003clanguage\u003een\u003c/language\u003e\n \u003c/metaMetadata\u003e\n \u003ctechnical\u003e\n \u003cformat\u003etext/xml\u003c/format\u003e\n \u003clocation\u003ehttp://localhost/tasks/627\u003c/location\u003e\n \u003clocation\u003ehttp://localhost/tasks/627/download\u003c/location\u003e\n \u003c/technical\u003e\n \u003ceducational\u003e\n \u003cinteractivityType\u003e\n \u003cvalue\u003eactive\u003c/value\u003e\n \u003c/interactivityType\u003e\n \u003clearningResourceType\u003e\n \u003cvalue\u003eexercise\u003c/value\u003e\n \u003c/learningResourceType\u003e\n \u003cinteractivityLevel\u003e\n \u003cvalue\u003ehigh\u003c/value\u003e\n \u003c/interactivityLevel\u003e\n \u003csemanticDensity\u003e\n \u003cvalue\u003ehigh\u003c/value\u003e\n \u003c/semanticDensity\u003e\n \u003cintendedEndUserRole\u003e\n \u003cvalue\u003elearner\u003c/value\u003e\n \u003c/intendedEndUserRole\u003e\n \u003ccontext\u003e\n \u003cvalue\u003eschool\u003c/value\u003e\n \u003c/context\u003e\n \u003ccontext\u003e\n \u003cvalue\u003ehigher education\u003c/value\u003e\n \u003c/context\u003e\n \u003ccontext\u003e\n \u003cvalue\u003etraining\u003c/value\u003e\n \u003c/context\u003e\n \u003ctypicalAgeRange\u003e\n \u003cstring\u003e13-\u003c/string\u003e\n \u003c/typicalAgeRange\u003e\n \u003cdescription\u003e\n \u003cstring language=\"de\"/\u003e\n \u003c/description\u003e\n \u003clanguage\u003ede\u003c/language\u003e\n \u003c/educational\u003e\n \u003crights\u003e\n \u003ccost\u003e\n \u003cvalue\u003eno\u003c/value\u003e\n \u003c/cost\u003e\n \u003ccopyrightAndOtherRestrictions\u003e\n \u003cvalue\u003eyes\u003c/value
|
Run tests:
spec/lib/nbp/push_connector_spec.rb#L114
Nbp::PushConnector push_lom! when the token expired renews the token
Failure/Error: expect(WebMock).to have_requested(:post, Settings.nbp.push_connector.token_path)
The request POST https://test.provider/token was expected to execute 1 time but it executed 0 times
The following requests were made:
PUT https://test.api.host/push-connector/api/lom-v2/CoHaP2 with body '{"metadata":"\u003c?xml version=\"1.0\" encoding=\"UTF-8\"?\u003e\n\u003clom xmlns=\"http://ltsc.ieee.org/xsd/LOM\"\u003e\n \u003cgeneral\u003e\n \u003cidentifier\u003e\n \u003ccatalog\u003eUUID\u003c/catalog\u003e\n \u003centry\u003e2344cfb6-80f5-40d7-a18d-cb5a2fdda79b\u003c/entry\u003e\n \u003c/identifier\u003e\n \u003ctitle\u003e\n \u003cstring language=\"de\"\u003eTest Exercise 947\u003c/string\u003e\n \u003c/title\u003e\n \u003clanguage\u003ede\u003c/language\u003e\n \u003cdescription\u003e\n \u003cstring language=\"de\"\u003e\u0026lt;p\u0026gt;description\u0026lt;/p\u0026gt;\u003c/string\u003e\n \u003c/description\u003e\n \u003cstructure\u003e\n \u003cvalue\u003eatomic\u003c/value\u003e\n \u003c/structure\u003e\n \u003caggregationLevel\u003e\n \u003cvalue\u003e1\u003c/value\u003e\n \u003c/aggregationLevel\u003e\n \u003c/general\u003e\n \u003clifeCycle\u003e\n \u003cversion\u003e\n \u003cstring language=\"en\"\u003e1\u003c/string\u003e\n \u003c/version\u003e\n \u003cstatus\u003e\n \u003cvalue\u003efinal\u003c/value\u003e\n \u003c/status\u003e\n \u003ccontribute\u003e\n \u003crole\u003e\n \u003cvalue\u003eauthor\u003c/value\u003e\n \u003c/role\u003e\n \u003centity\u003eBEGIN:VCARD\nVERSION:3.0\nFN;CHARSET=UTF-8:John_1607 Doe\nN;CHARSET=UTF-8:Doe;John_1607;;;\nEND:VCARD\n\u003c/entity\u003e\n \u003cdate\u003e\n \u003cdateTime\u003e2025-02-12\u003c/dateTime\u003e\n \u003c/date\u003e\n \u003c/contribute\u003e\n \u003c/lifeCycle\u003e\n \u003cmetaMetadata\u003e\n \u003cidentifier\u003e\n \u003ccatalog\u003eURI\u003c/catalog\u003e\n \u003centry\u003ehttp://localhost/bridges/lom/tasks/630\u003c/entry\u003e\n \u003c/identifier\u003e\n \u003cmetadataSchema\u003eProFormA MD 1.0\u003c/metadataSchema\u003e\n \u003clanguage\u003een\u003c/language\u003e\n \u003c/metaMetadata\u003e\n \u003ctechnical\u003e\n \u003cformat\u003etext/xml\u003c/format\u003e\n \u003clocation\u003ehttp://localhost/tasks/630\u003c/location\u003e\n \u003clocation\u003ehttp://localhost/tasks/630/download\u003c/location\u003e\n \u003c/technical\u003e\n \u003ceducational\u003e\n \u003cinteractivityType\u003e\n \u003cvalue\u003eactive\u003c/value\u003e\n \u003c/interactivityType\u003e\n \u003clearningResourceType\u003e\n \u003cvalue\u003eexercise\u003c/value\u003e\n \u003c/learningResourceType\u003e\n \u003cinteractivityLevel\u003e\n \u003cvalue\u003ehigh\u003c/value\u003e\n \u003c/interactivityLevel\u003e\n \u003csemanticDensity\u003e\n \u003cvalue\u003ehigh\u003c/value\u003e\n \u003c/semanticDensity\u003e\n \u003cintendedEndUserRole\u003e\n \u003cvalue\u003elearner\u003c/value\u003e\n \u003c/intendedEndUserRole\u003e\n \u003ccontext\u003e\n \u003cvalue\u003eschool\u003c/value\u003e\n \u003c/context\u003e\n \u003ccontext\u003e\n \u003cvalue\u003ehigher education\u003c/value\u003e\n \u003c/context\u003e\n \u003ccontext\u003e\n \u003cvalue\u003etraining\u003c/value\u003e\n \u003c/context\u003e\n \u003ctypicalAgeRange\u003e\n \u003cstring\u003e13-\u003c/string\u003e\n \u003c/typicalAgeRange\u003e\n \u003cdescription\u003e\n \u003cstring language=\"de\"/\u003e\n \u003c/description\u003e\n \u003clanguage\u003ede\u003c/language\u003e\n \u003c/educational\u003e\n \u003crights\u003e\n \u003ccost\u003e\n \u003cvalue\u003eno\u003c/value\u003e\n \u003c/cost\u003e\n \u003ccopyrightAndOtherRestrictions\u003e\n \u003cvalue\u003eyes\u003c/value\u003e\n \u003c/copyrightAndOtherRestrictions\u003e\n \
|
Run tests:
spec/services/task_service/push_external_spec.rb#L61
TaskService::PushExternal#execute when an error occurs is expected not to be nil
Failure/Error: it { is_expected.not_to be_nil }
expected: not nil
got: nil
|
Run tests:
spec/services/task_service/check_external_spec.rb#L82
TaskService::CheckExternal#execute when the request fails returns the correct hash
Failure/Error: expect(check_external_service).to eql(error: true, message: I18n.t('common.errors.generic'))
expected: {:error => true, :message => "An error occurred."}
got: {:error => false, :message => "No corresponding task found on external app. Pushing this task will cr... this one on CodeHarbor. Any changes to either one can be pushed to the respective other platform."}
(compared using eql?)
Diff:
@@ -1,3 +1,3 @@
-:error => true,
-:message => "An error occurred.",
+:error => false,
+:message => "No corresponding task found on external app. Pushing this task will create a new task on external app, which will be linked to this one on CodeHarbor. Any changes to either one can be pushed to the respective other platform.",
|
Run tests
Process completed with exit code 1.
|
Run tests:
spec/services/proforma_service/import_task_spec.rb#L56
ProformaService::ImportTask#execute when task with same uuid exists in db creates a predecessor for task
Failure/Error: expect { import_proforma_task }.to change { task.reload.predecessor }.from(nil).to(be_an(Task))
NoMethodError:
undefined method 'predecessor' for an instance of Task
|
Run tests:
spec/services/proforma_service/import_task_spec.rb#L74
ProformaService::ImportTask#execute when task with same uuid exists in db when user does not own task when user is an author of task creates a new task
Failure/Error: before { task.authors << user }
NoMethodError:
undefined method 'authors' for an instance of Task
|
Run tests:
spec/services/proforma_service/import_task_spec.rb#L82
ProformaService::ImportTask#execute when task with same uuid exists in db when user does not own task when user is an author of task creates a predecessor for task
Failure/Error: before { task.authors << user }
NoMethodError:
undefined method 'authors' for an instance of Task
|
Run tests:
spec/services/proforma_service/import_task_spec.rb#L78
ProformaService::ImportTask#execute when task with same uuid exists in db when user does not own task when user is an author of task changes existing task
Failure/Error: before { task.authors << user }
NoMethodError:
undefined method 'authors' for an instance of Task
|
Loading