mirror of
https://github.com/Growstuff/growstuff.git
synced 2026-05-14 03:05:59 -04:00
Crop wranglers can add alternate names
This commit is contained in:
@@ -81,6 +81,9 @@
|
||||
= link_to 'Edit', edit_alternate_name_path(an), { :class => 'btn btn-default btn-xs' }
|
||||
- if can? :destroy, an
|
||||
= link_to 'Delete', an, method: :delete, data: { confirm: 'Are you sure?' }, :class => 'btn btn-default btn-xs'
|
||||
%p
|
||||
- if can? :edit, @crop
|
||||
= link_to 'Add', new_alternate_name_path( :crop_id => @crop.id ), { :class => 'btn btn-default btn-xs' }
|
||||
|
||||
= render :partial => 'varieties', :locals => { :crop => @crop }
|
||||
|
||||
|
||||
@@ -34,6 +34,12 @@ feature "Alternate names" do
|
||||
href: alternate_name_path(alternate_eggplant)
|
||||
end
|
||||
|
||||
scenario "Crop wranglers can add alternate names" do
|
||||
crop = alternate_eggplant.crop
|
||||
visit crop_path(crop)
|
||||
expect(page).to have_link "Add",
|
||||
href: new_alternate_name_path(crop_id: crop.id)
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user