@@ -17,7 +17,8 @@ module Resources
17
17
let ( :query ) do
18
18
{
19
19
provider_version_tags : [ 'master' ] ,
20
- consumer_version_selectors : [ { tag : "dev" , latest : "true" } ]
20
+ consumer_version_selectors : [ { tag : "dev" , latest : "true" } ] ,
21
+ include_pending_status : false
21
22
}
22
23
end
23
24
@@ -26,7 +27,10 @@ module Resources
26
27
describe "GET" do
27
28
it "finds the pacts for verification by the provider" do
28
29
# Naughty not mocking out the query parsing...
29
- expect ( PactBroker ::Pacts ::Service ) . to receive ( :find_for_verification ) . with ( "Bar" , [ "master" ] , [ OpenStruct . new ( tag : "dev" , latest : true ) ] )
30
+ expect ( PactBroker ::Pacts ::Service ) . to receive ( :find_for_verification ) . with (
31
+ "Bar" ,
32
+ [ "master" ] ,
33
+ [ OpenStruct . new ( tag : "dev" , latest : true ) ] )
30
34
subject
31
35
end
32
36
@@ -47,7 +51,8 @@ module Resources
47
51
let ( :request_body ) do
48
52
{
49
53
providerVersionTags : [ 'master' ] ,
50
- consumerVersionSelectors : [ { tag : "dev" , latest : true } ]
54
+ consumerVersionSelectors : [ { tag : "dev" , latest : true } ] ,
55
+ includePendingStatus : true
51
56
}
52
57
end
53
58
@@ -62,7 +67,10 @@ module Resources
62
67
63
68
it "finds the pacts for verification by the provider" do
64
69
# Naughty not mocking out the query parsing...
65
- expect ( PactBroker ::Pacts ::Service ) . to receive ( :find_for_verification ) . with ( "Bar" , [ "master" ] , [ OpenStruct . new ( tag : "dev" , latest : true ) ] )
70
+ expect ( PactBroker ::Pacts ::Service ) . to receive ( :find_for_verification ) . with (
71
+ "Bar" ,
72
+ [ "master" ] ,
73
+ [ OpenStruct . new ( tag : "dev" , latest : true ) ] )
66
74
subject
67
75
end
68
76
@@ -79,9 +87,10 @@ module Resources
79
87
end
80
88
end
81
89
82
- it "sets the correct resource title " do
90
+ it "uses the correct options for the decorator " do
83
91
expect ( decorator ) . to receive ( :to_json ) do | options |
84
92
expect ( options [ :user_options ] [ :title ] ) . to eq "Pacts to be verified by provider Bar"
93
+ expect ( options [ :user_options ] [ :include_pending_status ] ) . to eq false
85
94
end
86
95
subject
87
96
end
0 commit comments