Skip to content

Commit

Permalink
On postgres queries without an ORDER are ordered randomly, this caused
Browse files Browse the repository at this point in the history
random spec failures
  • Loading branch information
dsander committed Mar 19, 2015
1 parent 0ad7ea7 commit 0daea40
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions spec/models/agents/website_agent_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -379,13 +379,12 @@
checker.check
}.to change { Event.count }.by(2)

event = Event.all[-1]
expect(event.payload['version']).to eq(2.5)
expect(event.payload['title']).to eq("second")
(event2, event1) = Event.last(2)
expect(event1.payload['version']).to eq(2.5)
expect(event1.payload['title']).to eq("second")

event = Event.all[-2]
expect(event.payload['version']).to eq(2)
expect(event.payload['title']).to eq("first")
expect(event2.payload['version']).to eq(2)
expect(event2.payload['title']).to eq("first")
end

it "stores the whole object if :extract is not specified" do
Expand Down

0 comments on commit 0daea40

Please sign in to comment.