Permalink
Browse files

fix two specs that broke with recent changes

  • Loading branch information...
1 parent 7042268 commit 51f57c24aded97c9c5b536a33581718cedea1e2d @em em committed Aug 10, 2011
Showing with 45 additions and 41 deletions.
  1. +5 −5 examples/examples.css
  2. +15 −15 recurly.css
  3. +19 −18 recurly.js
  4. +6 −3 test/all.html
View
@@ -30,7 +30,7 @@ code {
font-family: menlo, monaco, "Lucida Console", monospace;
padding: 2px 4px;
font-size: 13px;
- background: rgba(55,100,150,0.3);
+ background: rgba(55,100,150,0.30);
color: #fff;
letter-space: 1px;
text-shadow: 0 1px 0 #467;
@@ -59,8 +59,8 @@ a {
font-weight: inherit;
text-decoration: none;
position: relative;
- background: rgba(0,10,0,0.4);
- box-shadow: 0 2px 1px rgba(0,0,0,0.1);
+ background: rgba(0,10,0,0.40);
+ box-shadow: 0 2px 1px rgba(0,0,0,0.10);
}
#examples a:hover {
color: #fff;
@@ -73,12 +73,12 @@ a {
}
#recurly-subscribe,
#recurly-update-billing-info,
-#recurly-transaction {
+#recurly-one-time-transaction {
width: 500px;
margin: 30px auto;
padding: 0px;
border: 1px solid #999;
border-radius: 8px;
background: #fcfcfc url("../images/pulp.jpeg") repeat;
- box-shadow: 0px 1px 2px rgba(0,0,0,0.2), inset 0 1px 0 #fff;
+ box-shadow: 0px 1px 2px rgba(0,0,0,0.20), inset 0 1px 0 #fff;
}
View
@@ -202,7 +202,7 @@
background: -o-linear-gradient(top, #f0f0f0, #fff);
background: linear-gradient(top, #f0f0f0, #fff);
width: auto;
- box-shadow: inset 0 1px 4px 0 rgba(0,0,0,0.075);
+ box-shadow: inset 0 1px 4px 0 rgba(0,0,0,0.07);
text-shadow: none;
}
.recurly .add_ons .add_on.selected {
@@ -234,7 +234,7 @@
background: #70ccf8;
border: 1px solid #0090c9;
margin: 3px 0 1px 10px;
- box-shadow: inset 0 1px 0 0 rgba(255,255,255,0.35), 0 1px 1px 0 rgba(0,0,0,0.1);
+ box-shadow: inset 0 1px 0 0 rgba(255,255,255,0.35), 0 1px 1px 0 rgba(0,0,0,0.10);
background: #43bef9 url("images/coupon_check.png") no-repeat center center;
background: url("images/coupon_check.png") no-repeat center center, -webkit-linear-gradient(top, #71CDFA 0%, #43BEF9 50%, #00B1F6 50%, #71CEFB 100%);
background: url("images/coupon_check.png") no-repeat center center, -moz-linear-gradient(top, #71CDFA 0%, #43BEF9 50%, #00B1F6 50%, #71CEFB 100%);
@@ -246,19 +246,19 @@
background: url("images/coupon_check.png") no-repeat center center, -moz-linear-gradient(top, #71CDFA 0%, #43BEF9 50%, #00B1F6 50%, #71CEFB 100%);
background: url("images/coupon_check.png") no-repeat center center, -o-linear-gradient(top, #71CDFA 0%, #43BEF9 50%, #00B1F6 50%, #71CEFB 100%);
background: url("images/coupon_check.png") no-repeat center center linear-gradient(top, #71CDFA 0%, #43BEF9 50%, #00B1F6 50%, #71CEFB 100%);
- box-shadow: inset 0 1px 0 0 rgba(255,255,255,0.75), 0 1px 1px 0 rgba(0,0,0,0.1);
+ box-shadow: inset 0 1px 0 0 rgba(255,255,255,0.75), 0 1px 1px 0 rgba(0,0,0,0.10);
}
.recurly .coupon .check:active {
background: url("images/coupon_check.png") no-repeat center center, -webkit-linear-gradient(top, #f0f0f0, #fff);
background: url("images/coupon_check.png") no-repeat center center, -moz-linear-gradient(top, #f0f0f0, #fff);
background: url("images/coupon_check.png") no-repeat center center, -o-linear-gradient(top, #f0f0f0, #fff);
background: url("images/coupon_check.png") no-repeat center center linear-gradient(top, #f0f0f0, #fff);
- box-shadow: inset 0 3px 3px 0 rgba(0,0,0,0.025);
+ box-shadow: inset 0 3px 3px 0 rgba(0,0,0,0.03);
border: 1px solid #999;
}
.recurly .coupon.checking .check {
background: #f0f0f0 url("images/coupon_checking.gif") no-repeat center center;
- box-shadow: inset 0 3px 3px 0 rgba(0,0,0,0.025);
+ box-shadow: inset 0 3px 3px 0 rgba(0,0,0,0.03);
border: 1px solid #999;
}
.recurly .coupon.invalid .coupon_code {
@@ -291,7 +291,7 @@
text-shadow: 0 1px 0 #fec;
background: #ffc;
border: 1px solid #ba1;
- box-shadow: 3px 5px 5px 0 rgba(0,0,0,0.1);
+ box-shadow: 3px 5px 5px 0 rgba(0,0,0,0.10);
border-radius: 5px;
font-size: 13px;
}
@@ -303,7 +303,7 @@
}
.recurly .server_errors .error {
padding-left: 26px;
- background: rgba(240,250,0,0.5) url("images/error.png") no-repeat 5px 9px;
+ background: rgba(240,250,0,0.50) url("images/error.png") no-repeat 5px 9px;
}
.recurly .server_errors.any {
opacity: 1;
@@ -542,7 +542,7 @@
.recurly input {
background: #fff;
border: 1px solid #a0a0a5;
- box-shadow: inset 0 2px 3px rgba(0,0,0,0.1);
+ box-shadow: inset 0 2px 3px rgba(0,0,0,0.10);
display: block;
font-family: inherit;
font-size: 16px;
@@ -569,7 +569,7 @@
width: 460px;
position: relative;
left: -5px;
- text-shadow: 0 1px 0 rgba(255,255,255,0.5);
+ text-shadow: 0 1px 0 rgba(255,255,255,0.50);
}
.recurly .due_now .title {
float: left;
@@ -584,7 +584,7 @@
letter-spacing: 1px;
margin: 0;
position: relative;
- text-shadow: 0px 1px 1px rgba(0,0,0,0.9);
+ text-shadow: 0px 1px 1px rgba(0,0,0,0.90);
}
.recurly .footer {
border-radius: 0px 0px 9px 9px;
@@ -606,10 +606,10 @@
background: #e7a500;
border-radius: 10px;
outline: none;
- box-shadow: inset rgba(255,255,255,0.7) 0px 1px 0px, rgba(0,0,0,0.5) 0px 1px 3px;
+ box-shadow: inset rgba(255,255,255,0.70) 0px 1px 0px, rgba(0,0,0,0.50) 0px 1px 3px;
background-image: -webkit-gradient(linear, 0% 20%, 0% 100%, from(#fecd00), to(#ce7b00));
background: -moz-linear-gradient(top, #fecd00, #ce7b00);
- text-shadow: rgba(255,255,255,0.5) 0 1px 0;
+ text-shadow: rgba(255,255,255,0.50) 0 1px 0;
padding: 10px 20px;
}
.recurly button.submit:hover {
@@ -618,7 +618,7 @@
.recurly button.submit:active {
top: 2px;
color: #302106;
- text-shadow: rgba(255,255,255,0.5694) 0 -1px 0;
+ text-shadow: rgba(255,255,255,0.57) 0 -1px 0;
outline: none;
background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#ce7b00), to(#fecd00));
background: -moz-linear-gradient(top, #ce7b00, #fecd00);
@@ -631,7 +631,7 @@
padding: 0 10px;
font-weight: 700;
color: #555;
- text-shadow: rgba(255,255,255,0.5694) 0 1px 0;
+ text-shadow: rgba(255,255,255,0.57) 0 1px 0;
text-align: center;
opacity: 0.75;
border: 1px solid #767674;
@@ -646,5 +646,5 @@
background: -moz-linear-gradient(top, #dbd9d2, #999);
-webkit-background-clip: padding-box;
-webkit-box-shadow: rgba(255,255,255,0.69) 0px 1px 0px inset, rgba(0,0,0,0.26) 0px 2px 3px;
- box-shadow: rgba(255,255,255,0.699219) 0px 1px 0px inset, rgba(0,0,0,0.269219) 0px 2px 3px;
+ box-shadow: rgba(255,255,255,0.70) 0px 1px 0px inset, rgba(0,0,0,0.27) 0px 2px 3px;
}
View
@@ -427,6 +427,23 @@ R.flattenErrors = function(obj, attr) {
};
+R.replaceVars = function(str, vars) {
+ var all = [];
+ for(var k in vars) {
+ if(vars.hasOwnProperty(k)) {
+ var v = vars[k];
+
+ str = str.replace(new RegExp('\\{'+k+'\\}', 'g'), v);
+ all.push(k + '=' + v);
+ }
+ }
+
+ str = str.replace(/\{\*\}/g, all.join('&'));
+
+ return str;
+};
+
+
//////////////////////////////////////////////////
@@ -595,7 +612,7 @@ R.BillingInfo = {
return {
first_name: this.firstName
, last_name: this.lastName
- , month: this.expires.getMonth()
+ , month: this.expires.getMonth() + 1
, year: this.expires.getFullYear()
, number: this.number
, verification_value: this.cvv
@@ -1162,7 +1179,7 @@ function pullBillingInfoFields($form, billingInfo) {
billingInfo.cvv = getField($form, '.cvv', V(R.isNotEmpty), V(R.isValidCVV));
var exp = new Date(0);
- exp.setMonth( getField($form, '.month') );
+ exp.setMonth( getField($form, '.month') - 1 );
exp.setFullYear( getField($form, '.year') );
billingInfo.expires = exp;
@@ -1176,22 +1193,6 @@ function pullBillingInfoFields($form, billingInfo) {
}
-R.replaceVars = function(str, vars) {
- var all = [];
- for(var k in vars) {
- if(vars.hasOwnProperty(k)) {
- var v = vars[k];
-
- str = str.replace(new RegExp('\\{'+k+'\\}', 'g'), v);
- all.push(k + '=' + v);
- }
- }
-
- str = str.replace(/\\{\\*\\}/g, all.join('&'));
-
- return str;
-};
-
R.buildUpdateBillingInfoForm = function(options) {
var defaults = {
addressRequirement: 'full'
View
@@ -261,7 +261,7 @@
account_code: 123
, plan_code: 'abc'
};
- var expect = '/success?account=123&plan=abc&account=123&plan=abc&account=123';
+ var expect = '/success?account=123&plan=abc&account=123&account_code=123&plan_code=abc';
var result = R.replaceVars(url, vars);
deepEqual(result, expect);
});
@@ -383,6 +383,9 @@
$('.card_number input').val('4111-1111-1111-1111').change();
$('.cvv input').val('123').change();
+ $('.year select').val('2013').change();
+ $('.month select').val('3').change();
+
$('.address1 input').val('yee').change();
$('.address2 input').val('haw').change();
$('.city input').val('doo').change();
@@ -410,8 +413,8 @@
"billing_info": {
"first_name": undefined,
"last_name": undefined,
- "month": 9,
- "year": 2011,
+ "month": 3,
+ "year": 2013,
"number": "4111-1111-1111-1111",
"verification_value": "123",
"address1": "yee",

0 comments on commit 51f57c2

Please sign in to comment.