refactored unit tests. put common AR tests in trait
added test case for #1310