Commit 7e8560649d117570855b4e807aa37497769ea699

Check Client#query_url against the actual routes

Commit diff

spec/lib/gitorious/ssh/client_spec.rb

 
2323 client.user_name.should == "johan"
2424 end
2525
26 def make_request(path)
27 request = ActionController::TestRequest.new
28 request.request_uri = path
29 request
30 end
31
2632 it "has a query_url" do
2733 client = Gitorious::SSH::Client.new(@strainer, "johan")
28 exp_url = "/projects/foo/repos/bar/writable_by?username=johan"
29 client.query_url.should == exp_url
34 # exp_url = "/projects/foo/repos/bar/writable_by?username=johan"
35 # client.query_url.should == exp_url
36
37 request = make_request(client.query_url)
38 ActionController::Routing::Routes.recognize(request).should == RepositoriesController
39 # check against the actual routes
40 request.symbolized_path_parameters[:action].should == "writable_by"
41 request.symbolized_path_parameters[:controller].should == "repositories"
42 request.symbolized_path_parameters[:project_id].should == "foo"
43 request.symbolized_path_parameters[:id].should == "bar"
3044 end
3145
3246 it "asks the server if a user has permission" do
toggle raw diff