test/project_test.rb in tracker_api-1.6.0 vs test/project_test.rb in tracker_api-1.7.0

- old
+ new

@@ -90,10 +90,24 @@ story = current.stories.first story.must_be_instance_of TrackerApi::Resources::Story end end + it 'can get iteration with non-default fields' do + VCR.use_cassette('get current iteration', record: :new_episodes) do + iterations = project.iterations(scope: :current, fields: ":default,velocity,points,accepted_points,effective_points") + + iterations.wont_be_empty + + current = iterations.first + current.velocity.must_equal 10.0 + current.points.must_equal 10 + current.accepted_points.must_equal 0 + current.effective_points.must_equal 10.0 + end + end + it 'can get an iteration by number' do VCR.use_cassette('get iteration by number', record: :new_episodes) do iterations = project.iterations(number: 2) iterations.size.must_equal 1 @@ -173,9 +187,26 @@ activity = project.activity activity.wont_be_empty event = activity.first event.must_be_instance_of TrackerApi::Resources::Activity + end + end + end + + describe '.search' do + let(:pt_user) { PT_USER_3 } + + it 'can search a project' do + VCR.use_cassette('search project') do + project = client.project(pt_user[:project_id]) + search_container = project.search('name:"story to test search"') + + search_container.wont_be_nil + search_container.must_be_instance_of TrackerApi::Resources::SearchResultContainer + search_container.epics.must_be_instance_of TrackerApi::Resources::EpicsSearchResult + search_container.stories.must_be_instance_of TrackerApi::Resources::StoriesSearchResult + search_container.stories.stories.first[:id].must_equal 143444685 end end end end