Permalink
Browse files

Found the flaw in my test, which kept failing the multiple iterations…

… of /page/#. Oopsy.
  • Loading branch information...
1 parent 1bd3d86 commit 57b007d451d0708eab4af89bb2f5549eed3f9d53 @nowk committed Feb 9, 2010
Showing with 5 additions and 23 deletions.
  1. +5 −23 spec/pagin_spec.rb
View
@@ -66,7 +66,7 @@ def get_absolute(uri)
end
describe "with Pagin" do
- before(:each) do
+ before(:all) do
MyTestApp.register Sinatra::Pagin
end
@@ -104,28 +104,10 @@ def get_absolute(uri)
end
it "should not respond ok to multiple interations of /page/# ex: /page/1/page/2" do
- # get "/page/1/page/2"
- # last_response.should_not be_ok
- # last_response.status.should == 404
- # last_request.url.should == "http://example.org/page/1"
- pending <<-NOTE
- For some reason it iterates the before block for every instance of /page/#
-
- /page/1/page/2
-
- before seems to iterate for each instance of this. Cause that to be come
-
- /
-
- validating the local_path and executing the request. It shouldn't.
- It should only grab the last instance /page/# leaving us with
-
- /page/1
-
- the test for our demo app.
-
- * This works on the live app, so my testing is probably amiss
- NOTE
+ get "/page/1/page/2"
+ last_response.should_not be_ok
+ last_response.status.should == 404
+ last_request.url.should == "http://example.org/page/1"
end
it "should accept a page/0" do

0 comments on commit 57b007d

Please sign in to comment.