forked from spree-contrib/spree_drop_ship
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Jeff Dutil
authored and
Jeff Dutil
committed
Jul 23, 2014
1 parent
caec60b
commit 4606415
Showing
3 changed files
with
27 additions
and
6 deletions.
There are no files selected for viewing
6 changes: 1 addition & 5 deletions
6
app/overrides/spree/admin/products/_form/converted_admin_product_form_right.html.erb.deface
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 |
---|---|---|
@@ -1,9 +1,5 @@ | ||
<!-- insert_bottom "[data-hook='admin_product_form_right'], #admin_product_form_right[data-hook]" --> | ||
|
||
<% if can? :manage, Spree::Supplier %> | ||
<%= f.field_container :supplier do %> | ||
<%= f.label :supplier_id, Spree.t(:supplier) %> | ||
<%= f.collection_select(:supplier_id, @suppliers, :id, :name, { include_blank: 'None' }, { class: 'select2' }) %> | ||
<%= f.error_message_on :supplier %> | ||
<% end %> | ||
<!-- TODO allow assignment to variants --> | ||
<% end %> |
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,25 @@ | ||
require 'spec_helper' | ||
|
||
describe 'Admin - Products', js: true do | ||
|
||
context 'as Admin' do | ||
|
||
xit 'should be able to change supplier' do | ||
s1 = create(:supplier) | ||
s2 = create(:supplier) | ||
product = create :product | ||
product.add_supplier! s1 | ||
|
||
login_user create(:admin_user) | ||
visit spree.admin_product_path(product) | ||
|
||
select2 s2.name, from: 'Supplier' | ||
click_button 'Update' | ||
|
||
expect(page).to have_content("Product \"#{product.name}\" has been successfully updated!") | ||
expect(product.reload.suppliers.first.id).to eql(s2.id) | ||
end | ||
|
||
end | ||
|
||
end |