spec/client/request_spec.rb in mirage-3.0.0.alpha.2 vs spec/client/request_spec.rb in mirage-3.0.0.alpha.3

- old
+ new

@@ -1,52 +1,36 @@ require 'spec_helper' -require 'mirage/client' +describe Request do + let(:request_url) { "url" } + let(:trigger_url) { "trigger url" } -describe Mirage::Request do - Request = Mirage::Request + let(:body) { "body" } + let(:parameters) { {"name" => "joe"} } + let(:headers) { {"header" => "value"} } + let(:request_json) do + {body: body, + headers: headers, + parameters: parameters, + request_url: trigger_url} + end + it 'delete a request' do request_url = "url" Request.should_receive(:delete).with(request_url) request = Request.new request.request_url = request_url request.delete end it 'should load request data' do - request_url = "url" - trigger_url = "trigger url" + Request.should_receive(:backedup_get).with(request_url, format: :json).and_return(request_json) - body = "body" - parameters = {"name" => "joe"} - headers = {"header" => "value"} - - request_json = { - body: body, - headers: headers, - parameters: parameters, - request_url: trigger_url - } - - Request.should_receive(:backedup_get).with(request_url,format: :json).and_return(request_json) - request = Request.get(request_url) request.headers.should == headers request.body.should == body request.request_url.should == trigger_url request.parameters.should == parameters - end - - it 'should contain parameters' do - - end - - it 'should contain the request body' do - - end - - it 'should contain the triggering url' do - end end \ No newline at end of file