Sha256: 3e2b22dcfabe94d8ce937508eb782bd3b21fc9cbbbb8f3cd0108ea8ec11f6b67

Contents?: true

Size: 813 Bytes

Versions: 28

Compression:

Stored size: 813 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(cookies[:email].present?)
        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(cookies[:email].blank?)
        assert(flash[:error].present?)
        assert_equal(0, Email::Signup.count)
      end
    end
  end
end

Version data entries

28 entries across 28 versions & 1 rubygems

Version Path
workarea-storefront-3.5.27 test/integration/workarea/storefront/email_signups_integration_test.rb
workarea-storefront-3.5.26 test/integration/workarea/storefront/email_signups_integration_test.rb
workarea-storefront-3.5.25 test/integration/workarea/storefront/email_signups_integration_test.rb
workarea-storefront-3.5.23 test/integration/workarea/storefront/email_signups_integration_test.rb
workarea-storefront-3.5.22 test/integration/workarea/storefront/email_signups_integration_test.rb
workarea-storefront-3.5.21 test/integration/workarea/storefront/email_signups_integration_test.rb
workarea-storefront-3.5.20 test/integration/workarea/storefront/email_signups_integration_test.rb
workarea-storefront-3.5.19 test/integration/workarea/storefront/email_signups_integration_test.rb
workarea-storefront-3.5.18 test/integration/workarea/storefront/email_signups_integration_test.rb
workarea-storefront-3.5.17 test/integration/workarea/storefront/email_signups_integration_test.rb
workarea-storefront-3.5.16 test/integration/workarea/storefront/email_signups_integration_test.rb
workarea-storefront-3.5.15 test/integration/workarea/storefront/email_signups_integration_test.rb
workarea-storefront-3.5.14 test/integration/workarea/storefront/email_signups_integration_test.rb
workarea-storefront-3.5.13 test/integration/workarea/storefront/email_signups_integration_test.rb
workarea-storefront-3.5.12 test/integration/workarea/storefront/email_signups_integration_test.rb
workarea-storefront-3.5.11 test/integration/workarea/storefront/email_signups_integration_test.rb
workarea-storefront-3.5.10 test/integration/workarea/storefront/email_signups_integration_test.rb
workarea-storefront-3.5.9 test/integration/workarea/storefront/email_signups_integration_test.rb
workarea-storefront-3.5.8 test/integration/workarea/storefront/email_signups_integration_test.rb
workarea-storefront-3.5.7 test/integration/workarea/storefront/email_signups_integration_test.rb