spec/ballast/service_spec.rb in ballast-2.0.0 vs spec/ballast/service_spec.rb in ballast-2.0.1
- old
+ new
@@ -31,18 +31,21 @@
end
end
describe "as_ajax_response" do
it "should create the right response" do
- expect(Ballast::AjaxResponse).to receive(:new).with(status: :ok, data: "DATA", error: nil)
+ expect(Ballast::AjaxResponse).to receive(:new).with(status: :ok, data: "DATA", error: nil, transport: nil)
Ballast::Service::Response.new(true, data: "DATA", errors: "ERRORS").as_ajax_response
- expect(Ballast::AjaxResponse).to receive(:new).with(status: 403, data: "DATA", error: "ERROR")
+ expect(Ballast::AjaxResponse).to receive(:new).with(status: 403, data: "DATA", error: "ERROR", transport: nil)
Ballast::Service::Response.new(false, data: "DATA", errors: {status: 403, error: "ERROR"}).as_ajax_response
- expect(Ballast::AjaxResponse).to receive(:new).with(status: :unknown, data: "DATA", error: "ERROR")
+ expect(Ballast::AjaxResponse).to receive(:new).with(status: :unknown, data: "DATA", error: "ERROR", transport: nil)
Ballast::Service::Response.new(false, data: "DATA", errors: "ERROR").as_ajax_response
+
+ expect(Ballast::AjaxResponse).to receive(:new).with(status: :unknown, data: "DATA", error: "ERROR", transport: "TRANSPORT")
+ Ballast::Service::Response.new(false, data: "DATA", errors: "ERROR").as_ajax_response("TRANSPORT")
end
end
end
describe Ballast::Service do
@@ -132,6 +135,6 @@
expect(DummyService).to receive(:fail!).with("ERRORS", on_validation: "ON VALIDATION")
DummyService.new.fail!("ERRORS", on_validation: "ON VALIDATION")
end
end
-end
\ No newline at end of file
+end