Skip to content

Commit

Permalink
Fix tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
rstacruz committed Sep 11, 2011
1 parent 3b679e2 commit e680245
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 2 deletions.
9 changes: 9 additions & 0 deletions HISTORY.md
@@ -1,3 +1,12 @@
v0.1.0.rc2 - Sep 12, 2011
-------------------------

### Changed:
* Check for validity of models on the server, and add an example.
* Added examples in the documentation.
* Support multiple args in routes.
* Added more tests.

v0.1.0.rc1 - Sept 12, 2011
--------------------------

Expand Down
1 change: 0 additions & 1 deletion lib/sinatra/backbone.rb
Expand Up @@ -3,7 +3,6 @@ module Backbone
def self.version
"0.1.0.rc2"
end

end

autoload :RestAPI, "sinatra/restapi"
Expand Down
2 changes: 1 addition & 1 deletion test/app_test.rb
Expand Up @@ -50,7 +50,7 @@ def app() App; end
test "validation fail" do
hash = { :name => "The Claiming of Sleeping Beauty" }
post "/book", :model => hash.to_json
p last_response
assert last_response.status != 200
end

test "should 404" do
Expand Down
1 change: 1 addition & 0 deletions test/arity_test.rb
Expand Up @@ -31,6 +31,7 @@ def app() App; end

test "put/post" do
FauxModel.any_instance.expects(:x=).times(1).returns(true)
FauxModel.any_instance.expects(:valid?).times(1).returns(true)
FauxModel.any_instance.expects(:save).times(1).returns(true)

header 'Accept', 'application/json, */*'
Expand Down
1 change: 1 addition & 0 deletions test/emulate_test.rb
Expand Up @@ -18,6 +18,7 @@ def app() App; end
test "emulate json and emulate http" do
FauxModel.any_instance.expects(:two=).times(1).returns(true)
FauxModel.any_instance.expects(:save).times(1).returns(true)
FauxModel.any_instance.expects(:valid?).times(1).returns(true)
FauxModel.any_instance.expects(:to_hash).times(1).returns('a' => 'b')

post "/api/2", :model => { :two => 2 }.to_json
Expand Down

0 comments on commit e680245

Please sign in to comment.