Permalink
Browse files

small style fixes

  • Loading branch information...
1 parent 96c1405 commit ee3bc0a93d5c0c98bf2c91f30d35497aa33ef5f1 @johnbender committed Dec 20, 2010
Showing with 15 additions and 8 deletions.
  1. +8 −7 lib/jquery.flawed.js
  2. +7 −1 spec/unit/spec.js
View
@@ -9,10 +9,11 @@ jQuery.flawed = function (scope){
} catch (error) {
var stack, request_params;
- if(!(window.printStackTrace == undefined))
+ if(window.printStackTrace !== undefined){
stack = printStackTrace({e: error});
- else
+ } else {
stack = error;
+ }
request_params = jQuery.extend(jQuery.flawed.config.request, {
data: {
@@ -23,7 +24,8 @@ jQuery.flawed = function (scope){
},
beforeSend: function(request){
- request.setRequestHeader(jQuery.flawed.config.header, true);
+ request.setRequestHeader(jQuery.flawed.config.request.header,
+ true);
}
});
@@ -37,8 +39,7 @@ jQuery.flawed = function (scope){
jQuery.flawed.config = {
request: {
type: "POST",
- path: "/"
- },
-
- header: "x-jquery-flawed-stack"
+ path: "/",
+ header: "x-jquery-flawed-stack"
+ }
};
View
@@ -55,12 +55,18 @@ describe('jQuery.flawed', function(){
expect(proxy.path).to(be, '/foo');
});
- it('should use the header defined on the settings object', function(){
+ it('should use the type defined on the settings object', function(){
jQuery.flawed.config.request.type = 'POST';
expect_raise();
expect(proxy.type).to(be, 'POST');
});
+ it('should use the header defined on the settings object', function(){
+ jQuery.flawed.config.request.header = 'foo';
+ expect_raise();
+ expect(proxy.header).to(be, 'foo');
+ });
+
describe('data', function(){
before_each(function(){
expect_raise();

0 comments on commit ee3bc0a

Please sign in to comment.