forked from jperry/teamcity-ruby-client
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtests_spec.rb
47 lines (38 loc) · 1.2 KB
/
tests_spec.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
require_relative '../../spec_helper'
describe 'Tests' do
before(:each) do
@tc = TeamCity
# configure_client_with_authentication_apm
configure_client_with_authentication
end
# Get requests
describe 'GET', :vcr do
describe '.tests' do
it 'should fetch all the tests' do
tests = @tc.tests(build: 2614725)
tests.should have(9).items
end
it 'should allow you to filter results by test count locator' do
@tc.tests(build: 2614725, count:1).should have(1).items
end
it 'should allow you to filter by test id' do
@tc.tests(build: 2614725, id: 143).should have(1).items
end
it 'should return an empty array if no test is found' do
tests = @tc.tests(build: 2614725, id: 1433333)
tests.should be_empty
tests.class.should == Array
end
it 'should return an empty array if no build is found' do
tests = @tc.tests(build: 9999999)
tests.should be_empty
tests.class.should == Array
end
it 'should return an empty array if not build is given' do
tests = @tc.tests
tests.should be_empty
tests.class.should == Array
end
end
end
end