test/project_test.rb in tracker_api-0.2.9 vs test/project_test.rb in tracker_api-0.2.10
- old
+ new
@@ -33,10 +33,38 @@
epic.must_be_instance_of TrackerApi::Resources::Epic
end
end
end
+ describe '.labels' do
+ describe 'with eager loading' do
+ let(:project_with_labels) do
+ VCR.use_cassette('get project with labels') do
+ client.project(project_id, fields: ':default,labels')
+ end
+ end
+
+ it 'gets all labels for this project' do
+ labels = project_with_labels.labels
+
+ labels.wont_be_empty
+ label = labels.first
+ label.must_be_instance_of TrackerApi::Resources::Label
+ end
+ end
+
+ it 'gets all labels for this project' do
+ VCR.use_cassette('get labels', record: :new_episodes) do
+ labels = project.labels
+
+ labels.wont_be_empty
+ label = labels.first
+ label.must_be_instance_of TrackerApi::Resources::Label
+ end
+ end
+ end
+
describe '.iterations' do
it 'can get only done iterations' do
VCR.use_cassette('get done iterations', record: :new_episodes) do
offset = -project.number_of_done_iterations_to_show.to_i
done_iterations = project.iterations(scope: :done, offset: offset)
@@ -84,10 +112,10 @@
end
end
it 'requires an iteration number > 0' do
VCR.use_cassette('get iteration by number', record: :new_episodes) do
- -> { project.iterations(number: 0) }.must_raise(ArgumentError, /> 0/)
+ -> { project.iterations(number: 0) }.must_raise(ArgumentError, /> 0/)
-> { project.iterations(number: -1) }.must_raise(ArgumentError, /> 0/)
end
end
end