Skip to content

Commit

Permalink
Merge branch 'specs_for_issue_347' of github.com:qqshfox/grape into j…
Browse files Browse the repository at this point in the history
…son-post
  • Loading branch information
dblock committed Mar 4, 2013
2 parents 9c7f07b + d548bbd commit 0d05c42
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions spec/grape/api_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,20 @@ def subject.enable_root_route!
last_response.body.should eql 'hiya'
end

%w(put post).each do |verb|
['string', :symbol, 1, -1.1, {}, [], true, false, nil].each do |object|
it "allows a(n) #{object.class} json object for #{verb.upcase} when accessing the params" do
subject.send(verb) do
params # TODO: get the object passed in
{}
end
send verb, '/', MultiJson.dump(object), {'CONTENT_TYPE' => 'application/json'}
last_response.status.should == (verb == 'post' ? 201 : 200)
last_response.body.should eql '{}'
end
end
end

it 'allows for multipart paths' do

subject.route([:get, :post], '/:id/first') do
Expand Down

0 comments on commit 0d05c42

Please sign in to comment.