Skip to content

Instantly share code, notes, and snippets.

@phinze
Created September 18, 2009 21:42
Show Gist options
  • Save phinze/189311 to your computer and use it in GitHub Desktop.
Save phinze/189311 to your computer and use it in GitHub Desktop.
it "should work with textareas and new lines" do
with_html <<-HTML
<html>
<form method="post" action="/login">
<label for="user_text">User Text</label>
<textarea id="user_text" name="user[text]"></textarea>
<input type="submit" />
</form>
</html>
HTML
webrat_session.should_receive(:post).with("/login", "user" => {"text" => "filling text area\nwith a new line"})
fill_in "User Text", :with => "filling text area\nwith a new line"
click_button
end
1)
Spec::Mocks::MockExpectationError in 'fill_in should work with textareas and new lines'
#<Webrat::Session:0xb732c67c> expected :post with ("/login", {"user"=>{"text"=>"filling text area\nwith a new line"}}) but received it with ("/login", {"user"=>{"text"=>"filling text area\n"}})
(eval):2:in `click_button'
./spec/public/fill_in_spec.rb:31:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment