Skip to content

Commit

Permalink
rm funky spec
Browse files Browse the repository at this point in the history
  • Loading branch information
rubiii committed Jun 7, 2012
1 parent dbc513f commit 1134afb
Showing 1 changed file with 0 additions and 33 deletions.
33 changes: 0 additions & 33 deletions spec/savon/model_spec.rb
Expand Up @@ -7,7 +7,6 @@
end

describe ":model_soap_response hook" do

before(:all) do
model.actions :get_user, "GetAllUsers"
end
Expand All @@ -24,87 +23,67 @@
model.client.stubs(:request).returns("world") #
model.get_user.should == "hello world"
end

end

describe ".client" do

it "passes a given block to a new Savon::Client"

it "memoizes the Savon::Client" do
model.client.should equal(model.client)
end

end

describe ".config" do

it "memoizes a clone of the global config" do
model.config.should be_a(Savon::Config)
model.config.should_not equal(Savon.config)
end

end

describe ".endpoint" do

it "sets the SOAP endpoint" do
model.endpoint "http://example.com"
model.client.wsdl.endpoint.should == "http://example.com"
end

end

describe ".namespace" do

it "sets the target namespace" do
model.namespace "http://v1.example.com"
model.client.wsdl.namespace.should == "http://v1.example.com"
end

end

describe ".document" do

it "sets the WSDL document" do
model.document "http://example.com/?wsdl"
model.client.wsdl.document.should == "http://example.com/?wsdl"
end

end

describe ".headers" do

it "sets the HTTP headers" do
model.headers("Accept-Charset" => "utf-8")
model.client.http.headers.should == { "Accept-Charset" => "utf-8" }
end

end

describe ".basic_auth" do

it "sets HTTP Basic auth credentials" do
model.basic_auth "login", "password"
model.client.http.auth.basic.should == ["login", "password"]
end

end

describe ".wsse_auth" do

it "sets WSSE auth credentials" do
model.wsse_auth "login", "password", :digest

model.client.wsse.username.should == "login"
model.client.wsse.password.should == "password"
model.client.wsse.should be_digest
end

end

describe ".actions" do

before(:all) do
model.actions :get_user, "GetAllUsers"
end
Expand All @@ -118,7 +97,6 @@
end

context "(class-level)" do

it "executes SOAP requests with a given body" do
model.client.expects(:request).with(:wsdl, :get_user, :body => { :id => 1 })
model.get_user :id => 1
Expand All @@ -131,28 +109,21 @@
end

context "(instance-level)" do

it "delegates to the corresponding class method" do
model.expects(:get_all_users).with(:active => true)
model.new.get_all_users :active => true
end

end

end

describe "#client" do

it "returns the class-level Savon::Client" do
model.new.client.should == model.client
end

end

describe "overwriting action methods" do

context "(class-level)" do

let(:supermodel) do
supermodel = model.dup
supermodel.actions :get_user
Expand All @@ -171,11 +142,9 @@ def supermodel.get_user(body = nil, &block)

supermodel.get_user :id => 1
end

end

context "(instance-level)" do

let(:supermodel) do
supermodel = model.dup
supermodel.actions :get_user
Expand All @@ -195,9 +164,7 @@ def supermodel.get_user(body = nil, &block)

supermodel.get_user :id => 1
end

end

end

end

0 comments on commit 1134afb

Please sign in to comment.