Crop wranglers can add alternate names

This commit is contained in:
Miles Gould
2014-10-18 15:35:57 +01:00
parent cdf6d4b09a
commit 77d1d067fa
2 changed files with 9 additions and 0 deletions

View File

@@ -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 }

View File

@@ -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