Sha256: 9f69d4c45fb4bc2551c022709f60f267c719260deb898f36d2113260945c9b7f

Contents?: true

Size: 959 Bytes

Versions: 16

Compression:

Stored size: 959 Bytes

Contents

require 'test_helper'

module Workarea
  module Api
    module Admin
      class ReleaseChangesIntegrationTest < IntegrationTest
        include Workarea::Admin::IntegrationTest

        setup :set_sample_attributes

        def set_sample_attributes
          @release = create_release(name: 'API Release')
          @sample_attributes = create_product
                                .as_json
                                .except('_id', 'slug', 'last_indexed_at')
        end

        def test_creates_a_changeset_for_the_specific_release
          product = create_product(name: 'foo')
          patch admin_api.product_path(product.id),
            params: { product: { name: 'bar' }, release_id: @release.id.to_s }

          product.reload
          assert_equal('foo', product.name)

          changes = product.changesets.first
          assert_equal({ I18n.locale.to_s => 'bar' }, changes.changeset[:name])
        end
      end
    end
  end
end

Version data entries

16 entries across 16 versions & 2 rubygems

Version Path
workarea-api-4.5.6 admin/test/integration/workarea/api/admin/release_changes_integration_test.rb
workarea-api-admin-4.5.6 test/integration/workarea/api/admin/release_changes_integration_test.rb
workarea-api-4.5.5 admin/test/integration/workarea/api/admin/release_changes_integration_test.rb
workarea-api-admin-4.5.5 test/integration/workarea/api/admin/release_changes_integration_test.rb
workarea-api-4.5.4 admin/test/integration/workarea/api/admin/release_changes_integration_test.rb
workarea-api-admin-4.5.4 test/integration/workarea/api/admin/release_changes_integration_test.rb
workarea-api-4.5.3 admin/test/integration/workarea/api/admin/release_changes_integration_test.rb
workarea-api-admin-4.5.3 test/integration/workarea/api/admin/release_changes_integration_test.rb
workarea-api-4.5.2 admin/test/integration/workarea/api/admin/release_changes_integration_test.rb
workarea-api-admin-4.5.2 test/integration/workarea/api/admin/release_changes_integration_test.rb
workarea-api-4.5.0 admin/test/integration/workarea/api/admin/release_changes_integration_test.rb
workarea-api-admin-4.5.0 test/integration/workarea/api/admin/release_changes_integration_test.rb
workarea-api-4.4.7 admin/test/integration/workarea/api/admin/release_changes_integration_test.rb
workarea-api-admin-4.4.7 test/integration/workarea/api/admin/release_changes_integration_test.rb
workarea-api-4.4.6 admin/test/integration/workarea/api/admin/release_changes_integration_test.rb
workarea-api-admin-4.4.6 test/integration/workarea/api/admin/release_changes_integration_test.rb