Move service tests out of seat_links_request_spec
Problem
The spec/requests/api/v1/seat_links_request_spec.rb spec is testing too much implementation detail that belongs in service tests. The main issues are:
Cloud license generation - Tests verify license creation, cloud license building, and service token generation. These are service responsibilities and should be tested in isolation.
Seat link attribute mapping - Tests verify exact attribute values on the LicenseSeatLink model. This is an implementation detail that should be in service tests.
Proposal
The request spec should focus on:
- HTTP status codes and service response handling
- Happy path and error scenarios at the API boundary
Move to service tests:
- Cloud license generation, seat links and service token logic
- Seat link attribute verification
- Subscription name lookup The spec should mock service responses and verify the controller correctly handles success/failure cases, rather than testing the full business logic flow.
Edited by Florian Jedelhauser