spec/integration/projects_spec.rb in patch_ruby-2.0.0 vs spec/integration/projects_spec.rb in patch_ruby-2.1.1

- old
+ new

@@ -63,21 +63,35 @@ inventory = project.inventory expect(inventory).to be_an_instance_of(Array) expect(inventory[0]).to be_an_instance_of(Patch::Inventory) expect(inventory[0].vintage_year).to be_an_instance_of(Integer) + expect(inventory[0].vintage_start_year).to be_an_instance_of(Integer) + expect(inventory[0].vintage_end_year).to be_an_instance_of(Integer) expect(inventory[0].amount_available).to be_an_instance_of(Integer) expect(inventory[0].price).to be_an_instance_of(Integer) expect(inventory[0].currency).to be_an_instance_of(String) expect(inventory[0].unit).to be_an_instance_of(String) + + issuance_type = project.issuance_type + expect(issuance_type).to be_an_instance_of(String) + + disclaimers = project.disclaimers + expect(disclaimers).to be_an_instance_of(Array) + expect(disclaimers[0]).to be_an_instance_of(Patch::Disclaimer) + expect(disclaimers[0].body).to be_an_instance_of(String) + expect(disclaimers[0].header).to be_an_instance_of(String) + expect(disclaimers[0].severity).to be_an_instance_of(String) + expect(disclaimers[0].link_text).to be_an_instance_of(String) + expect(disclaimers[0].link_destination).to be_an_instance_of(String) end it 'retrieves projects in the requested language' do projects_response = Patch::Project.retrieve_projects(accept_language: 'fr') - expect(projects_response.data.first.name).to include 'Démo' # French + expect(projects_response.data.last.name).to include 'Démo' # French - project_id = projects_response.data.first.id + project_id = projects_response.data.last.id project_response = Patch::Project.retrieve_project(project_id, accept_language: 'fr') - expect(project_response.data.name).to include 'Démo' # Frenc + expect(project_response.data.name).to include 'Démo' # French end end