From 0f1b1d78b15bd779c3427d4275d45d3e34e0b2ef Mon Sep 17 00:00:00 2001 From: unarist Date: Thu, 8 Jun 2017 01:59:28 +0900 Subject: Use "match_array" only for order independent assertions (#3626) --- spec/models/user_spec.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'spec/models') diff --git a/spec/models/user_spec.rb b/spec/models/user_spec.rb index 735c78c64..9cb36d467 100644 --- a/spec/models/user_spec.rb +++ b/spec/models/user_spec.rb @@ -46,7 +46,7 @@ RSpec.describe User, type: :model do it 'returns an array of recent users ordered by id' do user_1 = Fabricate(:user) user_2 = Fabricate(:user) - expect(User.recent).to match_array([user_2, user_1]) + expect(User.recent).to eq [user_2, user_1] end end @@ -92,7 +92,7 @@ RSpec.describe User, type: :model do ] Fabricate(:user, current_sign_in_ip: '0.0.0.0', last_sign_in_ip: '0.0.0.0') - expect(User.with_recent_ip_address('0.0.0.42')).to eq specifieds + expect(User.with_recent_ip_address('0.0.0.42')).to match_array(specifieds) end end end -- cgit