Skip to content

Commit

Permalink
refactor specs by using WSDSL[] method to find services
Browse files Browse the repository at this point in the history
  • Loading branch information
mhorbul committed Oct 15, 2011
1 parent 422df45 commit 702d356
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions spec/wsdsl_spec.rb
Expand Up @@ -75,7 +75,7 @@ class ItemsController < ProjectsController

it "should be able to dispatch controller" do
describe_service("projects.xml") { |s| }
service = WSList.all.find{|s| s.url == "projects.xml"}
service = WSList["projects.xml"]
service.controller_dispatch("application").
should == ["application", "projects", "list"]
end
Expand All @@ -91,10 +91,10 @@ class ItemsController < ProjectsController
service.action = "list"
end

service = WSList.all.find{|s| s.url == "project/:project_id/tasks.xml"}
service = WSList["project/:project_id/tasks.xml"]
service.controller_dispatch("application").should == ["application", "project", "list"]

service = WSList.all.find{|s| s.url == "project/:project_id/task/:task_id/items.xml"}
service = WSList["project/:project_id/task/:task_id/items.xml"]
service.controller_dispatch("application").should == ["application", "project", "list"]
end

Expand All @@ -103,7 +103,7 @@ class ItemsController < ProjectsController
service.controller_name = "UnknownController"
service.action = "list"
end
service = WSList.all.find{|s| s.url == "unknown.xml"}
service = WSList["unknown.xml"]
lambda { service.controller_dispatch("application") }.
should raise_error("The UnknownController class was not found")
end
Expand Down

0 comments on commit 702d356

Please sign in to comment.