@@ -36,7 +36,7 @@ module Matrix
36
36
let ( :selectors ) { [ { pacticipant_name : "Foo" , pacticipant_version_number : "1" } ] }
37
37
38
38
it "returns error messages" do
39
- expect ( subject . first ) . to eq "Pacticipant ' Foo' not found"
39
+ expect ( subject . first ) . to eq "Pacticipant Foo not found"
40
40
end
41
41
end
42
42
@@ -70,6 +70,49 @@ module Matrix
70
70
expect ( subject . first ) . to eq "Please specify the pacticipant name and version"
71
71
end
72
72
end
73
+
74
+ context "when the latest_tag is used instead of a version" do
75
+ before do
76
+ td . create_pacticipant ( "Foo" )
77
+ . create_version ( "1" )
78
+ . create_tag ( "prod" )
79
+ . create_pacticipant ( "Bar" )
80
+ . create_version ( "2" )
81
+ end
82
+
83
+ let ( :selectors ) { [ { pacticipant_name : "Foo" , latest_tag : "prod" } , { pacticipant_name : "Bar" , pacticipant_version_number : "2" } ] }
84
+
85
+ context "when there is a version for the tag" do
86
+ it "returns no error messages" do
87
+ expect ( subject ) . to eq [ ]
88
+ end
89
+ end
90
+
91
+ context "when there is not a version for the tag" do
92
+
93
+ let ( :selectors ) { [ { pacticipant_name : "Foo" , latest_tag : "wiffle" } , { pacticipant_name : "Bar" , pacticipant_version_number : "2" } ] }
94
+
95
+ it "returns an error message" do
96
+ expect ( subject ) . to eq [ "No version of Foo found with tag wiffle" ]
97
+ end
98
+ end
99
+ end
100
+
101
+ context "when the latest_tag is used as well as a version" do
102
+ before do
103
+ td . create_pacticipant ( "Foo" )
104
+ . create_version ( "1" )
105
+ . create_tag ( "prod" )
106
+ . create_pacticipant ( "Bar" )
107
+ . create_version ( "2" )
108
+ end
109
+
110
+ let ( :selectors ) { [ { pacticipant_name : "Foo" , pacticipant_version_number : "1" , latest_tag : "prod" } , { pacticipant_name : "Bar" , pacticipant_version_number : "2" } ] }
111
+
112
+ it "returns an error message" do
113
+ expect ( subject ) . to eq [ "A version and a latest tag cannot both be specified for Foo" ]
114
+ end
115
+ end
73
116
end
74
117
end
75
118
end
0 commit comments