Skip to content

Instantly share code, notes, and snippets.

@varyonic
Last active August 29, 2015 14:08
Show Gist options
  • Save varyonic/44211e1dcc089f694d94 to your computer and use it in GitHub Desktop.
Save varyonic/44211e1dcc089f694d94 to your computer and use it in GitHub Desktop.
context "with inputs twice" do
let :body do
build_form do |f|
f.inputs do |f|
f.input :title
f.input :body
end
f.inputs do |f|
f.input :author
f.input :published_at
end
end
end
it "should render four inputs" do
expect(body.scan(/<input/).size).to eq(2) # utf8, title
expect(body.scan(/<textare/).size).to eq(1) # body
expect(body.scan(/<select/).size).to eq(6) # author, published at
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment