Refactoring: Fix rubocop violation and modify rspec expectation