mirror of
https://github.com/we-promise/sure.git
synced 2026-04-19 03:54:08 +00:00
# test(api): Add request specs for merchants and tags endpoints (#645)
* Add files via upload Signed-off-by: Jose <39016041+jospaquim@users.noreply.github.com> * Add merchants and tags resources to routes Signed-off-by: Jose <39016041+jospaquim@users.noreply.github.com> * update * update spaces * fix: Apply CodeRabbit suggestions and add YARD documentation * docs: Add API documentation for merchants and tags endpoints * fix: Address CodeRabbit feedback on documentation * fix: Use authorize_scope! instead of ensure_read_scope * test(api): Add request specs for merchants and tags endpoints * test(api): Add request specs for merchants and tags endpoints * test(api): Convert specs to Minitest format in test/ * fix: Correct indentation for private methods * fix: merchant and tag test * Enhance tag tests for family scope and access Added tests to ensure tags from other families are not returned and that attempts to access them return 404. Signed-off-by: Jose <39016041+jospaquim@users.noreply.github.com> * Enhance merchants controller tests for family scope Added tests to ensure that merchants from other families are not returned in the index action and that accessing a merchant from another family returns a 404 error. Signed-off-by: Jose <39016041+jospaquim@users.noreply.github.com> * Fix test/implementation * Remove old token test code * Improve test --------- Signed-off-by: Jose <39016041+jospaquim@users.noreply.github.com> Co-authored-by: Juan José Mata <juanjo.mata@gmail.com>
This commit is contained in:
@@ -50,8 +50,8 @@ module Api
|
||||
family = current_resource_owner.family
|
||||
|
||||
@merchant = family.merchants.find_by(id: params[:id]) ||
|
||||
Merchant.joins(:transactions)
|
||||
.where(transactions: { account_id: family.accounts.select(:id) })
|
||||
Merchant.joins(transactions: :entry)
|
||||
.where(entries: { account_id: family.accounts.select(:id) })
|
||||
.distinct
|
||||
.find_by(id: params[:id])
|
||||
|
||||
|
||||
Reference in New Issue
Block a user