@@ -26,62 +26,6 @@ module Matrix
26
26
end
27
27
end
28
28
29
- describe "refresh" , migration : true do
30
- let ( :td ) { TestDataBuilder . new ( auto_refresh_matrix : false ) }
31
-
32
- before do
33
- PactBroker ::Database . migrate
34
- td . create_pact_with_hierarchy ( "Foo" , "1" , "Bar" )
35
- end
36
-
37
- context "with only a consumer_id" do
38
- subject { Row . refresh ( consumer_id : td . consumer . id ) }
39
-
40
- it "refreshes the data for the consumer" do
41
- subject
42
- expect ( Row . all . collect ( &:values ) ) . to contain_hash ( provider_name : "Bar" , consumer_name : "Foo" )
43
- end
44
- end
45
-
46
- context "with only a provider_id" do
47
- subject { Row . refresh ( provider_id : td . provider . id ) }
48
-
49
- it "refreshes the data for the provider" do
50
- subject
51
- expect ( Row . all . collect ( &:values ) ) . to contain_hash ( provider_name : "Bar" , consumer_name : "Foo" )
52
- end
53
- end
54
-
55
- context "with both consumer_id and provider_id" do
56
- subject { Row . refresh ( provider_id : td . provider . id , consumer_id : td . consumer . id ) }
57
-
58
- it "refreshes the data for the consumer and provider" do
59
- subject
60
- expect ( Row . all . collect ( &:values ) ) . to contain_hash ( provider_name : "Bar" , consumer_name : "Foo" )
61
- end
62
- end
63
-
64
- context "when there was existing data" do
65
- it "deletes the existing data before inserting the new data" do
66
- Row . refresh ( provider_id : td . provider . id , consumer_id : td . consumer . id )
67
- expect ( Row . count ) . to eq 1
68
- td . create_consumer_version ( "2" )
69
- . create_pact
70
- Row . refresh ( provider_id : td . provider . id , consumer_id : td . consumer . id )
71
- expect ( Row . count ) . to eq 2
72
- end
73
- end
74
-
75
- context "with a pacticipant_id" do
76
- subject { Row . refresh ( pacticipant_id : td . provider . id ) }
77
-
78
- it "refreshes the data for both consumer and provider roles" do
79
- subject
80
- expect ( Row . all . collect ( &:values ) ) . to contain_hash ( provider_name : "Bar" , consumer_name : "Foo" )
81
- end
82
- end
83
- end
84
-
85
29
describe "<=>" do
86
30
let ( :row_1 ) do
87
31
Row . new (
0 commit comments