From 90e2145e33913ff59b99b81a660cb730e3c7efd8 Mon Sep 17 00:00:00 2001 From: Azul Date: Mon, 9 May 2016 08:54:57 +0200 Subject: test: make identity test locale independent It somehow managed to fail for a certain test order. Seems rather rare though - have not been able to reproduce it in 5 runs. Failed with --seed 60219. --- test/support/record_assertions.rb | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 test/support/record_assertions.rb (limited to 'test/support') diff --git a/test/support/record_assertions.rb b/test/support/record_assertions.rb new file mode 100644 index 0000000..30b947f --- /dev/null +++ b/test/support/record_assertions.rb @@ -0,0 +1,10 @@ +module RecordAssertions + + def assert_error(record, options) + options.each do |k, v| + errors = record.errors[k] + assert_equal I18n.t("errors.messages.#{v}"), errors.first + end + end + +end -- cgit v1.2.3