Skip to content

armgit / spree

Public Imported from GitHub
0

Open Source Platform for DTC, B2B Commerce, Marketplaces & Omnichannel. REST APIs, TypeScript SDKs, and production-ready Next.js storefront. Self-host it. Own your data. No vendor lock-in. Zero platform fees.

Storefront: added account gift cards feauture tests

Damian Legawiec003a5f0d268f
diff --git a/storefront/spec/features/account/gift_cards_spec.rb b/storefront/spec/features/account/gift_cards_spec.rb
new file mode 100644
index 0000000000..4bfff827c7
--- /dev/null
+++ b/storefront/spec/features/account/gift_cards_spec.rb
@@ -0,0 +1,21 @@
+require 'spec_helper'
+
+RSpec.describe 'Account gift cards', type: :feature do
+ let(:user) { create(:user) }
+ let!(:gift_card) { create(:gift_card, user: user, amount: 10.00, expires_at: 3.days.from_now) }
+
+ before do
+ login_as(user, scope: :user)
+ visit spree.account_gift_cards_path
+ end
+
+ it 'shows gift cards' do
+ within("#gift_card_#{gift_card.id}") do
+ expect(page).to have_content(gift_card.display_code)
+ expect(page).to have_content(gift_card.display_state.titleize)
+ expect(page).to have_content(gift_card.display_amount)
+ expect(page).to have_content(gift_card.display_amount_used)
+ expect(page).to have_content(gift_card.expires_at.strftime('%B %-d, %Y'))
+ end
+ end
+end