File tree Expand file tree Collapse file tree 2 files changed +12
-4
lines changed Expand file tree Collapse file tree 2 files changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ def initialize(options = { })
1111 def list ( user_role )
1212 response = get_request ( "/2.0/teams/?role=#{ user_role . to_s } " )
1313 return response unless block_given?
14- response . each { |el | yield el }
14+ response [ "values" ] . each { |el | yield el }
1515 end
1616
1717
Original file line number Diff line number Diff line change 1010 '/2.0/teams/?role=member' ,
1111 { } ,
1212 { }
13- )
13+ ) . and_return ( { "values" => [ 'team1' , 'team2' , 'team3' ] } )
1414 end
1515
16- it 'should send a GET request for the teams of which the user is a member' do
17- team . list ( :member )
16+ context 'without a block' do
17+ it 'should send a GET request for the teams of which the user is a member' do
18+ team . list ( :member )
19+ end
20+ end
21+
22+ context 'with a block' do
23+ it 'should send a GET request for the teams of which the user is a member' do
24+ team . list ( :member ) { |team | team }
25+ end
1826 end
1927 end
2028end
You can’t perform that action at this time.
0 commit comments