Removing enterprises form from user edit page

This commit is contained in:
Rob H
2014-09-11 11:40:22 +10:00
parent 8cc5c2246a
commit 9085741f3c
3 changed files with 0 additions and 43 deletions

View File

@@ -1,6 +0,0 @@
Deface::Override.new(:virtual_path => "spree/admin/users/_form",
:insert_after => "[data-hook='admin_user_form_fields']",
:partial => "spree/admin/users/enterprises_form",
:name => "add_enterprises_to_user"
)

View File

@@ -1,13 +0,0 @@
%fieldset
%legend 'Manage Enterprises'
= f.field_container :enterprise_roles do
- f.object.build_enterprise_roles
%table
= f.fields_for :enterprise_roles do |enterprise_form|
%tr
%td
= hidden_field_tag "#{enterprise_form.object_name}[_destroy]", 1, :id => nil
= check_box_tag "#{enterprise_form.object_name}[_destroy]", 0, !enterprise_form.object.new_record?
%td
= label_tag "#{enterprise_form.object_name}[_destroy]", enterprise_form.object.enterprise.name
= enterprise_form.hidden_field :enterprise_id

View File

@@ -31,30 +31,6 @@ feature %q{
user.enterprises.first.name.should == supplier2.name
end
end
context "with existing enterprises managed" do
before do
user.enterprise_roles.create!(enterprise: supplier1)
user.enterprise_roles.create!(enterprise: distributor1)
end
it "can remove and add enterprise management for a user" do
login_to_admin_section
click_link 'Users'
click_link user.email
click_link 'Edit'
uncheck distributor1.name # remove
check distributor2.name # add
click_button 'Update'
user.enterprises.count.should == 2
user.enterprises.should include supplier1
user.enterprises.should include distributor2
end
end
end
describe "product management" do