mirror of
https://github.com/we-promise/sure.git
synced 2026-04-14 01:24:06 +00:00
* Add AI merchant enhancement and dedup * Enhancements Add error if job is already running add note that we also merge merchants * Allow updating provider website * Review fixes * Update provider_merchant.rb * Linter and fixes * FIX transaction quick menu modal
48 lines
1.2 KiB
Ruby
48 lines
1.2 KiB
Ruby
require "test_helper"
|
|
|
|
class FamilyMerchantsControllerTest < ActionDispatch::IntegrationTest
|
|
setup do
|
|
sign_in @user = users(:family_admin)
|
|
@merchant = merchants(:netflix)
|
|
end
|
|
|
|
test "index" do
|
|
get family_merchants_path
|
|
assert_response :success
|
|
end
|
|
|
|
test "new" do
|
|
get new_family_merchant_path
|
|
assert_response :success
|
|
end
|
|
|
|
test "should create merchant" do
|
|
assert_difference("FamilyMerchant.count") do
|
|
post family_merchants_url, params: { family_merchant: { name: "new merchant", color: "#000000" } }
|
|
end
|
|
|
|
assert_redirected_to family_merchants_path
|
|
end
|
|
|
|
test "should update merchant" do
|
|
patch family_merchant_url(@merchant), params: { family_merchant: { name: "new name", color: "#000000" } }
|
|
assert_redirected_to family_merchants_path
|
|
end
|
|
|
|
test "should destroy merchant" do
|
|
assert_difference("FamilyMerchant.count", -1) do
|
|
delete family_merchant_url(@merchant)
|
|
end
|
|
|
|
assert_redirected_to family_merchants_path
|
|
end
|
|
|
|
test "enhance enqueues job and redirects" do
|
|
assert_enqueued_with(job: EnhanceProviderMerchantsJob) do
|
|
post enhance_family_merchants_path
|
|
end
|
|
|
|
assert_redirected_to family_merchants_path
|
|
end
|
|
end
|