Sha256: 668d2d7ee25c836901cc8ba4f3806ed977cde8a52b1d605572fbf3e7777de739
Contents?: true
Size: 973 Bytes
Versions: 62
Compression:
Stored size: 973 Bytes
Contents
require 'test_helper' module Workarea module Storefront class UserViewModelTest < TestCase def test_has_default_addresses user = User.new view_model = Storefront::UserViewModel.new(user) refute(view_model.has_default_addresses?) user.addresses.build assert(view_model.has_default_addresses?) end def test_default_credit_card_gets_the_default_card_from_payment user = create_user profile = Payment::Profile.lookup(PaymentReference.new(user)) card = create_saved_credit_card(profile: profile) view_model = Storefront::UserViewModel.new(user) assert_equal(card, view_model.default_credit_card) end def test_email_signup user = create_user Email.signup(user.email) assert(UserViewModel.wrap(user).email_signup?) Email.unsignup(user.email) refute(UserViewModel.wrap(user).email_signup?) end end end end
Version data entries
62 entries across 62 versions & 1 rubygems
Version | Path |
---|---|
workarea-storefront-3.4.13 | test/view_models/workarea/storefront/user_view_model_test.rb |
workarea-storefront-3.4.12 | test/view_models/workarea/storefront/user_view_model_test.rb |