spec/integration/projects_spec.rb in patch_ruby-1.24.2 vs spec/integration/projects_spec.rb in patch_ruby-2.0.0
- old
+ new
@@ -32,23 +32,21 @@
end
minimum_available_mass = 100
projects = Patch::Project.retrieve_projects(minimum_available_mass: minimum_available_mass)
projects.data.map do |project|
- expect(project.remaining_mass_g >= minimum_available_mass).to be true
+ project_mass = project.inventory.sum(&:amount_available)
+ expect(project_mass >= minimum_available_mass).to be true
end
end
it 'returns the expected fields' do
project = Patch::Project.retrieve_projects(page: 1).data.first
keys = attributes_for(:project).keys
expect(project.to_hash.keys).to include(*keys)
expect(project.photos).to be_an_instance_of(Array)
- expect(project.average_price_per_tonne_cents_usd)
- .to be_an_instance_of(Integer)
- expect(project.remaining_mass_g).to be_an_instance_of(Integer)
expect(project.longitude).to be_an_instance_of(Float)
expect(project.latitude).to be_an_instance_of(Float)
expect(project.technology_type)
.to be_an_instance_of(Patch::TechnologyType)