-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refact and add specs to stock locations helper
- Loading branch information
1 parent
0e35bb6
commit 67717d3
Showing
2 changed files
with
22 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# frozen_string_literal: true | ||
|
||
require 'spec_helper' | ||
|
||
describe Spree::Admin::StockLocationsHelper, type: :helper do | ||
describe "#admin_stock_location_display_name" do | ||
subject { helper.admin_stock_location_display_name(stock_location) } | ||
|
||
context "without admin_name" do | ||
let(:stock_location) { create(:stock_location_with_items) } | ||
|
||
it { is_expected.to eq "NY Warehouse" } | ||
end | ||
|
||
context "with admin_name" do | ||
let(:stock_location) { create(:stock_location_with_items, admin_name: "solidus") } | ||
|
||
it { is_expected.to eq "solidus / NY Warehouse" } | ||
end | ||
end | ||
end |