spec/integration/projects_spec.rb in patch_ruby-1.3.0 vs spec/integration/projects_spec.rb in patch_ruby-1.4.0
- old
+ new
@@ -20,9 +20,29 @@
retrieve_project_response = Patch::Project.retrieve_project(project_id)
expect(retrieve_project_response.data.id).to eq project_id
end
+ it 'supports filtering projects' do
+ country = 'US'
+ projects = Patch::Project.retrieve_projects(country: country)
+ projects.data.map do |project|
+ expect(project.country).to eq country
+ end
+
+ type = 'dac'
+ projects = Patch::Project.retrieve_projects(type: type)
+ projects.data.map do |project|
+ expect(project.type).to eq type
+ 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
+ end
+ end
+
describe 'returned fields' do
before do
@project = Patch::Project.retrieve_projects(page: 1).data.first
end