Created
November 18, 2014 03:55
-
-
Save mz026/33430e40db74124f50b7 to your computer and use it in GitHub Desktop.
Revisions
-
mz026 created this gist
Nov 18, 2014 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,9 @@ # Usage: # include_examples 'require_in_params', :tag, ->(group) { post :create, params } shared_examples "require_in_params" do |attr, block| it "returns 400 if no `#{attr}` in params" do params.delete attr self.instance_eval &block expect(response.status).to eq(400) end end