Sha256: dd8f57cdf08e0c7e9ac2d31d2354a620761ae0d6665d32758c8059da133074db

Contents?: true

Size: 1023 Bytes

Versions: 16

Compression:

Stored size: 1023 Bytes

Contents

require 'test_helper'

module Workarea
  module Api
    module Storefront
      class EmailSignupsIntegrationTest < IntegrationTest
        setup :set_content

        def set_content
          page = Workarea::Storefront::EmailSignupsViewModel.new
          page.content.blocks.create!(
            type: :text,
            data: { text: 'foo bar' }
          )
        end

        def test_show_email_signups
          get storefront_api.email_signups_path
          result = JSON.parse(response.body)

          result_block = result['content_blocks'].first
          assert_equal('text', result_block['type'])
          assert_equal('foo bar', result_block['data']['text'])
        end

        def test_create_email_signups
          assert_difference 'Email::Signup.count', 2 do
            post storefront_api.email_signups_path, params: { email: 'email@example.com' }
            post storefront_api.email_signups_path, params: { email: 'email2@example.com' }
          end
        end
      end
    end
  end
end

Version data entries

16 entries across 16 versions & 2 rubygems

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