Skip to content

Commit

Permalink
Merge pull request #209 from adammathys/store-credit-source-view
Browse files Browse the repository at this point in the history
Add source view for store credits
  • Loading branch information
jhawthorn committed Jul 27, 2015
2 parents 8ec4c2a + 9674282 commit 4c34399
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<fieldset data-hook="store-credit">
<legend align="center"><%= Spree.t(:store_credit, scope: :store_credit) %></legend>

<div class="row">
<div class="alpha six columns">
<dl>
<dt><%= Spree.t(:category) %>:</dt>
<dd><%= payment.source.category.name%></dd>

<dt><%= Spree.t(:memo) %>:</dt>
<dd><%= payment.source.memo %></dd>

<dt><%= Spree.t(:created_by) %>:</dt>
<dd><%= payment.source.created_by.email %></dd>

<dt><%= Spree.t(:issued_on, scope: [:admin, :store_credits]) %>:</dt>
<dd><%= l payment.source.created_at.to_date %></dd>
</dl>
</div>
</div>
</fieldset>
21 changes: 21 additions & 0 deletions backend/spec/features/admin/payments/store_credits_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
require 'spec_helper'

RSpec.describe 'Store credits', type: :feature do
stub_authorization!

let(:order) { FactoryGirl.create(:completed_order_with_totals) }
let(:payment) do
FactoryGirl.create(
:store_credit_payment,
order: order,
amount: 20
)
end

it "viewing a store credit payment" do
visit spree.admin_order_payment_path(order, payment)

expect(page).to have_content "Store Credit"
expect(page).to have_content "Amount: $20.00"
end
end

0 comments on commit 4c34399

Please sign in to comment.