Test more exact output in SettingsHelper spec

Signed-off-by: Alex Coles <alex@alexbcoles.com>
pull/2612/head
Alex Coles 10 years ago
parent 494a81d726
commit f8de570407
  1. 13
      spec/helpers/settings_helper_spec.rb

@ -93,7 +93,7 @@ describe SettingsHelper, type: :helper do
describe '#setting_text_field' do
before do
expect(Setting).to receive(:field).and_return('Value')
expect(Setting).to receive(:field).and_return('important value')
end
subject(:output) {
@ -103,13 +103,15 @@ describe SettingsHelper, type: :helper do
it_behaves_like 'labelled'
it 'should output element' do
expect(output).to have_selector 'input[type="text"]'
expect(output).to include %{
<input id="settings_field" name="settings[field]" type="text" value="important value" />
}.strip
end
end
describe '#setting_text_area' do
before do
expect(Setting).to receive(:field).and_return('Value')
expect(Setting).to receive(:field).and_return('important text')
end
subject(:output) {
@ -119,7 +121,10 @@ describe SettingsHelper, type: :helper do
it_behaves_like 'labelled'
it 'should output element' do
expect(output).to have_selector 'textarea'
expect(output).to include %{
<textarea id="settings_field" name="settings[field]">
important text</textarea>
}.strip
end
end

Loading…
Cancel
Save