Skip to content

Commit

Permalink
Assert on ordered data
Browse files Browse the repository at this point in the history
  • Loading branch information
xjunior committed May 10, 2024
1 parent 8455070 commit bfd5391
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions audiences/spec/models/audiences/external_user_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,12 @@

it "updates existing users" do
joseph = Audiences::ExternalUser.create(user_id: 456, data: { "id" => 456, displayName: "Joseph F. Doe" })
user_data = [
{ "id" => 123, "displayName" => "John Doe" },
{ "id" => 456, "displayName" => "Joseph Doe" },
]

john, updated_joseph, *others = Audiences::ExternalUser.wrap([
{ "id" => 123,
"displayName" => "John Doe" },
{ "id" => 456,
"displayName" => "Joseph Doe" },
])
john, updated_joseph, *others = Audiences::ExternalUser.wrap(user_data).order(:user_id)

expect(others).to be_empty
expect(john.user_id).to eql "123"
Expand Down

0 comments on commit bfd5391

Please sign in to comment.