Better multiple category test, also verifies accuracy

jermie 9 anos atrás
pai
commit
209d302923
1 arquivos alterados com 3 adições e 4 exclusões
  1. 3 4
      spec/models/agents/rss_agent_spec.rb

+ 3 - 4
spec/models/agents/rss_agent_spec.rb

@@ -157,10 +157,9 @@ describe Agents::RssAgent do
157 157
 
158 158
     it "captures multiple categories" do
159 159
       agent.check
160
-      first, second, third = agent.events.take(3)
161
-      expect(first.payload['categories'].count).to eq(3)
162
-      expect(second.payload['categories'].count).to eq(2)
163
-      expect(third.payload['categories'].count).to eq(1)
160
+      first, *, third = agent.events.take(3)
161
+      expect(first.payload['categories']).to eq(["csv", "crossplatform", "utilities"])
162
+      expect(third.payload['categories']).to eq(["web"])
164 163
     end
165 164
   end
166 165