Sha256: 2b453ec1a57e3406f401698a58c92ed5bc6d7b69cdf4c7385b1c177e85bdbc49
Contents?: true
Size: 1.16 KB
Versions: 10
Compression:
Stored size: 1.16 KB
Contents
require 'test_helper' module Workarea module Api module Admin class RecommendationSettingsIntegrationTest < IntegrationTest include Workarea::Admin::IntegrationTest setup :set_product def set_product @product = create_product end def create_recommendation_settings Recommendation::Settings.create!(id: @product.id) end def test_shows_recommendation_settings recommendation_settings = create_recommendation_settings get admin_api.product_recommendation_settings_path(@product.id) result = JSON.parse(response.body)['recommendation_settings'] assert_equal( recommendation_settings, Recommendation::Settings.new(result) ) end def test_updates_recommendation_settings recommendation_settings = create_recommendation_settings patch admin_api.product_recommendation_settings_path(@product.id), params: { recommendation_settings: { product_ids: ['foo'] } } assert_equal(['foo'], recommendation_settings.reload.product_ids) end end end end end
Version data entries
10 entries across 10 versions & 2 rubygems