Skip to content

Commit

Permalink
test: add test for questions order
Browse files Browse the repository at this point in the history
  • Loading branch information
Stef-Rousset committed Oct 29, 2024
1 parent 9c0fd2d commit b2b6b08
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,13 @@ def memory_usage
end
end
end

describe "questions_hash" do
it "generates a hash of questions ordered by position" do
questions.shuffle!
expect(subject.instance_eval { questions_hash }.keys.map { |key| key[0].to_i }.uniq).to eq(questions.sort_by(&:position).map { |question| question.position + 1 })
end
end
end
end
end

0 comments on commit b2b6b08

Please sign in to comment.