Added some tests and scopes to models