Created
May 18, 2011 00:46
-
-
Save jorgemanrubia/977786 to your computer and use it in GitHub Desktop.
Definition of helper methods for simulating requests with raw content (raw_post parameter) (RSpec)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Methods like "put_raw" will put the raw content in the request | |
[:put, :post].each do |verb| | |
define_method "#{verb}_raw" do |method, content| | |
request.stub!(:raw_post).and_return(content) | |
put method | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment