Skip to content

Commit cd25968

Browse files
committed
Sorting by balance spec wasn't stable, check just th relevant position
1 parent acc0a61 commit cd25968

File tree

1 file changed

+2
-20
lines changed

1 file changed

+2
-20
lines changed

spec/controllers/users_controller_spec.rb

Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -118,16 +118,7 @@
118118
it 'orders the rows by their balance' do
119119
get :index, q: { s: "accounts_balance #{direction}" }
120120

121-
expect(assigns(:users).pluck(:id))
122-
.to eq(
123-
[
124-
admin_user.id,
125-
user.id,
126-
another_user.id,
127-
wrong_user.id,
128-
empty_email_user.id
129-
]
130-
)
121+
expect(assigns(:users).pluck(:id).first).to eq(admin_user.id)
131122
end
132123
end
133124

@@ -137,16 +128,7 @@
137128
it 'orders the rows by their balance' do
138129
get :index, q: { s: "accounts_balance #{direction}" }
139130

140-
expect(assigns(:users).pluck(:id))
141-
.to eq(
142-
[
143-
user.id,
144-
another_user.id,
145-
wrong_user.id,
146-
empty_email_user.id,
147-
admin_user.id,
148-
]
149-
)
131+
expect(assigns(:users).pluck(:id).last).to eq(admin_user.id)
150132
end
151133
end
152134
end

0 commit comments

Comments
 (0)