mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-27 21:06:49 +00:00
The output of this link helper has changed slightly. All the attributes are the same as before, but they seem to be in alphabetical order now.
Fixes:
69) Spree::BaseHelper#link_to_remove_fields returns an `a` tag followed by a hidden `input` tag
Failure/Error: expect(subject).to eq("<a href=\"#\" class=\"remove_fields icon_link with-tip icon-trash\" data-action=\"remove\" title=\"Remove\"><span class='text'>Hola</span></a><input type="hidden" name="_method" value="destroy">")
expected: "<a href=\"#\" class=\"remove_fields icon_link with-tip icon-trash\" data-action=\"remove\" title=\"...</span></a><input type="hidden" name="_method" value="destroy">"
got: "<a class=\"remove_fields icon_link with-tip icon-trash\" data-action=\"remove\" href=\"#\" title=\"...</span></a><input type="hidden" name="_method" value="destroy">"
(compared using ==)
# ./spec/helpers/spree/admin/base_helper_spec.rb:12:in `block (3 levels) in <top (required)>'
16 lines
679 B
Ruby
16 lines
679 B
Ruby
require 'spec_helper'
|
|
|
|
describe Spree::BaseHelper, type: :helper do
|
|
describe "#link_to_remove_fields" do
|
|
let(:name) { 'Hola' }
|
|
let(:form) { double('form_for', hidden_field: '<input type="hidden" name="_method" value="destroy">') }
|
|
let(:options) { {} }
|
|
|
|
subject { helper.link_to_remove_fields(name, form, options) }
|
|
|
|
it 'returns an `a` tag followed by a hidden `input` tag' do
|
|
expect(subject).to eq("<a class=\"remove_fields icon_link with-tip icon-trash\" data-action=\"remove\" href=\"#\" title=\"Remove\"><span class='text'>Hola</span></a><input type="hidden" name="_method" value="destroy">")
|
|
end
|
|
end
|
|
end
|