Sha256: b6888d7a8a97a478a76d02af891b4a25eab39c7b38d5201c68c27c02cc6d9014

Contents?: true

Size: 733 Bytes

Versions: 34

Compression:

Stored size: 733 Bytes

Contents

require 'test_helper'

module Workarea
  module Storefront
    class EmailSignupsIntegrationTest < Workarea::IntegrationTest
      def test_saves_a_sign_up
        post storefront.email_signup_path,
          params: { email: 'bcrouse@workarea.com' }

        assert_redirected_to(storefront.root_path)
        assert(flash[:success].present?)
        assert_equal(1, Email::Signup.where(email: 'bcrouse@workarea.com').count)
      end

      def test_handles_a_sign_up_failure
        post storefront.email_signup_path,
          params: { email: 'bcrouse@workarea' }

        assert_redirected_to(storefront.root_path)
        assert(flash[:error].present?)
        assert_equal(0, Email::Signup.count)
      end
    end
  end
end

Version data entries

34 entries across 34 versions & 1 rubygems

Version Path
workarea-storefront-3.4.25 test/integration/workarea/storefront/email_signups_integration_test.rb
workarea-storefront-3.4.24 test/integration/workarea/storefront/email_signups_integration_test.rb
workarea-storefront-3.4.23 test/integration/workarea/storefront/email_signups_integration_test.rb
workarea-storefront-3.4.22 test/integration/workarea/storefront/email_signups_integration_test.rb
workarea-storefront-3.4.21 test/integration/workarea/storefront/email_signups_integration_test.rb
workarea-storefront-3.4.20 test/integration/workarea/storefront/email_signups_integration_test.rb
workarea-storefront-3.4.19 test/integration/workarea/storefront/email_signups_integration_test.rb
workarea-storefront-3.4.18 test/integration/workarea/storefront/email_signups_integration_test.rb
workarea-storefront-3.4.17 test/integration/workarea/storefront/email_signups_integration_test.rb
workarea-storefront-3.4.16 test/integration/workarea/storefront/email_signups_integration_test.rb
workarea-storefront-3.4.15 test/integration/workarea/storefront/email_signups_integration_test.rb
workarea-storefront-3.4.14 test/integration/workarea/storefront/email_signups_integration_test.rb
workarea-storefront-3.4.13 test/integration/workarea/storefront/email_signups_integration_test.rb
workarea-storefront-3.4.12 test/integration/workarea/storefront/email_signups_integration_test.rb