spec/integration/projects_spec.rb in patch_ruby-1.8.0 vs spec/integration/projects_spec.rb in patch_ruby-1.9.0
- old
+ new
@@ -1,10 +1,6 @@
RSpec.describe 'Projects Integration' do
- Patch.configure do |config|
- config.access_token = ENV['SANDBOX_API_KEY']
- end
-
it 'supports retrieve and list' do
page_limit = 1
next_page = 1
projects = []
@@ -41,22 +37,14 @@
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
+ it 'returns the expected fields' do
+ project = Patch::Project.retrieve_projects(page: 1).data.first
- it 'returns photos' do
- expect(@project.photos).to be_an_instance_of(Array)
- end
-
- it 'returns average_price_per_tonne_cents_usd' do
- expect(@project.average_price_per_tonne_cents_usd).to be_an_instance_of(Integer)
- end
-
- it 'returns remaining_mass_g' do
- expect(@project.remaining_mass_g).to be_an_instance_of(Integer)
+ 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)
end
end
end