RSpec tests refactoring